Skip to content

chore: Add Owlbot config to repository #10011

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

Merged
merged 2 commits into from
Jun 12, 2023
Merged

chore: Add Owlbot config to repository #10011

merged 2 commits into from
Jun 12, 2023

Conversation

holtskinner
Copy link
Contributor

@holtskinner holtskinner commented May 19, 2023

  • Add Owlbot config to repository to automatically format code using blacken on Pull Requests.
  • Not sure if this was intentionally left out for some reason, feel free to reject if thats the case

@holtskinner holtskinner requested a review from a team as a code owner May 19, 2023 14:25
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label May 19, 2023
@holtskinner holtskinner added owlbot:run Add this label to trigger the Owlbot post processor. and removed samples Issues that are directly related to samples. labels May 19, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@holtskinner holtskinner added the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label May 19, 2023
Copy link
Contributor

@engelke engelke left a comment

Choose a reason for hiding this comment

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

Can you explain why this is needed? And get all tests to pass, please.

I'm not familiar with the synthtool library, and could not find documentation to answer my question: what is s.move(templated_files / "noxfile.py") doing. Is the library overloading the division operator?

@kweinmeister
Copy link
Contributor

Just FYI, this was started in an open PR #7810 but not yet completed.

FYI @parthea @loferris

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label May 21, 2023
@parthea
Copy link
Collaborator

parthea commented May 26, 2023

Can you explain why this is needed?

+1. We should add a note explaining what will happen when the owlbot configuration is added (eg. code formatting will run on every PR). We should also update contributors docs to let folks know that owlbot runs automatically on PRs which branched off main, and for branches from forks the owlbot:run label needs to be added for owlbot to run.

I'm not familiar with the synthtool library, and could not find documentation to answer my question: what is
s.move(templated_files / "noxfile.py") doing. Is the library overloading the division operator?

Regretfully, documentation for synthtool is lacking. I've added some answers below but let me know if I can clarify things further

templated_files = gcp.CommonTemplates().py_library()

# Copy the standard noxfile from templated_files
s.move(templated_files / "noxfile.py")

The source code for py_library is here. Regretfully py_library doesn't have a docstring that explains what it does. My understanding is that it returns a path to the googleapis python templates which are part of synthtool.

The source code for s.move is here. s.move() will move a file specified in sources to the current directory.

sources can be a Path, in that case a slash operation is supported.

For example, Path("test") / "testing" works

>>>from pathlib import Path
>>>example_path : Path = Path("test") / "testing"
>>>example_path
PosixPath('test/testing')

@kweinmeister kweinmeister requested review from a team as code owners May 26, 2023 19:40
@kweinmeister kweinmeister mentioned this pull request May 26, 2023
1 task
@gcf-owl-bot gcf-owl-bot bot requested review from a team, leahecole, bradmiro and chalmerlowe as code owners May 26, 2023 19:45
@holtskinner holtskinner removed request for a team June 12, 2023 16:13
@holtskinner holtskinner added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jun 12, 2023
@holtskinner holtskinner merged commit 225485b into main Jun 12, 2023
@holtskinner holtskinner deleted the owlbot-add branch June 12, 2023 18:17
@holtskinner holtskinner restored the owlbot-add branch June 12, 2023 19:10
holtskinner added a commit that referenced this pull request Jun 12, 2023
holtskinner added a commit that referenced this pull request Jun 12, 2023
gcf-merge-on-green bot pushed a commit that referenced this pull request Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:ignore instruct owl-bot to ignore a PR samples Issues that are directly related to samples. snippet-bot:no-prefix-req Instruct snippet-bot to ignore prefix requirement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants