Skip to content
New issue

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

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

Already on GitHub? # to your account

Custom registry does not seem supported #160

Open
nbigaouette opened this issue Oct 26, 2022 · 4 comments
Open

Custom registry does not seem supported #160

nbigaouette opened this issue Oct 26, 2022 · 4 comments
Labels
A-cli Area: engine around the lints C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@nbigaouette
Copy link

Describe your use case

I'd like to integrate cargo-semver-check workflow into CI at work where we use a custom crate registry to (internally) publish our crates.

Unfortunately, cargo-semver-check fails to run on a crate that is published on the custom registry:

❯ cargo semver-checks check-release --verbose
    Updating index
     Parsing mycrate v0.1.0 (current)
 Documenting mycrate v0.1.0 (~/mycrate.git)
    Finished dev [unoptimized + debuginfo] target(s) in 0.96s
Error: mycrate not found in registry

I suspect this is because it is not aware of the crate registry when trying to download the crate.

Describe the solution you'd like

cargo-semver-check should fetch the published package from the crate registry it has been published previously.

In my case, this information is located in the repo's .cargo/config, but I think that info can also be located elsewhere.

Alternatives, if applicable

No response

Additional Context

No response

@nbigaouette nbigaouette added the C-enhancement Category: raise the bar on expectations label Oct 26, 2022
@obi1kenobi
Copy link
Owner

Thanks for the detailed report!

I think we both want to add custom registry support, and in the meantime also provide a better, more actionable error message than the current one.

While the registry-based previous version lookup won't work with a custom registry, you should be able to use one of the other ways to tell cargo-semver-checks about the previous version to compare against. Excerpt from cargo semver-checks check-release --help:

      --baseline-rev <REV>
          Git revision to lookup for a baseline

      --baseline-root <MANIFEST_ROOT>
          Directory containing baseline crate source

      --baseline-rustdoc <JSON_PATH>
          The rustdoc json file to use as a semver baseline

I think all of those should be unaffected by the custom registry setup, and should able to unblock your current use case today. Please let us know if that works!

@obi1kenobi
Copy link
Owner

I'm adding an entry to the FAQ about using the other baseline generation options for custom registries until this issue is resolved: #165

@nbigaouette
Copy link
Author

Thanks for the explanation! I've followed the FAQ which was straight to the point, used --baseline-rev to make the check and everything works as expected.

Thanks again!

@pwnorbitals
Copy link

This issue was "closed as completed", does this mean custom registries are now supported ? Otherwise, I would suggest leaving this issue open, as an indication the project could accept PRs to add support

@obi1kenobi obi1kenobi reopened this Jul 26, 2023
@obi1kenobi obi1kenobi added A-cli Area: engine around the lints E-help-wanted Call for participation: Help is requested to fix this issue. labels Jul 26, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-cli Area: engine around the lints C-enhancement Category: raise the bar on expectations E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

3 participants