-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: Add support for workspace.dependencies
in cargo
1.64.0+
#5794
feat: Add support for workspace.dependencies
in cargo
1.64.0+
#5794
Conversation
Since Dependabot already handled dependencies like |
Hi @poliorcetics, thanks for this contribution! I'm new to the Rust ecosystem, so I did some light reading on [workspace.dependencies] and it looks like the key is actually called Dependabot will already include any dependencies under the dependabot-core/cargo/lib/dependabot/cargo/file_parser.rb Lines 64 to 70 in 78afa00
In order to get this merged in we will need to test that a project with Something similar to dependabot-core/cargo/spec/dependabot/cargo/file_parser_spec.rb Lines 123 to 151 in 78afa00
The manifest referenced in that file is at https://github.com/dependabot/dependabot-core/blob/78afa00dbd274ed937d8ff70118d2d4335d39526/cargo/spec/fixtures/manifests/repeated_dependency |
This is not a single TOML key, This is a key and a subkey. The following samples are equivalent (Rust playground code for example) [workspace.dependencies]
dep-name = "version" [workspace]
dependencies = { dep-name = "version" } workspace.dependencies = { dep-name = "version" } So to parse Thanks for the guidance on testing, I'll try to write one |
f1b723f
to
70e26f9
Compare
5d8daef
to
b4eca22
Compare
b4eca22
to
3a2b127
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR updates the version of Cargo we use in our Dockerfile since it introduces support for a new feature.
I thought about moving the check for workspace dependencies into our existing DEPENDENCY_TYPES.each loop in the file_parser, but it's more maintainable as it is and Cargo workspaces currently only support regular dependencies (as opposed to dev-dependencies and build-dependencies), so this is fine.
e3d9cec
to
be1c977
Compare
Thanks for the help and fixing my mistakes @Nishnha, it was greatly appreciated 😄 |
be1c977
to
f4f6ba2
Compare
What's left to do ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know a ton about Rust, but from what I understand this looks straightforward.
We follow a deploy-then-monitor-prod-then-merge strategy, so one of us will try to do that when we get a few spare cycles in the next few days.
f4f6ba2
to
1a8b571
Compare
1a8b571
to
0c3bfbe
Compare
I did not write tests because I don't know enough Ruby to do it, but I
will gladly accept directions on it.
Closes #5315
See the section on Cargo in https://github.com/rust-lang/rust/releases/tag/1.64.0 for more details about the workspace feature.