Guide vulnerability setup and show the next scheduled refresh - #227
Merged
Conversation
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.
|
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.



Summary
VulnerabilityConfigurationHintKindand a testableVulnerabilityConfigurationHintResolverthat maps the vulnerability options plus the latest completed vulnerability scan run to a hint kind (None,ScanningDisabled,TrivyBaseUrlMissing,DockerHubCredentialsMissing).DashboardViewDatawithVulnerabilityScanningEnabledandVulnerabilityConfigurationHint, 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.IApplicationViewService.GetVulnerabilityScheduleAsyncreturningVulnerabilityScheduleViewData, and showNext scheduled vulnerability refresh: {time}next to the manual refresh button on the scan-history page, with ashortly (no run recorded yet)fallback.IOptionsMonitor<DockerUpdateGuardOptions>intoApplicationViewServiceso it can read the vulnerability configuration and the refresh interval.VulnerabilityProviderMessagesso 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
StartedAtUtcplusScanning:VulnerabilityRefreshIntervalMinutes. The UI wording matches the issue text so it does not read as a guarantee.ScanRunof typeVulnerabilitywith statusPartialorFailedand matches itsErrorMessageagainst the shared provider constants, additionally requiring the configured provider to match. An unrelated failure (for example a Trivy timeout) resolves toNone.ScanHistory.Schedulekey so the interactive render reuses the prerendered value.ApplicationViewServicegained a fourth constructor parameter, which updates the existing construction sites inApplicationViewServiceTests.Follow-up work
None