Repository navigation
fix(fleet-paperwork): create readback compares body, state and labels (#6901) - #7799
Conversation
…#6901) cmd_create's readback verified only title and number, so a create whose body was dropped or mangled, or whose labels were not applied, reported 'created+verified'. The README already promised the comparison covers (title, body, state); this makes the code match it and adds the labels that were sent. Tests cover the four failure modes (dropped body, mangled body, closed state, missing labels) plus the passing and extra-label cases; the four failure-mode tests fail against the previous implementation.
|
Caution Review failedThe pull request is closed.
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. |
Codex Review Summary: ❌ FailedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91142b0b7f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
What changed in this PR
Aligns fleet-paperwork create’s post-create readback verification with the documented contract by validating more than just issue title/number, preventing false “created+verified” results when body/state/labels are incorrect.
Changes:
- Extend create readback verification to compare issue body, state, and requested labels.
- Update README to document label verification on create.
- Add unit tests to cover pass/fail scenarios for body/state/labels readback validation.
| File | Description |
|---|---|
| infra/fleet-paperwork/fleet_paperwork.py | Strengthens create readback verification to include body/state/labels mismatches. |
| infra/fleet-paperwork/README.md | Documents label comparison as part of create verification. |
| infra/fleet-paperwork/tests/test_fleet_paperwork.py | Adds tests ensuring readback validation fails on dropped/mangled body, wrong state, or missing labels. |
Review effort: Lite
| if got.get("body") != body: | ||
| die( | ||
| f"readback mismatch for {args.repo}#{number}: body sent " | ||
| f"{len(body)} chars, read back {len(got.get('body') or '')} chars " | ||
| f"(body={_shape_name(got.get('body'))})" | ||
| ) |
There was a problem hiding this comment.
Fixed in e48c43c (task 11300, lane code-m shepherd): shape-safe readback diagnostics — lengths computed only for strings (n/a otherwise), labels matched as a set of string names with malformed entries dying as a readback mismatch, fake_http stub aligned with fp.http() (body/expect). New tests: test_non_string_body_readback_fails_cleanly, test_malformed_label_entry_fails_cleanly. Full suite: 38 tests OK on the laptop.
| have = sorted( | ||
| lbl.get("name") if isinstance(lbl, dict) else lbl | ||
| for lbl in (got.get("labels") or []) | ||
| ) | ||
| missing = [name for name in want if name not in have] |
There was a problem hiding this comment.
Fixed in e48c43c (task 11300, lane code-m shepherd): shape-safe readback diagnostics — lengths computed only for strings (n/a otherwise), labels matched as a set of string names with malformed entries dying as a readback mismatch, fake_http stub aligned with fp.http() (body/expect). New tests: test_non_string_body_readback_fails_cleanly, test_malformed_label_entry_fails_cleanly. Full suite: 38 tests OK on the laptop.
| def fake_http(method, path, token, payload=None): | ||
| paths.append((method, path)) | ||
| if method == "POST": | ||
| return 200, created | ||
| return 200, readback |
There was a problem hiding this comment.
Fixed in e48c43c (task 11300, lane code-m shepherd): shape-safe readback diagnostics — lengths computed only for strings (n/a otherwise), labels matched as a set of string names with malformed entries dying as a readback mismatch, fake_http stub aligned with fp.http() (body/expect). New tests: test_non_string_body_readback_fails_cleanly, test_malformed_label_entry_fails_cleanly. Full suite: 38 tests OK on the laptop.
… review) Body/label readback comparisons no longer raise TypeError on non-string bodies or malformed label entries: lengths are computed defensively, labels are matched as a set of string names, and malformed entries die with a readback mismatch. fake_http stub aligned with fp.http() signature (body/expect). Adds tests for non-string body readback and malformed label entries.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |


Summary
fleet-paperwork create's readback verified only the created issue's title and number. The README promises the comparison covers(title, body, state), so a create whose body was dropped or mangled — or whose labels were never applied — reportedcreated+verifiedand every downstream consumer treated it as complete.This makes the code match the documented contract, and adds the labels that were sent.
Changes
infra/fleet-paperwork/fleet_paperwork.py—cmd_create's readback now also compares:open(a freshly created issue),--labelmust appear in the readback; extra labels GitHub added are tolerated.infra/fleet-paperwork/README.md— the verification bullet now names the label comparison.infra/fleet-paperwork/tests/test_fleet_paperwork.py— newTestCreateReadbackcovering the failure modes and the passing cases.Verification
Oracle check: with the previous
fleet_paperwork.pyrestored, the four failure-mode tests fail —— and all 36 pass with the fix, so the tests detect the regression rather than merely passing.
Acceptance criteria
Closes #6901
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.