Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to owl bot #411

Merged
merged 17 commits into from Jul 19, 2021
Merged

chore: migrate to owl bot #411

merged 17 commits into from Jul 19, 2021

Conversation

parthea
Copy link
Contributor

@parthea parthea commented May 13, 2021

This PR migrates from autosynth to owl bot. owl bot will save time for maintainers as it will automatically open PRs when there are updates in googleapis-gen without requiring maintainers to run synthtool to build the client from protos. Additionally, similar to autosynth, PRs will be automatically opened when there are template updates.

@parthea parthea requested a review from a team as a code owner May 13, 2021 01:50
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the googleapis/python-pubsub API. label May 13, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label May 13, 2021
Copy link
Contributor

@pradn pradn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to test this before submitting?

@plamut
Copy link
Contributor

plamut commented May 14, 2021

@pradn I had the exact same question. The docs are in the making, but until then, the steps posted here should be sufficient to run the bot locally and test how it performs.

I'll try it out myself too early next week.

@pradn pradn requested a review from plamut May 14, 2021 21:51
@pradn
Copy link
Contributor

pradn commented May 14, 2021

Docs to learn more about this:
https://g3doc.corp.google.com/company/teams/dpe-github-automation/owlbot.md?cl=head

@parthea parthea requested a review from busunkim96 May 15, 2021 12:55
@plamut
Copy link
Contributor

plamut commented May 15, 2021

I don't have access to Google internals. :)

I was not able to pull an image from gcr.io/repo-automation-bots to test this PR. I probably lack permissions on repo-automation-bots, as I can pull some other images from gcr.io just fine (namely, those that I uploaded myself to the common development Google Cloud project).

@parthea
Copy link
Contributor Author

parthea commented May 16, 2021

The OwlBot Post Processor is already included in the checks section as a result of this PR. It is one of the 9 successful checks. The docker file used to create the image lives here. For testing purposes, you could run gcloud builds submit --config=docker/owlbot/python/cloudbuild.yaml --substitutions=SHORT_SHA=$(git rev-parse --short HEAD) from the root of https://github.com/googleapis/synthtool to deploy your own post processor image. You would need to specify a PROJECT_ID which is used here.

Copy link
Contributor

@plamut plamut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parthea Thanks, that was helpful! Missed that new CI check, as it was hidden (the checklist is collapsed by default).

I successfully built and uploaded the image to "our" development Google Cloud project, pulled it, and ran it locally - it worked like a charm.

I also verified that a replacement rule change in owlbot.py was indeed reflected in the generated code.

Looking forward to the docs update to explain how to run owlbot locally when developing, but as far as this PR is concerned, I think it's good.

@plamut
Copy link
Contributor

plamut commented May 16, 2021

One minor thing (not a blocker) - the CI check say it successfully ran 9 steps, but without any details. What would be the best way to diagnose any errors if that check fails?

(possible example: a bad replacement rule in owlbot.py)

@plamut
Copy link
Contributor

plamut commented May 18, 2021

@pradn Do you have anything to add here?

@plamut plamut added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label May 18, 2021
@plamut
Copy link
Contributor

plamut commented May 18, 2021

Let's just wait with merging until the release PR is done.

@parthea
Copy link
Contributor Author

parthea commented May 19, 2021

Let's wait for googleapis/repo-automation-bots#1790 to see if that helps to view logs from owl bot.

@plamut
Copy link
Contributor

plamut commented May 27, 2021

Release completed (last week already).

Still not sure if we should merge this, though, because it would be quite impractical for external contributors to build their own Docker images and upload them to where they can actually access them.

@parthea
Copy link
Contributor Author

parthea commented May 28, 2021

@plamut Sounds good. Let's wait for googleapis/repo-automation-bots#1790

@plamut
Copy link
Contributor

plamut commented Jun 15, 2021

For the record - after #299 is merged, we need to port its changes to synth.py to owlbot.py here.

@plamut
Copy link
Contributor

plamut commented Jul 15, 2021

@parthea Do we have an update on this?

I noticed in #451 that the library suffers from the gpg: keyserver receive failed error, but did not benefit from the fix like BigQuery did, because owlbot migration is not yet done here.

Please advise, thanks!

@parthea
Copy link
Contributor Author

parthea commented Jul 15, 2021

Hi @plamut ,

I've pushed a new image to cloud-devrel-public-resources. Please can you try running docker pull gcr.io/cloud-devrel-public-resources/owlbot-python:latest as a test to see if you have access?

@plamut
Copy link
Contributor

plamut commented Jul 16, 2021

@parthea Ran out of time today for Pub/Sub, but will try it net week.

@parthea parthea added the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 17, 2021
@parthea parthea requested a review from a team as a code owner July 17, 2021 10:20
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 17, 2021
@parthea parthea added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 17, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 17, 2021
@parthea
Copy link
Contributor Author

parthea commented Jul 17, 2021

I ran these commands to copy the generated code for pubsub from googleapis-gen.

docker pull gcr.io/repo-automation-bots/owlbot-cli:latest
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/repo -w /repo gcr.io/repo-automation-bots/owlbot-cli:latest copy-code
docker pull gcr.io/cloud-devrel-public-resources/owlbot-python:latest
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo gcr.io/cloud-devrel-public-resources/owlbot-python:latest

You should now be able to run the last 2 commands. The owlbot-cli image is not available in the cloud-devrel-public-resources project yet. I've added an item to the agenda for the github automation team meeting to discuss whether it is possible to copy the owlbot-cli image to cloud-devrel-public-resources.

@parthea parthea removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 17, 2021
@parthea
Copy link
Contributor Author

parthea commented Jul 19, 2021

Hi @plamut, @pradn,

My initial thought is that we should go ahead and merge this without waiting for the owlbot-cli to be available in cloud-devrel-public-resources. It is not common to run the owlbot-cli manually as owlbot does that automatically for you once the migration is complete. This is the last python repo in googleapis that is still using autosynth. This PR is needed to complete the Yoshi Python migration to owl bot. You can now run the post processor image locally using these commands. WDYT?

docker pull gcr.io/cloud-devrel-public-resources/owlbot-python:latest
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo gcr.io/cloud-devrel-public-resources/owlbot-python:latest

@parthea parthea requested review from pradn and plamut July 19, 2021 10:16
@plamut
Copy link
Contributor

plamut commented Jul 19, 2021

@parthea If we can count on support in uncommon cases when manual intervention might be required, I'd say let's move things forward and complete the transition. Especially because keeping this open is prone to additional merge conflicts, the process requiring special handling of this library, and other overhead.

I'll wait for @pradn to also have a look.

@pradn
Copy link
Contributor

pradn commented Jul 19, 2021

Looks good, thanks!

@plamut plamut merged commit 232bff3 into master Jul 19, 2021
@plamut plamut deleted the owl-bot branch July 19, 2021 20:37
@plamut
Copy link
Contributor

plamut commented Jul 21, 2021

FWIW, I tried running the two commands from above and it worked like a charm. I successfully generated new changes locally (a new Samples section in CONTRIBUTING.rst in this particular case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the googleapis/python-pubsub API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants