Skip to content

Conversation

@parthea
Copy link
Contributor

@parthea parthea commented Sep 20, 2023

In the owlbot_main function in synthtool/languages/python_mono_repo.py, the default_version argument of gcp.common.detect_versions() was missing causing the default_version to not be populated.

versions=gcp.common.detect_versions(
path=f"{package_dir}/google", default_first=True
),

parthea added a commit to googleapis/google-cloud-python that referenced this pull request Sep 21, 2023
…11677)

Here are the steps that I followed to generate this PR

- Update the `default_version` in `.repo-metadata.json` here

https://github.com/googleapis/google-cloud-python/blob/eca60c3027820c97fc12590d0709b8fe3eb54034/packages/google-ai-generativelanguage/.repo-metadata.json#L14
- Work around the docs issue mentioned in
googleapis/gapic-generator-python#1776 by
applying this change locally
- Build the `v1beta2` and `v1beta3` clients locally in a clone of
[googleapis/googleapis](https://github.com/googleapis/googleapis) using
`bazel build
//google/ai/generativelanguage/v1beta3:ai-generativelanguage-v1beta2-py`
and `bazel build
//google/ai/generativelanguage/v1beta3:ai-generativelanguage-v1beta3-py`
- Run the docker containers for the owlbot copy-code and owlbot post
processor
```
 docker run --rm --user $(id -u):$(id -g)   -v $(pwd):/repo   -v /usr/local/google/home/partheniou/git/googleapis/bazel-bin:/bazel-bin   gcr.io/cloud-devrel-public-resources/owlbot-cli:latest copy-bazel-bin   --config-file=packages/google-apps-script-type/.OwlBot.yaml   --source-dir /bazel-bin --dest /repo
 ```
 
```
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo
gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
```

I also had to fix a bug in synthtool for the owlbot post processing: googleapis/synthtool#1861. Without this fix, the [docs/index.rst](https://github.com/googleapis/google-cloud-python/blob/main/packages/google-ai-generativelanguage/docs/index.rst) file would list `v1beta2` as the default import instead of `v1beta3`.

Fixes #11676 🦕
@parthea parthea enabled auto-merge (squash) September 22, 2023 17:33
@parthea parthea merged commit 936e88e into master Sep 22, 2023
@parthea parthea deleted the fix-missing-default-version branch September 22, 2023 17:40
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Sep 22, 2023
This PR updates the post processor image to the latest one which is
`gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo@sha256:eeaeabb180cbcf1300469ae7621cc1dd24f06b48e4cd2962008bd5150c5f7c1e`.

The latest image includes the following fixes:
googleapis/synthtool#1861
googleapis/synthtool#1867

Run the following commands to obtain the latest sha256
```
docker pull gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
```

```
partheniou@partheniou-vm-3:~/git/google-cloud-python$ docker inspect --format='{{.RepoDigests}}' gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo:latest
[gcr.io/cloud-devrel-public-resources/owlbot-python-mono-repo@sha256:eeaeabb180cbcf1300469ae7621cc1dd24f06b48e4cd2962008bd5150c5f7c1e]
```
parthea added a commit to googleapis/google-cloud-python that referenced this pull request Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants