Skip to content

fix: catch-all skip for per-repo errors and cleaner report format#30

Merged
packet-mover merged 1 commit intomainfrom
fix/catch-all-skip
Apr 12, 2026
Merged

fix: catch-all skip for per-repo errors and cleaner report format#30
packet-mover merged 1 commit intomainfrom
fix/catch-all-skip

Conversation

@packet-mover
Copy link
Copy Markdown
Contributor

Summary

  • Non-rate-limit per-repo errors (GetTree, GetRulesets, GetBranchProtection) now skip the repo instead of aborting the entire scan. Rate limit errors still abort.
  • Replaced Skipped bool / SkipReason / SkipError fields on RepoResult with KnownSkipReason and UnknownSkipError (mutually exclusive) plus a Skipped() method
  • Known skip reasons (empty repo, truncated tree) render as plain bullet points
  • Unknown errors render as bullet points with the error message inline
  • Mock client gained ProtectionErrs and RulesetsErrs maps for per-repo error injection

Follow-up to #28. One flaky repo no longer kills the entire scan.

Test plan

  • go test ./... - all 79 tests pass
  • Live run against CodatusHQ org - 2 repos scanned, 1 skipped, report posted
  • New tests: skip unexpected GetTree/Rulesets/BranchProtection errors, abort on rate limit during each phase, report rendering for known vs unknown skips

- Any non-rate-limit per-repo error now skips the repo instead of
  aborting the entire scan (GetTree, GetRulesets, GetBranchProtection)
- Replace Skipped/SkipReason/SkipError fields with KnownSkipReason
  and UnknownSkipError (mutually exclusive) plus Skipped() method
- Known skip reasons render as plain bullet points in the report
- Unknown errors render as bullet points with inline error message
- Add per-repo error maps to mock client (ProtectionErrs, RulesetsErrs)
@packet-mover packet-mover merged commit 0cbde30 into main Apr 12, 2026
2 checks passed
@packet-mover packet-mover deleted the fix/catch-all-skip branch April 12, 2026 09:48
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.

1 participant