feat(internal/automation): add branch support to RepositoryConfig#2906
feat(internal/automation): add branch support to RepositoryConfig#2906noahdietz merged 5 commits intogoogleapis:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2906 +/- ##
=======================================
Coverage 83.32% 83.32%
=======================================
Files 133 133
Lines 10926 10928 +2
=======================================
+ Hits 9104 9106 +2
Misses 1409 1409
Partials 413 413 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for specifying a branch in the RepositoryConfig, which is then used to set the _BRANCH substitution for Cloud Build triggers. The implementation is correct and well-tested for the new functionality. My review includes suggestions to improve the test mock (mockCloudBuildClient) to better handle scenarios involving multiple repositories. Specifically, I've recommended changes to allow the mock to record all trigger runs and their substitutions, which will enhance the overall quality and reliability of the tests.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a Branch property to the RepositoryConfig to allow specifying a branch for Cloud Build jobs. The implementation correctly passes this branch as a _BRANCH substitution. The changes are well-tested, with new unit tests verifying the configuration parsing and the substitution logic. Overall, this is a solid contribution that enhances the automation capabilities. I have one minor suggestion to improve the readability of the test code.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for specifying a branch in the RepositoryConfig. The change is well-implemented, adding the Branch field to the configuration, using it to set the _BRANCH substitution for Cloud Build, and including tests to verify the new functionality. The related test mocks and test cases have been updated accordingly. I have one suggestion to improve the test suite's consistency and robustness, which I've added as a comment.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for specifying a branch in the repository configuration, which is then passed as a substitution to Cloud Build triggers. The implementation is straightforward and the new functionality is well-tested. I've also noticed that you've improved the existing tests by adding missing fields and assertions for substitutions, which is great. I have one suggestion to improve the maintainability of the newly added tests.
PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: not available Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/librarian-release-container:latest <details><summary>librarian: 0.7.0</summary> ## [0.7.0](v0.6.0...v0.7.0) (2025-11-20) ### Features * add command execution package with logging (#2968) ([12f4e94](12f4e949)) * add branch support to RepositoryConfig (#2906) ([2cab5d6](2cab5d65)) * add image sha as a config in repositories config (#2954) ([3d1f537](3d1f5375)) * add initial config (#2965) ([502b063](502b063c)) * add fetch package (#2964) ([53de44d](53de44d8)) * parse gapic_metadata for API version release notes (#2815) ([7ee0328](7ee03283)) * onboard 25 repositories to automation for publish-release (#2907) ([87fae04](87fae04a)) * add version command (#2894) ([8f85be0](8f85be09)) * add RequireCommand test helper (#2978) ([a820a71](a820a710)) * add initial command (#2961) ([c959aea](c959aeae)) * add `stage-release` command (#2902) ([ee05006](ee050065)) ### Bug Fixes * require git v2.28.0 (#2963) ([265ee47](265ee47f)) * enums referenced outside the package (#2952) ([7331816](73318169)) </details>
Adds
Branchproperty to theRepositoryConfig. This property configures the repository branch to be checked out by Cloud Build and the value of the--branchflag passed to eachlibrariancommand (as described in #2763 (comment)).The Cloud Build job is informed via the
_BRANCHsubstitution which will only be set here whenRepositoryConfig.Branchis set.The test cases for
TestRunCommandWithConfigare expanded to cover other triggers and to include expected substitutions for each.Note: As mentioned in #2763 (comment), I'm not sure how the
_BRANCHsubstitution is currently defaulted (if at all) for theclone-language-repostep that usesgit clone --branch(which should error out if provided with an empty value). All of thelibrariancommands default tomainwhen--branchis empty/unset.Fixes #2763