Skip to content

Guide vulnerability setup and show the next scheduled refresh - #227

Merged
LarsLaskowski merged 1 commit into
mainfrom
claude/issue-168-v2bfle
Jul 29, 2026
Merged

Guide vulnerability setup and show the next scheduled refresh#227
LarsLaskowski merged 1 commit into
mainfrom
claude/issue-168-v2bfle

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add VulnerabilityConfigurationHintKind and a testable VulnerabilityConfigurationHintResolver that maps the vulnerability options plus the latest completed vulnerability scan run to a hint kind (None, ScanningDisabled, TrivyBaseUrlMissing, DockerHubCredentialsMissing).
  • Extend DashboardViewData with VulnerabilityScanningEnabled and VulnerabilityConfigurationHint, and render the matching banners under the dashboard metric cards: an info alert for disabled scanning and a warning alert naming the concrete missing setting for a misconfigured provider.
  • Add IApplicationViewService.GetVulnerabilityScheduleAsync returning VulnerabilityScheduleViewData, and show Next scheduled vulnerability refresh: {time} next to the manual refresh button on the scan-history page, with a shortly (no run recorded yet) fallback.
  • Inject IOptionsMonitor<DockerUpdateGuardOptions> into ApplicationViewService so it can read the vulnerability configuration and the refresh interval.
  • Move the providers' not-configured messages into shared constants in VulnerabilityProviderMessages so the detection heuristic and the reported messages stay in sync.

Why

When vulnerability scanning is disabled or the selected provider reports NotConfigured, the UI only showed quiet "Not scanned" / "Not configured" chips. Users who wanted scanning had no hint about what to configure, and users with scanning enabled could not see when the next automatic run was due.

Linked issues

Closes #168

Review notes

  • The next scheduled refresh is an estimate: the background scheduler does not persist its timer, so the value is computed as the latest vulnerability run's StartedAtUtc plus Scanning:VulnerabilityRefreshIntervalMinutes. The UI wording matches the issue text so it does not read as a guarantee.
  • The misconfiguration heuristic looks at the most recent completed ScanRun of type Vulnerability with status Partial or Failed and matches its ErrorMessage against the shared provider constants, additionally requiring the configured provider to match. An unrelated failure (for example a Trivy timeout) resolves to None.
  • Banner texts live in the razor markup; the view service only supplies the hint kind.
  • The scan-history page persists the schedule under a separate ScanHistory.Schedule key so the interactive render reuses the prerendered value.
  • ApplicationViewService gained a fourth constructor parameter, which updates the existing construction sites in ApplicationViewServiceTests.

Follow-up work

None

The dashboard now shows an info banner when vulnerability scanning is
disabled and a warning banner naming the missing setting when the latest
completed vulnerability run reported a not-configured provider. The
scan-history header shows the estimated next scheduled refresh derived
from the latest run and the configured interval, falling back to a
no-run-yet variant. ApplicationViewService reads the application options
to supply the hint kind and schedule, and both providers now report their
not-configured messages from shared constants so the heuristic cannot
drift. Closes #168.
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski merged commit 5c09196 into main Jul 29, 2026
4 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/issue-168-v2bfle branch July 29, 2026 05:16
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.

Guide users when vulnerability scanning is disabled or misconfigured, and show the next scheduled run

2 participants