feat(internal/librariangen): implement the configure container command (and run go mod tidy)#13221
Merged
feat(internal/librariangen): implement the configure container command (and run go mod tidy)#13221
Conversation
This is completely lacking in tests, which should be provided before merging. The implementation will currently require a playbook along the lines of: 1. Run `librarian generate -api=google/cloud/abc/v1 -library=abc` 1. Run `(cd abc && go mod tidy)` 1. Run `go work use ./abc` 1. Commit changes and push Steps 2 and 3 are only needed for whole new libraries (as opposed to new APIs within existing libraries) It would be nice to be able to get rid of steps 2 and 3 entirely, but they're difficult. We can't run `go mod tidy` without source code, which either means running the generator during configure (which is ugly and somewhat against the spirit of configure) or do so in `generate`, but *only* on the very first run. We can't run `go work use` without copying *all* of the `go.mod` files referenced in there into the output directory (and then removing them again). We could modify `go.work` directly, but that's ugly too. These can be addressed in the longer term as we attempt to get to fully automated onboarding, but having the steps in the playbook introduces *relatively* little toil, while saving a *lot* of work in the container.
quartzmo
approved these changes
Oct 24, 2025
Member
quartzmo
left a comment
There was a problem hiding this comment.
Merging without tests. Test coverage must be added prior to deployment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is an alternative to #13214 - it's the same code but with one more commit, which:
go mod initfromconfigureto the generate postprocessor, conditional on the library being newgo mod tidyin the generate postprocessorThis avoids
go mod tidyhaving to be run by hand.