refactor(internal/librarian/golang): use ReleaseLevels in serviceconfig.API for release level detection#4558
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the release level detection for Go libraries, shifting the logic from being derived from API paths and library versions to using the ReleaseLevels map within serviceconfig.API. This change centralizes configuration and simplifies the codebase. The modifications in generate.go and repometadata.go are well-executed, and the tests have been updated accordingly to validate the new approach. The logic for determining the repo metadata release level has been correctly ported from legacylibrarian. I have one suggestion to further improve code conciseness.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4558 +/- ##
==========================================
- Coverage 79.90% 79.88% -0.02%
==========================================
Files 109 109
Lines 9115 9099 -16
==========================================
- Hits 7283 7269 -14
+ Misses 1322 1321 -1
+ Partials 510 509 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I thought release level was supposed to be language neutral per #3954 |
It is, but we are not there yet. Moving it to sdk.yaml is the first step. I need this change now because we want to achieve 0 diff during Go migration. We can update the logic so that all languages have the same way to retrieve the value. |
Set GAPIC option,
release-level, fromReleaseLevelsinserviceconfig.API.Set release-level in repo metadata according to API path and
ReleaseLevelsinserviceconfig.API. This logic is ported from legacylibrarian (source)Fixes #4435