feat(api): migrate default API version from v2 to v3 - #74
Open
sfowl wants to merge 3 commits into
Open
Conversation
The Atlas v3 API adds /analysis/latest/component and other new endpoints. The v3 response schemas are backwards compatible with all fields the codebase currently reads. API version remains overridable via TRUSTIFY_API_VERSION env var. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The v3 API returns "total": null in paginated responses. When total is unknown, pagination now continues fetching until a page returns fewer items than the limit, ensuring all results are retrieved. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Request total=true on v3 paginated queries so Atlas returns a count when available, while keeping the null-total fallback. Add unit tests for v2 and v3 pagination paths and document the API version env var in README. Co-authored-by: Cursor <cursoragent@cursor.com>
jasinner
marked this pull request as ready for review
August 20, 2026 01:41
4 tasks
Collaborator
|
Superseded by #75 — branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Migrate TrustShell's default Trustify API path from
/api/v2/to/api/v3/to match current Atlas/RHTPA deployments.TRUSTIFY_API_VERSIONenv var (defaultv3; setv2for legacy deployments)total=trueon v3 paginated queries so Atlas returns item counts when availabletotalis stillnullby fetching pages until a short/empty pageTRUSTIFY_API_VERSIONin READMEBackward compatibility
Set
TRUSTIFY_API_VERSION=v2to keep using legacy v2 endpoints. Pagination behaviour is unchanged when the API returns a numerictotal.Test plan
uv run pytest tests/test_pagination.py -vuv run pytest tests/ -q(79 passed)uv run --group lint mypy src/trust-purl openssl,trust-products pkg:rpm/redhat/openssl