Repository navigation
fix(repo-universe): wrong-shape fetch/state JSON becomes per-repo ERRORs (#6652) - #6705
Merged
Merged
Conversation
…ORs (#6652) check_issues only turned failures raised as FetchError into report ERROR lines; valid-JSON wrong-shape inputs (scalar issue items, non-list fixture entries, malformed persisted state) crashed the whole run with TypeError/AttributeError and re-crashed daily. normalize_issue, the fixture fetcher and the gh fetcher now raise FetchError for wrong shapes; run_check reports malformed per-repo state entries per-repo (state untouched) and raises a named load error for top-level state shape failures, which main maps to a single named exit-2 error. Seven regression tests cover the named shapes.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
4 tasks
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.
What
check_issues.pypromised that a failed fetch is "an explicit ERROR line in the report" — but that only held for failures raised asFetchError. Any valid-JSON-but-wrong-shape input (a scalar issue item, a per-repo fixture entry that is an object withouterror, a wrong-shape persistedstate.json) escaped as an unhandledTypeError/AttributeError, killed the whole run, and — for persisted state — re-crashed every daily run until a human repaired the file.Change
normalize_issue: a non-object item now raisesFetchError("issue entry is not a JSON object") — this covers both the fixture path and thegh apipath, since both funnel through it.fetch_issues_fixture: non-object fixture and non-list per-repo entries raiseFetchErrorfor that repo.fetch_issues_gh: a parsed page that is neither an object nor a list raisesFetchError.run_check: non-objectstate/state["repos"]raisesFetchError(a single named load error); a malformed per-repo persisted entry (non-object entry, or anissuesmapping whose values are not objects) is reported as that repo's ERROR line, the repo is skipped, its persisted state is left untouched, and other repos are still checked.main: aFetchErrorout ofrun_check(the state-shape load errors) prints one named error line and exits 2 — no traceback, no report, no state write.Verification (laptop, this branch)
python3 test_check_issues.py: 15 tests OK — the 8 pre-existing (baseline / delta / PR filtering / failed-fetch preservation / CLI round-trip / lifecycle) plus 7 newWrongShapeTestscovering every acceptance shape: fixture entry as an object withouterror, fixture entry[123], fixture as a top-level list, state as a top-level list, statereposas a list, per-repo state entry as an int, and a persisted issue entry as an int (the last two also assert the poison entry is preserved verbatim and the healthy repo still advances).Closes #6652.
Filed by the repo queue worker, lane code-a, in fallback mode (queue backend down 2026-11-06/07; issue #6652 claimed via a fallback claim marker on the issue; triage was completed earlier by lane code-y, which re-queued this issue as the fix vehicle).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.