Skip to content

Use cargo_metadata to get manifest data (adds workspace inheritance support)#82

Open
oeb25 wants to merge 1 commit intowebern:mainfrom
oeb25:master
Open

Use cargo_metadata to get manifest data (adds workspace inheritance support)#82
oeb25 wants to merge 1 commit intowebern:mainfrom
oeb25:master

Conversation

@oeb25
Copy link
Copy Markdown

@oeb25 oeb25 commented Feb 13, 2023

This commit uses the cargo_metadata crate to derive information about the crate, as opposed to only parsing Cargo.toml.

In particular, this helps when fields in the manifest are inherited from the workspace, for example if version = { workspace = true }.

One thing cargo_metadata does not provide, is badges, so these are still parsed from Cargo.toml.

The error messages also changed as a result of propagating the errors from cargo_metadata, and thus some of the tests had to be altered.

This commit uses the `cargo_metadata` crate to derive information about
the crate, as opposed to only parsing `Cargo.toml`.

In particular, this helps when fields in the manifest are inherited from
the workspace, for example if `version = { workspace = true }`.

One thing `cargo_metadata` does not provide, is badges, so these are
still parsed from `Cargo.toml`.

The error messages also changed as a result of propagating the errors
from `cargo_metadata`, and thus some of the tests had to be altered.
@sshine
Copy link
Copy Markdown
Collaborator

sshine commented Apr 10, 2026

This is great, thåmbs up! It is the better way of resolving:

I'd like to take bring it to the end goal.

Since it comes from oeb25:master, I can't push to it even if I were a co-maintainer here.

If you'd like, perhaps you can rebase this and I can see if I can start the CI build and review. If you're not interested, I will open another PR and cherry-pick your changes for attribution.

@sshine sshine changed the title Use cargo_metadata to get manifest data Use cargo_metadata to get manifest data (adds workspace inheritance support) Apr 10, 2026
@sshine sshine added the focus 👀 While tidying up the pull request backlog, this one is targeted for merging label Apr 10, 2026
@webern
Copy link
Copy Markdown
Owner

webern commented Apr 10, 2026

Since it comes from oeb25:master, I can't push to it even if I were a co-maintainer here.

You might be able to? Maybe it involves using the gh command line tool? I've been able to push, force push, and rebase to contributor PR branches. I'm not sure how that works under the hood because surely I haven't actually changed the branch in that person's repo. Anyway, you can edit a PR, at least with gh, afaik.

@sshine
Copy link
Copy Markdown
Collaborator

sshine commented Apr 10, 2026

There's a deliberate limitation on GitHub which prevents maintainers of the original repo from pushing to the forked master/main branch of a pull request. It has some kind of special status. Since the PR is quite old, the workaround might not be too bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

focus 👀 While tidying up the pull request backlog, this one is targeted for merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants