LWLP-5: Lightwell Network API - #1666
Conversation
This reverts commit a71bf04.
dominikvagner
left a comment
There was a problem hiding this comment.
could you rebase this please? (it has a duplicate commit for 2187002 which is in main)
also if possible, could the commits be cleaned up a bit for easier reviewing 🧹
not sure if the work should be split into more commits, or squashed together, don't know your workflow 😅
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.
…ien/content-sources-backend into LWLP-5-Lightwell-Network-API
yeah just did, sorry, the rebasing was a bit of a mess at first |
|
/ok-to-test |
1 similar comment
|
/ok-to-test |
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.
rverdile
left a comment
There was a problem hiding this comment.
A couple small comments. Also this unfortunately needs another rebase. I'm not sure how much of this I can test locally, but I'll test next as well
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.
|
fixes implemented |
…handle cased text
…twork-API # Conflicts: # db/migrations.latest
|
merged in main and Beacon SPUR changes |
The severity_order migration had timestamp 20260828, which predates upstream's 20260902 migration. CI requires migrations.latest to match the PR-added migration timestamp.
rverdile
left a comment
There was a problem hiding this comment.
Overall there is a lot working, two more functional comments!
I can help you set up to test locally if you want help verifying, or I can test it again on my end
…ith severity_score
rverdile
left a comment
There was a problem hiding this comment.
Thanks for the changes, looks good!
Summary
Implements the Phase 1 v2 API spec for Lightwell endpoints: flat cross-repo and nested repo-scoped aliases for packages, package_versions, and advisories. Adds CVE-based version filtering (resolves/vulnerable), sqlc-generated advisory store, severity-ordered advisory listing, and a CI job to detect sqlc drift.
Testing Steps
go test ./pkg/handler/ -run "LightwellAdvisory|LightwellPackages" -vExpect 20 PASS (6 advisory, 14 packages).
go test ./pkg/lightwell/db/store/ -v -count=1Expect PASS for advisory queries (ListAdvisories, filter by package/severity/repo, CountByRepo, ByCveID, ByPackage) and vulnerability queries.
Verify response envelopes contain
data,meta, andlinksfields.