Add configurable OSS Index URL support #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ability to configure a custom OSS Index server URL, enabling cargo-pants to work with enterprise or custom OSS Index deployments.
Previously, the OSS Index URL was hardcoded to
https://ossindex.sonatype.org/api/v3/. This enhancement allows users to override it via:--ossi-urlOSS_INDEX_URLChanges
--ossi-urlCLI parameter insrc/bin/pants/cli.rsOSSIndexClient::new_with_url()method insrc/client.rsmain.rsto use custom URL when providednew_ossindexclient_with_custom_url()for custom URL functionalityTest Results
All tests pass (19 tests total):
Usage Examples
Via environment variable:
export OSS_INDEX_URL=https://custom.ossindex.org/api/v3/ cargo pantsVia command line flag:
Backward Compatibility
✅ Fully backward compatible - when no custom URL is provided, defaults to production OSS Index URL
Related
This follows the same pattern implemented in other Sonatype OSS Index clients (e.g., auditjs) for consistency across the ecosystem.
🤖 Generated with Claude Code