fix(doctor): improve UX for version resolution errors and diagnostics#514
Draft
sonupreetam wants to merge 1 commit into
Draft
fix(doctor): improve UX for version resolution errors and diagnostics#514sonupreetam wants to merge 1 commit into
sonupreetam wants to merge 1 commit into
Conversation
Address all 5 sub-issues from complytime#503: 1. Pinned versions no longer trigger misleading staleness warnings. Doctor now reports "(pinned)" when cached matches pin, with optional note about latest availability. 2. "registry unreachable" is no longer reported when the real problem is a missing tag. A new ErrVersionNotFound sentinel in internal/registry classifies 404 responses, enabling doctor and sync to emit "latest tag not found — pin a specific version" or "version not found in registry" as appropriate. 3. Error message nesting is flattened: SyncPolicy no longer wraps with redundant "registry unreachable" + "(cached data may still be available)" boilerplate. syncSinglePolicy passes the sync error through directly instead of re-wrapping with the policy name and cached policy list. 4. Configured-vs-cached version mismatch is now detected: if a user pins @v2.0.0 but cache holds v1.0.0, doctor reports the mismatch with guidance to run complyctl get. 5. Nil panic in CheckCollector is fixed: a cfg == nil guard prevents the SIGSEGV when complytime.yaml is absent. Closes complytime#503 Signed-off-by: Sonu Preetam <sonupreetam@gmail.com> Signed-off-by: sonupreetam <spreetam@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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
Addresses all 5 sub-issues from #503:
ErrVersionNotFoundsentinel ininternal/registryto classify 404 responses. Doctor now says "latest tag not found — pin a specific version with @" instead of "unreachable".SyncPolicyclassifies errors;syncSinglePolicypasses errors through directly without re-wrapping.@v2.0.0) differs from cached version (v1.0.0) and suggests runningcomplyctl get.cfg == nilguard to prevent SIGSEGV whencomplytime.yamlis absent.Closes #503
Test plan
make test-unit)make lint)Made with Cursor