Skip to content

fix: correctly find workspace.dependencies-declared dependencies and their Cargo.toml#5865

Merged
Nishnha merged 1 commit intodependabot:mainfrom
poliorcetics:5864-fix-rust-cargo-workspace-dep-discovery
Jul 27, 2023
Merged

fix: correctly find workspace.dependencies-declared dependencies and their Cargo.toml#5865
Nishnha merged 1 commit intodependabot:mainfrom
poliorcetics:5864-fix-rust-cargo-workspace-dep-discovery

Conversation

@poliorcetics
Copy link
Copy Markdown
Contributor

I would like help for writing a test, I have found cargo/file_fetcher_spec.rb, but I don't
understand how it works.

Closes #5864

@poliorcetics poliorcetics requested a review from a team as a code owner October 10, 2022 14:03
@poliorcetics poliorcetics force-pushed the 5864-fix-rust-cargo-workspace-dep-discovery branch 2 times, most recently from 556b218 to 38435a0 Compare October 10, 2022 14:20
@jakecoffman
Copy link
Copy Markdown
Member

I happened to have just created one in #5866, you can use it as an example.

The fixture is the response from api.github.com for a Cargo.toml. So for instance https://api.github.com/repos/tokio-rs/bytes/contents/Cargo.toml would be a valid fixture. The content field is the base64 encoded contents of the file.

In your test it will need to assert the array matches all the various Cargo.toml paths it should download.

@poliorcetics
Copy link
Copy Markdown
Contributor Author

I will two need Cargo.toml at least from a public repo with the problem then ?

@jurre
Copy link
Copy Markdown
Member

jurre commented Oct 10, 2022

I will two need Cargo.toml at least from a public repo with the problem then ?

You can also bas64 encode the contents of a cargo.toml that you have locally and stick it in the fixtures manually. We stub out any requests to the github api with those fixtures, so they don't need to exist for real

@jeffwidman
Copy link
Copy Markdown
Member

@poliorcetics Anything else we can do to unblock you here?

@jeffwidman
Copy link
Copy Markdown
Member

gentle nudge @poliorcetics

@jeffwidman
Copy link
Copy Markdown
Member

Checking in one last time @poliorcetics are you still interested in working on this?

@poliorcetics
Copy link
Copy Markdown
Contributor Author

Sorry I completely forgot to answer before, I don't think I can finish this.

For someone wanting to make it cross the finish line: the only thing left to do are tests

@jeffwidman jeffwidman force-pushed the 5864-fix-rust-cargo-workspace-dep-discovery branch from 38435a0 to f796a03 Compare January 10, 2023 20:00
@jeffwidman
Copy link
Copy Markdown
Member

Let me see if I can read up on cargo a little and put something together...

@poliorcetics poliorcetics force-pushed the 5864-fix-rust-cargo-workspace-dep-discovery branch from f796a03 to 3991e88 Compare June 13, 2023 20:31
@github-actions github-actions bot added the L: rust:cargo Rust crates via cargo label Jun 13, 2023
@jeffwidman
Copy link
Copy Markdown
Member

jeffwidman commented Jul 25, 2023

@poliorcetics I did spend some time on this back in January, and ran into some issues with creating mocks of test code in Rust. The code seems straightforward, but the UT I'd added kept failing--the ruby looked fine, so I think I was misunderstanding something about how the rust cargo files should look. Which is probably on me, as your example in #5864 makes sense.

Any chance you'd want to take another shot at writing a test, or at the very least push up an example repo or mock to help clarify?

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

Archived in project

Development

Successfully merging this pull request may close these issues.

Rust: Cargo.toml discovery fails if in a workspace and said manifest is not a member but used in members with workspace dependencies

5 participants