Repository navigation
Scripts: regression tests for build-feed search without status:success - #3272
rafaelfalcao11 wants to merge 2 commits into
Conversation
|
The
Could a maintainer rerun the job? I will not push again just to retrigger it; I will rebase once #3221 or #3278 lands. |
The testing feed must scan open PRs without GitHub's status:success qualifier, which keeps PRs whose head commit had an earlier failed required check out of search even after a later run passes (xcl-dev#3246). Extract build_feed_search_query and test that superseded PR description failures do not block gate detection. Fixes xcl-dev#3246. Assisted-by: Cursor (Composer)
Runs cmd_build_feed with a fake GraphQL client. Checks that the search string sent is build_feed_search_query() without status:success, and that a PR whose PR description check failed and then passed stays in the feed, while a PR with a failing latest check or a pending CI run stays out. Refs xcl-dev#3246. Assisted-by: Cursor (model unknown)
f42443b to
a9fadee
Compare
|
Hi, this is a request for a CI rerun or a review on two flaky-test fixes that are blocking unrelated PRs.
#3272 is a Python-only change ( |
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
The fix itself (dropping AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
bmjask
left a comment
There was a problem hiding this comment.
Review of a9fadee3: 4 finding(s). 1 are inline. These are on lines outside the diff:
scripts/triage_pr.py:555: contexts(first: 15) can cut off the newest run. This PR's premise is that superseded check runs stay on the head commit, so after enough description reruns, plus CI and the other checks, the latest successful PR description run falls past the first 15. Only the old FAILURE comes back, and the green PR is dropped from the feed again, which is #3246 by another route.
scripts/triage_pr.py:736: Without status:success the search returns every open PR, but paging still stops at max_pages (20) x 50 = 1000 results sorted by updated-desc, with no warning. Once there are more than 1000 open PRs, green ones that haven't been updated recently are dropped from queue.json silently.
scripts/triage_pr.py:343: This is older code: a queued rerun (no started_at/completed_at) gets the timestamp "", so it never counts as latest, and an earlier completed SUCCESS is reported while the required check is actually pending.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
|
|
||
|
|
||
| class TestBuildFeedSearch(unittest.TestCase): | ||
| def test_query_does_not_use_status_success(self): |
There was a problem hiding this comment.
Nothing runs these tests in CI: ci.yml runs scripts/test.ps1 (cargo only), and pr-check.yml runs only pr_check.py. If status:success is added back later, everything stays green. A step such as python3 -m unittest discover -s scripts -p 'test_*.py' is needed for this to act as a regression guard.
The testing feed's PR search must not use GitHub's
status:successqualifier: search counts every check run on the head commit, including superseded ones, so a PR whosePR descriptioncheck failed once and passed on a rerun stays out of the feed even when its gates are green.fa20459removed the qualifier; this adds regression tests so it does not come back, and closes the issue.Fixes #3246
What is in it
scripts/triage_pr.py: the search string moves intobuild_feed_search_query(), with the reason in its docstring.cmd_build_feedcalls it. The query is unchanged.scripts/test_triage_pr.py:TestBuildFeedSearchchecks that the query has nostatus:successand keeps the repo, draft and base filters, and that a supersededPR descriptionfailure followed by a success yields green gates inextract_gate_statuses.scripts/test_triage_pr.py:TestBuildFeedEndToEndrunscmd_build_feedagainst a fake GraphQL client. It checks the search string actually sent, and that a PR whosePR descriptioncheck failed and then passed stays in the feed, while a PR whose latest check failed and a PR with CI still running stay out.Tested
python3 -m unittest discover -s scripts -p 'test_*.py'ran 38 tests, OK.status:successback in the query (through the helper or inline) and whenextract_gate_statusescounts any past failure instead of the latest run.Not tested
crates/changes.build-feedwas not run against the live GitHub API. The end-to-end test uses a fake client.AI use
Cursor. The original change was written in Cursor with Composer; this session ran in Cursor's Auto mode, which does not expose the underlying model, so the exact model is unknown. It wrote the extraction and tests and ran the tests; I reviewed the diff.