Skip to content

fix(repo-universe): name wrong-shape enumeration entries instead of crashing (#6716) - #6723

Merged
dezren39 merged 1 commit into
mainfrom
queue/fallback-6716-wrong-shape-entries
Nov 7, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/fallback-6716-wrong-shape-entries

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #6716.

Filed and claimed in FALLBACK MODE (queue backend down — PostgREST 503 PGRST002; markers on #6716 per doc/fleet/queue-fallback-mode.md, posted via gh because the installed fleet 0.1.0 binary has no fallback verb).

Problem

generate.py decoded enumeration captures without any shape guard: decode_pages flattened entries blindly and merge_repos/build indexed repo["full_name"], so one wrong-shape entry (string/null in a page array, a saved API error object, a repo object missing full_name) aborted the whole regeneration with a bare TypeError/KeyError and no indication of which capture or entry was at fault. The sibling checker got this guard in #6652; the generator was left out.

Change

  • generate.py: new validate_entry() — an entry must be a JSON object with a string full_name, else ValueError naming the capture source and the entry index/repr (house style, cf. check_issues normalize_issue).
  • decode_pages validates every entry as it lands and takes a source name; load_enumeration passes the capture path, fetch_live the endpoint.
  • merge_repos and build validate defensively, so direct callers that bypass decode_pages get the same named error (build re-indexes full_name itself).
  • CLI entrypoint converts ValueError to a clean error: ... exit, no traceback.
  • test_generate.py: new cases — non-dict entry in a page array, dict page without full_name, null entry (all via the real CLI: non-zero exit, capture named, no traceback, no artifact written), plus direct-consumer validation for merge_repos/build/decode_pages.

Verification (laptop)

  • python3 -m unittest test_generate test_check_issues → 30 tests OK (idempotence test confirms well-formed captures regenerate byte-identically).
  • Manual CLI repro with a string entry: rc 1, error: enumeration capture .../org.json: enumeration entry 1 is not a JSON object: 'oops', no output written.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 03:16
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7b3f8789-4510-4320-99c7-06a2d555d4ec
Commits

Reviewing files that changed from the base of the PR and between ff160b9 and 835048e.

Files selected for processing: 2

  • scripts/fleet/repo-universe/generate.py
  • scripts/fleet/repo-universe/test_generate.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T03:17:40.155099Z 835048e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant