-
Notifications
You must be signed in to change notification settings - Fork 116
WIP: Snap CVEs POC #5139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WIP: Snap CVEs POC #5139
Conversation
…input for revisions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
A proof-of-concept UI prototype to display snap vulnerability (CVE) data for publishers, including backend routes, API handlers, styles, and a new React page.
- Added CVE-specific URL rules and a new
get_binaries
API endpoint - Created SCSS mixin and icon assets for CVE priority indicators
- Implemented a
SnapCves
React component, navigation tab, and dev tooling
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
webapp/publisher/snaps/views.py | Added /\<snap_name>/cves UI route and remapped API route to get_binaries |
webapp/publisher/cve/cve_views.py | Introduced get_binaries view to flatten and return binary-focused CVE data |
static/sass/styles.scss | Imported and applied the snapcraft-cves mixin |
static/sass/_snapcraft_cves.scss | Defined classes and icon backgrounds for CVE priority levels |
static/js/publisher/publisher.tsx | Registered SnapCves route and included React Query Devtools |
static/js/publisher/pages/SnapCves | Added SnapCves component and re-export index file |
static/js/publisher/hooks/useCves.ts | Added a placeholder hook with hard-coded fetch path |
static/js/publisher/components/SectionNav/SectionNav.tsx | Extended navigation to include a Vulnerabilities tab for canonical publishers |
view_func=listing_views.get_listing_snap, | ||
methods=["GET"], | ||
) | ||
publisher_snaps.add_url_rule( |
Copilot
AI
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI route "/<snap_name>/cves" is wired to listing_views.get_listing_snap
, which likely returns the wrong template. Add or point to a dedicated view for the CVE page.
Copilot uses AI. Check for mistakes.
view_func=listing_views.get_listing_snap, | ||
methods=["GET"], | ||
) | ||
publisher_snaps.add_url_rule( |
Copilot
AI
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No backend route is defined for /api/<snap_name>/cves
to fetch revision data, but the frontend queries it. Implement or register an endpoint to provide the initial revisions list.
Copilot uses AI. Check for mistakes.
}); | ||
}; | ||
|
||
console.table(data); |
Copilot
AI
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove the console.table
debug statement before merging to keep the production console clean.
console.table(data); |
Copilot uses AI. Check for mistakes.
function useCves() { | ||
return useQuery({ | ||
queryKey: ["cves"], | ||
queryFn: async () => { | ||
const response = await fetch(`/api/docker/3213/cves`); |
Copilot
AI
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fetch path is hard-coded to /api/docker/3213/cves
; parameterize or remove this placeholder to avoid confusion and support multiple snaps.
function useCves() { | |
return useQuery({ | |
queryKey: ["cves"], | |
queryFn: async () => { | |
const response = await fetch(`/api/docker/3213/cves`); | |
function useCves(snapId: string) { | |
return useQuery({ | |
queryKey: ["cves", snapId], | |
queryFn: async () => { | |
const response = await fetch(`/api/docker/${snapId}/cves`); |
Copilot uses AI. Check for mistakes.
.p-icon--dark-tick { | ||
@extend %icon; | ||
} | ||
|
Copilot
AI
Jun 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The .p-icon--dark-tick
class is extended but no background-image
is defined. Either add the asset path or remove the unused selector.
.p-icon--dark-tick { | |
@extend %icon; | |
} |
Copilot uses AI. Check for mistakes.
Done
WIP: Proof of concept UI prototype of publishers view on snap vulnerabilities.
How to QA
Testing
Issue / Card
Fixes #
Screenshots