Skip to content

Scripts: regression tests for build-feed search without status:success - #3272

Open
rafaelfalcao11 wants to merge 2 commits into
xcl-dev:mainfrom
rafaelfalcao11:scripts/build-feed-search-regression-3246
Open

rafaelfalcao11 wants to merge 2 commits into
xcl-dev:mainfrom
rafaelfalcao11:scripts/build-feed-search-regression-3246

Conversation

@rafaelfalcao11

@rafaelfalcao11 rafaelfalcao11 commented Nov 29, 2026 •

Copy link
Copy Markdown

The testing feed's PR search must not use GitHub's status:success qualifier: search counts every check run on the head commit, including superseded ones, so a PR whose PR description check failed once and passed on a rerun stays out of the feed even when its gates are green. fa20459 removed 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 into build_feed_search_query(), with the reason in its docstring. cmd_build_feed calls it. The query is unchanged.
  • scripts/test_triage_pr.py: TestBuildFeedSearch checks that the query has no status:success and keeps the repo, draft and base filters, and that a superseded PR description failure followed by a success yields green gates in extract_gate_statuses.
  • scripts/test_triage_pr.py: TestBuildFeedEndToEnd runs cmd_build_feed against a fake GraphQL client. It checks the search string actually sent, and that a PR whose PR description check 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

  • macOS 26 (Apple Silicon), Python 3.14.4: python3 -m unittest discover -s scripts -p 'test_*.py' ran 38 tests, OK.
  • The end-to-end test fails when I put status:success back in the query (through the helper or inline) and when extract_gate_statuses counts any past failure instead of the latest run.

Not tested

  • The Rust workspace: not built and not tested (macOS). No file under crates/ changes.
  • build-feed was 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.

@github-actions github-actions Bot added area:docs-ci Documentation, scripts, workflows, repo governance area:tests Unit, integration, e2e tests, or testtitle needs-pr-check Failing the PR description check (CONTRIBUTING.md) and removed needs-pr-check Failing the PR description check (CONTRIBUTING.md) labels Nov 29, 2026
@rafaelfalcao11

rafaelfalcao11 commented Nov 29, 2026 •

Copy link
Copy Markdown
Author

The CI failures on this PR are known flaky tests, not this change (it only touches Python files under scripts/):

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)
@rafaelfalcao11
rafaelfalcao11 force-pushed the scripts/build-feed-search-regression-3246 branch from f42443b to a9fadee Compare November 29, 2026 11:35
@rafaelfalcao11

Copy link
Copy Markdown
Author

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 (scripts/), and its only red checks are these tests. Its latest head a9fadee on main d8bd9a3 hit the pipeline-library race again. Could a maintainer review #3221 / #3278, or rerun the CI job on #3272 once they are in? Thanks.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

merge-check
base: 493dbd3
head: a9fadee
merge: clean
build: not run (Tier 0: scripts and their tests only; no Rust file changes)
tests: python -m unittest discover -s scripts -p 'test_*.py' on the merge -> 69 run, 68 passed, 1 error. The error is test_discord_mirror...test_nothing_is_written_when_the_state_cannot_be_saved, which runs a POSIX shell command; it errors the same way on main 493dbd3 on Windows and isn't touched here. test_triage_pr: 13 passed. SKIPPED: none.
review: read the whole diff (+117/-6). The fix itself (dropping status:success from the build-feed search, #3246) is already on main in fa20459. This PR adds the regression tests, and moves the query into build_feed_search_query() (triage_pr.py ~323, called at ~732) with the same string. Findings (nit): the docstring replaces main's comment about why the qualifier is gone (the search index lags new PRs), so that reason is lost; keeping one line of it would help. Fine: putting status:success back into the query makes 2 of the new tests fail, so they catch the regression, and nothing on main tested extract_gate_statuses before. The PR's red Build and test run is the pipeline_library flake that #3221 (2c003dd) fixed after that run.
performance: none: a CI script, not the runtime.
verdict: safe to merge
hardware / tool and model: Windows 11 26300, Python 3.14 (no GPU needed) / Claude Code with Claude Opus 5.5

AI-written and posted by Foniass without a human check of each point.

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head a9fadee

The fix itself (dropping status:success from the build-feed search) is already on main in fa20459, and #3246 is closed. This PR moves the query into build_feed_search_query() without changing it and adds regression tests, including one that runs cmd_build_feed end to end against a fake GraphQL client. No other open PR touches scripts/triage_pr.py for this.
Minor: the PR replaces main's comment about why status:success is avoided (the search index lags) with a different reason in the docstring. Both reasons are worth keeping.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

@bmjask bmjask left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread scripts/test_triage_pr.py


class TestBuildFeedSearch(unittest.TestCase):
def test_query_does_not_use_status_success(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Labels

area:docs-ci Documentation, scripts, workflows, repo governance area:tests Unit, integration, e2e tests, or testtitle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scripts: the testing feed skips PRs whose checks failed before and pass now

3 participants