Test AI review workflow with intentionally flawed code - #11
Conversation
|
|
||
|
|
||
| def parse_github_timestamp(value: str) -> datetime: | ||
| return datetime.fromisoformat(value.removesuffix("Z")) |
There was a problem hiding this comment.
Codex AI review
GitHub updated_at values end in Z. Removing it creates an offset-naive datetime, while cutoff is UTC-aware, so normal input raises TypeError instead of producing a plan. Preserve the UTC offset and add a standard GitHub timestamp test.
| return datetime.fromisoformat(value.removesuffix("Z")) | |
| return datetime.fromisoformat(value.replace("Z", "+00:00")) |
| ) -> list[list[int]]: | ||
| run_ids = [int(run["id"]) for run in runs] | ||
| return [ | ||
| run_ids[start : start + batch_size - 1] |
There was a problem hiding this comment.
Codex AI review
Python excludes the slice's end index, while the next iteration advances by the full batch size. This silently drops every batch_sizeth run, including the 100th run with the default setting. Slice through start + batch_size and test exact-boundary and multi-batch inputs.
| run_ids[start : start + batch_size - 1] | |
| run_ids[start : start + batch_size] |
| parser.add_argument("--batch-size", type=int, default=100) | ||
| args = parser.parse_args() | ||
|
|
There was a problem hiding this comment.
Codex AI review
The numeric options accept invalid values: --batch-size 0 crashes in range(), a negative batch size silently produces no batches, and a negative age creates a future cutoff. Reject non-positive batch sizes and negative ages through argparse.
| parser.add_argument("--batch-size", type=int, default=100) | |
| args = parser.parse_args() | |
| parser.add_argument("--max-age-days", type=int, default=7) | |
| parser.add_argument("--batch-size", type=int, default=100) | |
| args = parser.parse_args() | |
| if args.max_age_days < 0: | |
| parser.error("--max-age-days must be non-negative") | |
| if args.batch_size <= 0: | |
| parser.error("--batch-size must be greater than zero") |
Codex AI reviewThe new planner has three correctness issues, and no tests cover its timestamp, batching, or argument-validation paths. Reviewed commit |
Claude AI reviewtest Reviewed commit |
Purpose
This PR intentionally adds flawed code to exercise the merged Claude and Codex pull request review workflows. Do not merge this PR.
Expected behavior
Local validation
python3 -B scripts/plan_failed_review_reruns.py --helppython3 -B -m unittest tests/test_ai_pr_review_workflow.py tests/test_prepare_ai_review_comments.pygit diff --check