Skip to content

Conversation

@brianf
Copy link

@brianf brianf commented Jan 22, 2026

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:

  • Command line flag: --ossi-url
  • Environment variable: OSS_INDEX_URL

Changes

  • ✅ Added --ossi-url CLI parameter in src/bin/pants/cli.rs
  • ✅ Implemented OSSIndexClient::new_with_url() method in src/client.rs
  • ✅ Updated main.rs to use custom URL when provided
  • ✅ Added unit test new_ossindexclient_with_custom_url() for custom URL functionality
  • ✅ Updated README with usage examples and documentation

Test Results

All tests pass (19 tests total):

  • ✅ Existing tests: All passing (no regressions)
  • ✅ New test: Custom URL functionality verified
  • ✅ Build: Successful with no new warnings

Usage Examples

Via environment variable:

export OSS_INDEX_URL=https://custom.ossindex.org/api/v3/
cargo pants

Via command line flag:

cargo pants --ossi-url https://custom.ossindex.org/api/v3/

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

This commit adds the ability to configure a custom OSS Index server URL,
making it possible to use cargo-pants with enterprise or custom OSS Index
deployments.

Changes:
- Added --ossi-url CLI parameter and OSS_INDEX_URL environment variable
- Implemented OSSIndexClient::new_with_url() method for custom URLs
- Updated main.rs to use custom URL when provided
- Added unit test for custom URL functionality
- Updated README with usage examples and documentation

The implementation maintains full backward compatibility - when no custom
URL is provided, it defaults to the production OSS Index URL.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@brianf brianf requested a review from bhamail as a code owner January 22, 2026 19:49
@paul-botsco-2-0 paul-botsco-2-0 bot added the 😧 commits missing verification Some commits are not signed - this must be resolved label Jan 22, 2026
@paul-botsco-2-0
Copy link

Thanks for the contribution. Unfortunately some of your commits don't meet our standards. All commits must be signed and have author information set.

The commits to review are:

See Signed Commits.

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

Labels

😧 commits missing verification Some commits are not signed - this must be resolved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants