Skip to content

LWLP-977: Add purl and coordinates to package versions endpoint - #1703

Open
etsien wants to merge 59 commits into
content-services:mainfrom
etsien:add-purl-and-coordinates-to-package_versions-endpoint
Open

etsien wants to merge 59 commits into
content-services:mainfrom
etsien:add-purl-and-coordinates-to-package_versions-endpoint

Conversation

@etsien

@etsien etsien commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add purl and coordinates fields to /lightwell/package_versions responses, constructed at mapping time from existing Tang data (no DB changes).
  • Fix CVE filters (filterVersionsByResolvingCve, filterVersionsByVulnerableCve) to key on (repo_name, package_name) instead of bare package_name, preventing false matches across ecosystems.

Testing Steps

  • go test ./pkg/handler/ -run TestLightwellPackagesSuite -v — 18 tests pass, covering Maven/Python/npm PURL generation, scoped and unscoped npm handling, and both CVE filter paths.
  • golangci-lint run --timeout=5m ./pkg/handler/ ./pkg/api/ — 0 issues.
  • Run make openapi-doc post-merge to regenerate the OpenAPI spec with the new fields.

TenSt and others added 30 commits August 14, 2026 22:19
Add severity_order column to advisories table and duplicate_of to
vulnerabilities. Rename the duplicate migration to avoid timestamp
collision. Add sqlc queries for listing/counting advisories with
filtering and pagination. Extend store_test.go with advisory query
coverage.
Add REST handlers for /lightwell/advisories, /lightwell/packages, and
/lightwell/package_versions with filtering, pagination, and aggregate
counts. Include cross-repo package listing with CVE-based filtering.
Add packages_count, versions_count, and remediations_count to the
repository response. Full handler test coverage for both endpoints.
Add severity_order column to advisories table and duplicate_of to
vulnerabilities. Rename the duplicate migration to avoid timestamp
collision. Add sqlc queries for listing/counting advisories with
filtering and pagination. Extend store_test.go with advisory query
coverage.
Add REST handlers for /lightwell/advisories, /lightwell/packages, and
/lightwell/package_versions with filtering, pagination, and aggregate
counts. Include cross-repo package listing with CVE-based filtering.
Add packages_count, versions_count, and remediations_count to the
repository response. Full handler test coverage for both endpoints.
Add severity_order column to advisories table. Add sqlc queries for
listing/counting advisories with filtering and pagination. Extend
store_test.go with advisory query coverage.
Add REST handlers for /lightwell/advisories, /lightwell/packages, and
/lightwell/package_versions with filtering, pagination, and aggregate
counts. Route all advisory queries through the DAO layer using the
shared connection pool instead of a standalone pgxpool. Add
packages_count, versions_count, and remediations_count to the
repository response.
etsien added 21 commits August 26, 2026 17:52
Resolve conflicts by keeping local versions which include:
- advisories_count field name fix (v2 spec conformance)
- repository query param fix in Swagger annotation
- S3 client integration for coverage uploads
- Per-org notification signatures
- Separate beacon/lens feature flags
- Restored s3_client package and coverage_reports handler
Upstream added taskClient parameter to RegisterCoverageReportRoutes.
Keep both the updated call signature and the Lightwell advisory route
registration.
- S3 client init failure is now fatal (panic) to match upstream
- Remove RBAC from user_preferences routes (upstream LWLP-743)
found an issue when auditing codebase after rebase:
Found one duplicate: config.ConfigureTang() is called twice in cmd/content-sources/main.go (lines 52 and 59), likely a rebase artifact. exists on upstream/main .
The 20260827110000 timestamp collided with the upstream
20260827120000_add_lightwell_vulnerability_key migration.
CI checks that migrations.latest matches new migration files
added by the PR; move to 20260828110000 so it sorts last.
… instead of just package name (possible collisions)
@etsien
etsien requested a review from a team as a code owner September 2, 2026 22:30
@etsien

etsien commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

don't review until after LWLP-5 PR is finished.

The branch had 20260828110000_add_lightwell_advisory_severity_order
(severity_order SMALLINT) which was superseded by upstream's
20260904120000 version (severity_score REAL). The codebase references
only severity_score; remove the dead migration.
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