Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo implementation must support Cargo sparse index file format #9783

Merged
merged 11 commits into from
May 20, 2024

Conversation

honeyankit
Copy link
Contributor

@honeyankit honeyankit commented May 20, 2024

Context

The Cargo implementation for private registries should support the sparse index file format. In sparse registries, the response consists of multiple JSON objects instead of a single JSON object when checking available versions. This PR addresses and handles that response format.

Fixes: #9764

@honeyankit honeyankit self-assigned this May 20, 2024
@github-actions github-actions bot added the L: rust:cargo Rust crates via cargo label May 20, 2024
@honeyankit honeyankit marked this pull request as ready for review May 20, 2024 21:10
@honeyankit honeyankit requested a review from a team as a code owner May 20, 2024 21:10
@honeyankit honeyankit force-pushed the honeyankit/fix-cargo-private-registy-response branch from 2b15ba0 to bfa47ed Compare May 20, 2024 21:28
Copy link
Contributor

@pavera pavera left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -67,7 +67,12 @@ def crates_listing
**SharedHelpers.excon_defaults(headers: hdrs)
)

@crates_listing = JSON.parse(response.body)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Output after fixing metadata changes:

Calling https://cargo.cloudsmith.io/honeyankit/test/he/ll/hello-world to fetch metadata for hello-world from sparse+https://cargo.cloudsmith.io/honeyankit/test/
Fetched metadata for hello-world from sparse+https://cargo.cloudsmith.io/honeyankit/test/ successfully
{"name": "hello-world", "vers": "1.0.0", "deps": [], "cksum": "b2c263921f1114820f4acc6b542d72bbc859ce7023c5b235346b157074dcccc7", "features": {}, "yanked": false, "links": null}
{"name": "hello-world", "vers": "1.0.1", "deps": [], "cksum": "8a55b58def1ecc7aa8590c7078f379ec9a85328363ffb81d4354314b132b95c4", "features": {}, "yanked": false, "links": null}
{"name": "hello-world", "vers": "1.0.2", "deps": [], "cksum": "9e21213589c10d30973283629bb27520ddf46141882e26ea10b70959c7bafc2c", "features": {}, "yanked": false, "links": null}
2024/05/20 22:53:57 INFO Latest version is 1.0.2
Setting CARGO_REGISTRIES_HONEYANKIT_TEST_TOKEN to 'placeholder_token' because dependabot-cli proxy will override it anyway
2024/05/20 22:53:58 INFO Requirements to unlock own
2024/05/20 22:53:58 INFO Requirements update strategy bump_versions
2024/05/20 22:53:58 INFO Updating hello-world from 1.0.1 to 1.0.2
Setting CARGO_REGISTRIES_HONEYANKIT_TEST_TOKEN to 'placeholder_token' because dependabot-cli proxy will override it anyway
2024/05/20 22:53:58 INFO Submitting hello-world pull request for creation
2024/05/20 22:53:59 INFO Finished job processing
2024/05/20 22:53:59 INFO Results:
+-----------------------------------------------+
|      Changes to Dependabot Pull Requests      |
+---------+-------------------------------------+
| created | hello-world ( from 1.0.1 to 1.0.2 ) |
+---------+-------------------------------------+

@honeyankit honeyankit merged commit c390fc2 into main May 20, 2024
56 checks passed
@honeyankit honeyankit deleted the honeyankit/fix-cargo-private-registy-response branch May 20, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: rust:cargo Rust crates via cargo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependabot-core Cargo implementation must support Cargo sparse index file format
2 participants