Skip to content

fix(internal/librarian/nodejs): skip writeRepoMetadata when file is in keep list#4791

Merged
julieqiu merged 2 commits intogoogleapis:mainfrom
julieqiu:nodejs-skip-repo-metadata-keep
Mar 24, 2026
Merged

fix(internal/librarian/nodejs): skip writeRepoMetadata when file is in keep list#4791
julieqiu merged 2 commits intogoogleapis:mainfrom
julieqiu:nodejs-skip-repo-metadata-keep

Conversation

@julieqiu
Copy link
Member

@julieqiu julieqiu commented Mar 24, 2026

writeRepoMetadata unconditionally overwrites .repo-metadata.json after combine-library runs, even when the file is in the library's keep list. The keep/restore logic correctly preserves the file, but writeRepoMetadata then replaces it with a generated version that differs in formatting and content.

This checks for .repo-metadata.json in the keep list before calling writeRepoMetadata, so that existing repo metadata files are preserved during generation.

For #4743

…n keep list

The writeRepoMetadata function unconditionally overwrites
.repo-metadata.json after combine-library runs, even when the file is
in the library's keep list. The keep/restore logic correctly preserves
the file, but writeRepoMetadata then replaces it with a generated
version that differs in formatting and content.

This checks for .repo-metadata.json in the keep list before calling
writeRepoMetadata, so that existing repo metadata files are preserved
during generation.

For googleapis#4413
For googleapis#4743
@julieqiu julieqiu requested a review from a team as a code owner March 24, 2026 01:05
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.25%. Comparing base (ec072a6) to head (2285958).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/librarian/nodejs/generate.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4791   +/-   ##
=======================================
  Coverage   81.25%   81.25%           
=======================================
  Files         129      129           
  Lines       10875    10876    +1     
=======================================
+ Hits         8836     8837    +1     
  Misses       1396     1396           
  Partials      643      643           

☔ 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.

Copy link
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 correctly prevents writeRepoMetadata from overwriting .repo-metadata.json when it is present in the library's keep list. The change is implemented by adding a check before the function call and is accompanied by a new test case that verifies the intended behavior. The implementation is clear, correct, and well-tested.

Signed-off-by: Julie Qiu <julieqiu@google.com>
@julieqiu julieqiu enabled auto-merge (squash) March 24, 2026 02:45
@julieqiu julieqiu merged commit 1598047 into googleapis:main Mar 24, 2026
24 checks passed
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