Conversation
The "high impact" metric in StatsBar was computed from baseFiltered, which excludes the status filter. This meant the count stayed static when users filtered by Compliant/Warning/NonCompliant status. Extract countHighImpact() and filterServices() into format.ts as shared helpers, compute highBlastCount from the fully filtered set (including status), and consolidate duplicate filtering logic in ServiceListView. Add 17 tests covering countHighImpact and filterServices behavior, including the specific scenario where status filtering should reduce the high-impact count.
…, add pull_failed reason classifyOCIError() incorrectly returned "not_found" for all unrecognised errors, including RegistryUnreachableError (network/DNS failures). This masked transient failures as missing artifacts. Now properly classifies registry unreachable errors as "pull_failed" — a reason code already documented in graph.go and source_oci.go but never wired up. Additional cleanup: - Extract collectOCIRepos() from depReposForService() to eliminate triple duplication of the extract+strip pattern - Unexport version_tracking.go functions (NormalizeResolutionPolicy, ClassifyVersionPolicy, ComputeLatestAvailable, IsUpdateAvailable, MarkCurrentVersion) — all only used within the dashboard package - Add pull_failed reason to frontend (label, tooltip, badge, actionable) - Update tests for new error classification and reason handling
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
baseFilteredwhich intentionally excluded the status filter for pill counts, but the high-impact number should reflect the currently visible set.countHighImpact()andfilterServices()extracted intoformat.tsas tested, reusable functions. This consolidates duplicate filtering logic betweenStatsBar.svelteandServiceListView.svelte.countHighImpact(threshold, edge cases) andfilterServices(name, source, status, combined filters, and the specific high-impact-with-status-filter scenario).What changed
StatsBar.sveltefullyFiltered(applies status filter on top ofbaseFiltered), usecountHighImpact()format.tscountHighImpact()andfilterServices()shared helpersformat.test.tsServiceListView.sveltefilterServices()instead of inline duplicate filtering logicui/Codebase audit findings
What was reviewed
pkg/,internal/)pkg/dashboard/frontend/src/)docs/,README.md)pkg/validation/crossfield.go)What was found and addressed
filterServices()HIGH_IMPACT_THRESHOLDconstantWhat was found but intentionally NOT changed
crossfield.go: The fourvalidateXxxNamesUniquefunctions and thevalidateHealthInterface/validateMetricsInterfacepair follow identical patterns. A generic helper could save ~60 lines, but the current explicit approach is more readable and debuggable. Each validator has distinct error codes and field paths, making the duplication intentional and low-risk. Not worth the abstraction cost.pkg/dashboard/server.go): TheServerstruct has grown to 16 fields with multiple concerns (routing, aggregation, enrichment, caching). This is acknowledged complexity given the dashboard's scope. Would benefit from extraction into aSourceManagerif it grows further, but no action needed now.docs/architecture.mdcould be expanded to better reflect the actual scope (20+ source files, 27 types), but the current documentation is accurate — just concise.Test plan
go vet: clean