fix: update owlbot configs to copy generated samples#8790
Conversation
meltsufin
left a comment
There was a problem hiding this comment.
Please merge in main and ensure that all ci checks are green.
da890b5 to
4ea11b6
Compare
73577dd to
9ead407
Compare
There was a problem hiding this comment.
How did you apply the script? Did you run this?
for F in `find . -maxdepth 2 -name '.OwlBot.yaml'`; do sh generation/set_owlbot_config.sh $F; done
I see some small differences when I run this command on the branch.
Also, would you mind adding a test to generated_files_sync.yaml for this script?
8d72152 to
ba31a4a
Compare
ba31a4a to
0039f58
Compare
Yes, that's what I ran. I had to manually edit
Sorry I'm having trouble finding where that file is - do you mind linking? Thank you! |
|
Chatted with Mike offline that the test should be added here: https://github.com/googleapis/google-cloud-java/blob/main/.github/workflows/generated_files_sync.yaml |
|
@meltsufin I chatted with @suztomo about this and it seemed the best way to test this was to run owlbot locally to confirm the correct directories get copied over. I did that and confirmed the updated .OwlbotYaml files are working as intended, but we're not sure of a good way to actually add a test for these files via a script. Do you have an idea of how you'd like to add a test? Or is testing Owlbot locally on this PR sufficient? Thanks! |
The manual test is good, but I was talking more about the kind of tests that |
Ahh I think I understand - I added a check to run |
generation/check_owlbot_config.sh
Outdated
| # Checks that each module's .OwlbotYaml file is correctly configured according to the template set in `set_owlbot_config.sh` | ||
|
|
||
| OWLBOT_FILE=$1 | ||
| for F in $(find . -maxdepth 2 -name '.OwlBot.yaml'); do sh generation/set_owlbot_config.sh "$F"; done |
There was a problem hiding this comment.
Since this actually modifies the files, and doesn't really check, I think the file name doesn't really make sense. Would it make sense to just add this loop to set_owlbot_config.sh and update places where it's used? I think we always want to apply this to all .OwlBot.yaml files.
There was a problem hiding this comment.
Hmm I see what you're saying; I did a little more digging and it looks like set_owlbot_config.sh is actually run as part of merge_repository.sh (https://github.com/googleapis/google-cloud-java/blob/main/generation/merge_repository.sh#L121) which is run regularly as a workflow: https://github.com/googleapis/google-cloud-java/blob/main/.github/workflows/merge_repository.yaml#L22.
My sense is that actually would suffice as the check for the Owlbot.yaml files - what do you think?
There was a problem hiding this comment.
That check doesn't apply to the entire repo and might go away in the future. I think the check your added is valuable beyond that.
There was a problem hiding this comment.
Thanks for pointers offline - let me know if this update works!
There was a problem hiding this comment.
This is good, but I think you need to update 2 places where this script is used: bootstrap.sh and merge_repository.sh
There was a problem hiding this comment.
Ahhh good catch; I updated merge_repository.sh. I think bootstrap.sh doesn't exist anymore as it was renamed to merge_repository.sh here: https://github.com/googleapis/google-cloud-java/pull/8832/files#diff-b082d5538e9aa0d75efd9ec5915d2a9462bd1237209225fa95b8be79517c0a63
There was a problem hiding this comment.
I see that you updated merge_repository.sh, but bootstrap.sh still needs an update.
There was a problem hiding this comment.
Right, never mind! I think it's still in my local for some reason.
| - name: Fail if there's any difference | ||
| run: git --no-pager diff --exit-code | ||
|
|
||
| owlbot-yaml: |
There was a problem hiding this comment.
Yes, this is what I had in mind. Thanks!
Fixes #8767
Tested with local Owlbot invocation using the following command (using
java-analyticshubas the example):