Skip to content

feat: fetch and propagate latest scanner image dynamically via context#720

Open
refoo0 wants to merge 2 commits into
mainfrom
feat/dynamic-scanner-image
Open

feat: fetch and propagate latest scanner image dynamically via context#720
refoo0 wants to merge 2 commits into
mainfrom
feat/dynamic-scanner-image

Conversation

@refoo0
Copy link
Copy Markdown
Member

@refoo0 refoo0 commented May 12, 2026

No description provided.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: rafi <refaei.shikho@hotmail.com>
@refoo0 refoo0 marked this pull request as ready for review May 13, 2026 08:47
Copilot AI review requested due to automatic review settings May 13, 2026 08:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 queries https://devguard.org/api/latest with Next.js revalidation.
  • Introduced ScannerImageContext and 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.

Comment thread src/data-fetcher/fetchLatestScannerImage.ts Outdated
Comment thread src/data-fetcher/fetchLatestScannerImage.ts
Comment thread src/context/ScannerImageContext.tsx Outdated
Comment thread src/data-fetcher/fetchLatestScannerImage.ts
Signed-off-by: rafi <refaei.shikho@hotmail.com>
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.

3 participants