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

Crates published on a custom registry cannot be checked using default settings #166

Open
obi1kenobi opened this issue Oct 31, 2022 · 4 comments
Labels
C-enhancement Category: raise the bar on expectations

Comments

@obi1kenobi
Copy link
Owner

By default, cargo semver-checks check-release attempts to look up the most recent previous version of the crate on crates.io. This won't work for crates that are only published on a custom registry.

The README has a decent workaround for now, but it's still a workaround and it would be more ergonomic to natively support custom registries at some point.

@bonsairobo
Copy link

Are there known roadblocks to implementing this? I did a little digging and AFAICT the crates_index crate already supports alternate registries via the Index::from_url constructor (assuming that credentials can be accessed from the local git credentials helper). So I think supporting an alternate registry is just a matter of plumbing the URL through to the RustdocFromRegistry constructor.

@obi1kenobi
Copy link
Owner Author

The primary challenges are ones of UX design and ergonomics, I think. These would be things like "what does the CLI look like" and "what happens if a crate is both on crates.io and also on another registry" etc.

If you're interested in giving this a shot, please do! I'd recommend laying out the proposed design before starting to write code, so we can figure out all the edge cases without being distracted by implementation details.

@j-baker
Copy link

j-baker commented Dec 15, 2023

Hi! I can't commit to working on this as of right now, but maybe to nudge progress along I'd like to lay out a proposal for a design here.
In particular, a simple intuition regarding ergonomic UX would be to match Cargo's behaviour in publish; that is to say, to implement approximately:

  1. Accept a registry name with --registry foo. Look that registry up in Cargo configs, possibly with the cargo-config2 crate.
  2. If not specified and there is a package.publish field in Cargo.toml with a single registry, publish to that registry.
  3. Otherwise, use the default registry.

@obi1kenobi
Copy link
Owner Author

I think there are a few more edge cases to tackle, but in broad strokes that makes sense.

It's my impression that nearly all use cases that require a custom registry are related to commercial activity. I'd love it if the companies publishing crates to private registries sponsored cargo-semver-checks development!

Right now, I have to be extremely aggressive about limiting the maintenance cost of this project. That means I can't afford to include features like this one that run a risk of causing a high maintenance and support burden ("why doesn't it work with my registry?") and risk burning me out in the process. I'd love to make this a self-sustaining project with a stable income, instead of a thing I do in spare time on nights and weekends.

If you work at a company that uses cargo-semver-checks, and especially one that wants to use it with a custom registry, please talk to them about sponsoring its development. If you aren't sure how to approach that conversation, or if your company is interested in any additional services, please give me a ping!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: raise the bar on expectations
Projects
None yet
Development

No branches or pull requests

3 participants