feat: fetch and propagate latest scanner image dynamically via context#720
Open
refoo0 wants to merge 2 commits into
Open
feat: fetch and propagate latest scanner image dynamically via context#720refoo0 wants to merge 2 commits into
refoo0 wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: rafi <refaei.shikho@hotmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a server-fetched “latest scanner image” value and makes it available throughout the (loading-group) route tree so UI flows (notably the Risk Scanner/CLI guide) can display a dynamic scanner image reference instead of a hardcoded one.
Changes:
- Added a server-side fetcher (
fetchLatestScannerImage) that querieshttps://devguard.org/api/latestwith Next.js revalidation. - Introduced
ScannerImageContextand wrapped the(loading-group)layout with a provider populated from the server fetch. - Threaded the resolved scanner image into the Risk Scanner dialog and the DevGuard CLI slide to update the displayed
docker pull ...command.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/data-fetcher/fetchLatestScannerImage.ts | Adds server fetch helper to resolve the latest scanner image (with fallback). |
| src/context/ScannerImageContext.tsx | Introduces a client context/provider + hook for scanner image propagation. |
| src/components/RiskScannerDialog.tsx | Adds a prop to pass the resolved scanner image down to the CLI slide. |
| src/components/guides/risk-scanner-carousel-slides/DevGuardCliSlide.tsx | Uses the passed scanner image to build the docker pull snippet dynamically. |
| src/app/(loading-group)/layout.tsx | Fetches latest image server-side and provides it via context to the route subtree. |
| src/app/(loading-group)/[organizationSlug]/projects/[projectSlug]/assets/[assetSlug]/page.tsx | Reads the context value and passes it into RiskScannerDialog. |
| src/app/(loading-group)/[organizationSlug]/projects/[projectSlug]/assets/[assetSlug]/refs/[assetVersionSlug]/dependency-risks/page.tsx | Reads the context value and passes it into the scanner dialog. |
| src/app/(loading-group)/[organizationSlug]/projects/[projectSlug]/assets/[assetSlug]/refs/[assetVersionSlug]/code-risks/page.tsx | Reads the context value and passes it into the scanner dialog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: rafi <refaei.shikho@hotmail.com>
timbastin
approved these changes
May 13, 2026
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.
No description provided.