Skip to content

chore(internal/legacylibrarian): sync library versions in configuration#4961

Merged
JoeWang1127 merged 8 commits intomainfrom
chore/syncversion
Mar 31, 2026
Merged

chore(internal/legacylibrarian): sync library versions in configuration#4961
JoeWang1127 merged 8 commits intomainfrom
chore/syncversion

Conversation

@JoeWang1127
Copy link
Copy Markdown
Contributor

@JoeWang1127 JoeWang1127 commented Mar 31, 2026

The release stage now updates librarian.yaml with the latest library versions after saving the local state. This ensures that the generated configuration file stays in sync with the repository state during legacy releases.

The sync process detects version regressions and automatically runs the formatting utility on the updated configuration.

Fixes #4950

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces logic to synchronize library versions from the legacy librarian state into the librarian.yaml configuration file during the release process. It adds a syncVersion utility that updates the configuration and includes checks to prevent version regressions, supported by new unit tests. Review feedback identifies a bug where arguments in a regression error message are swapped and suggests using a repository-defined constant for the configuration file path to improve maintainability.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 86.95652% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.44%. Comparing base (1a762a6) to head (5594bd9).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...l/legacylibrarian/legacylibrarian/release_stage.go 86.95% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4961      +/-   ##
==========================================
+ Coverage   81.42%   81.44%   +0.01%     
==========================================
  Files         135      135              
  Lines       10791    10814      +23     
==========================================
+ Hits         8787     8807      +20     
- Misses       1355     1357       +2     
- Partials      649      650       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JoeWang1127 JoeWang1127 changed the title chore: sync version in release stage chore(internal/legacylibrarian): sync library versions in configuration Mar 31, 2026
@JoeWang1127 JoeWang1127 marked this pull request as ready for review March 31, 2026 20:56
@JoeWang1127 JoeWang1127 requested a review from a team as a code owner March 31, 2026 20:56
@JoeWang1127 JoeWang1127 requested review from codyoss March 31, 2026 20:56
Copy link
Copy Markdown
Member

@codyoss codyoss left a comment

Choose a reason for hiding this comment

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

Just one small things, else LGTM

@JoeWang1127 JoeWang1127 enabled auto-merge (squash) March 31, 2026 21:47
@JoeWang1127 JoeWang1127 merged commit 1144f1c into main Mar 31, 2026
39 checks passed
@JoeWang1127 JoeWang1127 deleted the chore/syncversion branch March 31, 2026 21:49
JoeWang1127 added a commit that referenced this pull request Mar 31, 2026
Remove `syncversion` tool because legacylibrarian release stage will
sync library version from state.yaml to librarian.yaml (#4961).

No need to run this tool manually.
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.

legacylibrarian: expand release stage to sync library version from state.yaml to librarian.yaml

2 participants