Skip to content

feat(librariangen): implement the build command#12817

Merged
jskeet merged 2 commits intogoogleapis:mainfrom
jskeet:build
Sep 8, 2025
Merged

feat(librariangen): implement the build command#12817
jskeet merged 2 commits intogoogleapis:mainfrom
jskeet:build

Conversation

@jskeet
Copy link
Copy Markdown
Contributor

@jskeet jskeet commented Sep 5, 2025

This assumes:

  • All modules have at least one test file (may not be true for things like orgpolicy which are just generated from protos, no GAPIC)
  • It's okay to just run go test ./... without worrying about integration tests

Additionally, it may be worth just running go test without the build part first; it's unclear to me whether that could lead to confusion though. Thoughts welcome.

This assumes:

- All modules have at least one test file (may not be true for things
  like orgpolicy which are just generated from protos, no GAPIC)
- It's okay to just run `go test ./...` without worrying about
  integration tests

Additionally, it *may* be worth just running `go test` without the
build part first; it's unclear to me whether that could lead to
confusion though. Thoughts welcome.
// goTest builds all the code under the specified directory
func goTest(ctx context.Context, dir, module string) error {
slog.Info("librariangen: testing", "module", module)
args := []string{"go", "test", "./..."}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: add -short flag to this command. This will exclude integration tests that expect creds.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Aha, great! That'll require tweaking the tests a bit... I'll do it first thing on Monday morning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in a new commit. (Also fixed some test issues - and I've raised googleapis/librarian#1960 to suggest using ContinueOnError for flag parsing errors, so we can test them.)

@jskeet jskeet enabled auto-merge (squash) September 8, 2025 10:15
@jskeet jskeet merged commit 14734c8 into googleapis:main Sep 8, 2025
9 checks passed
quartzmo pushed a commit that referenced this pull request Sep 22, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.123.0](v0.122.0...v0.123.0)
(2025-09-18)


### Features

* **internal/stategen:** Populate the latest googleapis commit
([#12880](#12880))
([7b017a0](7b017a0))
* **librariangen:** Implement the build command
([#12817](#12817))
([14734c8](14734c8))


### Bug Fixes

* **internal/librariangen:** Add link to source commit in release notes
([#12881](#12881))
([1c06cc6](1c06cc6))
* **internal/librariangen:** Fix CHANGES.md headers
([#12849](#12849))
([baf515d](baf515d))
* **internal/librariangen:** Remove go mod init/tidy from postprocessor
([#12832](#12832))
([1fe506a](1fe506a))
* **internal/librariangen:** Test for error path with flags
([#12830](#12830))
([f0da7b2](f0da7b2))
* **internal/postprocessor:** Add dlp to skip-module-scan-paths
([#12857](#12857))
([45a7d9b](45a7d9b))
* **librariangen:** Honor original container contract
([#12846](#12846))
([71c8fd3](71c8fd3))
* **librariangen:** Improvements to release-init
([#12842](#12842))
([0db677a](0db677a))
* **stategen:** Specify an appropriate tag format for google-cloud-go
([#12835](#12835))
([ffcff33](ffcff33))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
@jskeet jskeet deleted the build branch September 23, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants