Repository navigation
build(deps): Add missing resolved and integrity for all dependencies - #3501
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Summary of Changes
Hello @ljxfstorm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses a critical issue in the package-lock.json file by adding missing resolved URLs and integrity hashes for several dependencies. This enhancement is primarily aimed at improving the project's compatibility with downstream package managers, such as Nix, which require these fields for sandboxed and reproducible builds.
Highlights
- Dependency Metadata Completion: Populated missing
resolvedURLs andintegrityhashes within thepackage-lock.jsonfile for various dependencies. This change is crucial for ensuring build reproducibility and compatibility with sandboxed build environments like Nix. - Improved Build Reproducibility: The addition of
resolvedandintegrityfields allows package managers to deterministically fetch and verify package contents, preventing unexpected network access during builds and improving overall build reliability.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request updates the package-lock.json file to include resolved and integrity fields for several dependencies. These changes are beneficial as they enhance build reproducibility and security, particularly for sandboxed build environments like Nix. The modifications are consistent with the PR's goal and appear to be correct. I found no issues with the changes.
|
Resolved conflicts introduced by updates from main. |
|
Just stumbled about this as well. It would be great, if the necessary fields could be added to the package-lock.json, to make it easier for downstream package maintainers to keep gemini-cli updated! |
I'd emphasize security concern here more than downstream work |
NTaylorMullen
left a comment
There was a problem hiding this comment.
Great addition thank you @ljxfstorm !
TLDR
Updated the
package-lock.jsonto ensure all dependencies have theresolvedandintegrityfields populated.Dive Deeper
When attempting to update the package of this project using the Nix package manager, the build fails. This is because Nix's build process is heavily sandboxed and relies on fixed-output derivations. It requires the
integrityhash to verify package contents and theresolvedURL to fetch them deterministically, disallowing any unexpected network access during the build phase.The previous
package-lock.jsonwas missing these fields for several dependencies since 0.1.7. This PR addresses the issue by adding them back, which facilitates downstream packaging and improves overall build reproducibility.Reviewer Test Plan
Since this PR only modifies the lockfile, the primary goal is to verify that it doesn't introduce any regressions.
package-lock.jsondiff. The changes should be the addition ofresolvedandintegritylines, not unexpected or major version bumps of dependencies.- Run the following
- Run the command again with this PR's
This confirms that all external dependencies have thejqcommand withpackage-lock.json(before this change). It will list several external dependencies that are missing the fields:jq '.packages | to_entries[] | select((.value | has("resolved") | not) or (.value | has("integrity") | not)) | .key' package-lock.jsonpackage-lock.json. It will list as below:resolvedandintegrityfields.Testing Matrix
Linked issues / bugs
#4109
This is a proactive enhancement to improve compatibility for downstream packagers.