refactor(serviceconfig): move release level from config to serviceconfig#4835
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors how release levels are handled across different language generators. It removes the ReleaseLevel field from config.Default and config.Library structs, centralizing the logic within a new ReleaseLevel method in serviceconfig.API. This method determines the release level for a given language, falling back to a general setting or "stable" if not specified. The changes update various language-specific generation and migration tools to use this new centralized ReleaseLevel determination. Review comments suggest that the ReleaseLevel hardcoding in internal/librarian/python/generate.go should be updated to use the serviceconfig.API object for correct derivation, and a redundant empty string check for sc.ReleaseLevel() in internal/librarian/rust/codec.go can be removed for simplification.
e403a32 to
5688a22
Compare
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (77.55%) is below the target coverage (78.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #4835 +/- ##
==========================================
- Coverage 81.47% 81.46% -0.02%
==========================================
Files 130 130
Lines 10885 10872 -13
==========================================
- Hits 8869 8857 -12
+ Misses 1383 1382 -1
Partials 633 633 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
90c0b69 to
2a343de
Compare
Release level is now determined by serviceconfig.API.ReleaseLevel() instead of config.Library.ReleaseLevel. This adds a ReleaseLevel method to serviceconfig.API that looks up the release level for a given language, falling back to the "all" language setting, then to "stable". The ReleaseLevel field has been removed from both config.Library and config.Default. All language packages now read release levels from serviceconfig (sdk.yaml) rather than librarian.yaml. Go's generator maps "stable" to "ga" since it uses different terminology. Migration tools no longer write release level to librarian.yaml, as the data lives in sdk.yaml and can be populated via the update-release-level import tool.
The Rust integration test (librarian generate --all + cargo check) is temporarily enabled for pull requests to validate the release level refactoring against google-cloud-rust.
4799c62 to
2580509
Compare
…neration_config.yaml (#4862) Ports over release_level info from google-cloud-java/generation_config.yaml to sdk.yaml. Filled out "preview" for empty values (default in java's current hermetic build logic), removed "stable" as it is [default](https://github.com/googleapis/librarian/blob/cec5d8b73019bdf85d7bd0843a74f84897b641c9/internal/serviceconfig/api.go#L167). Changes are made by running a temporarily script (included in commit [957dceb](957dceb) for record sake). This is a fix after #4835 moved the source of truth for release levels to sdk.yaml. Fix #4859
Release level is now determined by serviceconfig.API.ReleaseLevel() instead of config.Library.ReleaseLevel, which looks up the release level for a given language, falling back to the "all" language setting, then to "stable".
The ReleaseLevel field has been removed from both config.Library and config.Default.
All language packages now read release levels from serviceconfig (sdk.yaml) rather than librarian.yaml. Go's generator maps "stable" to "ga" since it uses different terminology (#4834).
Migration tools no longer write release level to librarian.yaml, since the data lives in sdk.yaml as the source of truth.