fix(nodejs): run combine-library with a temporary destination#6262
Draft
jskeet wants to merge 2 commits into
Draft
fix(nodejs): run combine-library with a temporary destination#6262jskeet wants to merge 2 commits into
jskeet wants to merge 2 commits into
Conversation
Contributor
Author
|
@quirogas I haven't changed any tests here beyond removing the OwlBot one - |
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the Node.js post-processing and cleaning logic, modifying which files are cleaned and running combine-library in a temporary directory before copying files back using os.CopyFS. Feedback highlights critical issues with this approach: running combine-library in an empty directory prevents it from merging with the existing package.json, which will destroy handwritten changes, and os.CopyFS will silently overwrite existing files instead of failing as expected.
jskeet
commented
Jun 3, 2026
Instead of backing up "kept" files, combine-library is run with a temporary directory as the destination, relying on the "clean" operation in librarian to perform deletions. `os.CopyFS` is then used to copy the resulting combined library, which means that any file which hasn't been cleaned but is still generated causes a failure. (This improves confidence that we're cleaning everything we should.) The README.md that's generated is then modified to have the correct release level and samples. OwlBot YAML file removal is removed from generate, as it already happens as part of the clean operation. With this change, no default keep list is required, as there is a cleaner separation between generated and handwritten files.
7d67623 to
b31b9f8
Compare
This doesn't yet test that the post-processor actually fixes up the README file, but it stops the existing tests from failing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of backing up "kept" files, combine-library is run with a temporary directory as the destination, relying on the "clean" operation in librarian to perform deletions.
os.CopyFSis then used to copy the resulting combined library, which means that any file which hasn't been cleaned but is still generated causes a failure. (This improves confidence that we're cleaning everything we should.)OwlBot YAML file removal is removed from generate, as it already happens as part of the clean operation.
With this change, no default keep list is required, as there is a cleaner separation between generated and handwritten files.