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

Add custom registry support #1048

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fujiapple852
Copy link

@obi1kenobi this PR is a rebase (and rework) of @drewkett's earlier PR #945, to add support for custom cargo registries, on top of the latest main. I say rework as main has changed quite a bit since the original PR and so a simple rebase was not enough.

This PR also adds an integration test for the custom registry functionality. The test use a static file mango registry which is served via an ephemeral axus instance. The test is self contained and does not require any external resources.

Finally, an unrelated bug I observed, with the regex used for the bugreport test, is resolved. This could be pulled out into a separate PR if needed.

The goal here is to get this into a suitable state such that it could be merged to main to thus avoid the need to maintain a downstream fork. I have kept my changes separate from @drewkett's original changes to aid in reviewing the delta, but the intention is to eventually squash these.

Thanks!

fujiapple852 and others added 5 commits December 16, 2024 18:53
This adds a `--registry` command line flag to the check release
capabilities. The argument to the flag is the name of the registry to
use to lookup the crates when using the default behavior or
--baseline-version. If left unset, the default behavior remains of
--checking crates.io.
- An ephemeral axum http server is started, which serves a static file based
  Cargo registry (using margo) called custom-registry.
- The registry custom-registry is pre-populated with the
  test_crates/custom_registry/old crate (version 0.1.0).
- The test runs semver-checks on test_crates/custom_registry/new (version 0.1.1)
  against registry custom-registry and asserts that there are no SemVer
violations.
- After the test the axum server is shutdown gracefully on both success and
  failure, there is also a timeout ensure the test does not hang.
Comment on lines +56 to +57
// Unclear what we should do here, panic for now...
todo!()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drewkett @obi1kenobi I wasn't sure what to do here, thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants