Skip to content

ci: advisory hint for stale expected-failure markers (EAI-7478) - #134

Merged
fredespi merged 3 commits into
mainfrom
fix-xfail-cleanup-gap
Jul 22, 2026
Merged

ci: advisory hint for stale expected-failure markers (EAI-7478)#134
fredespi merged 3 commits into
mainfrom
fix-xfail-cleanup-gap

Conversation

@fredespi

Copy link
Copy Markdown
Collaborator

Summary

A bug fix whose CI lane doesn't exercise the platform an xfail row is keyed to merges green, leaving the stale expectations.toml row to surface later as a mis-attributed XPASS on an unrelated PR (e.g. #94's vllm xfails resurfaced on #127's GPU lane). This closes that gap at authoring time with a lightweight advisory nudge — no change to the reconciler or the heavy filter.

Changes

  • scripts/xfail_expectations_hint.py — parses tests/e2e-cucumber/expectations.toml, collects the ticket ids a PR references (title, body, commit messages) in both the project tracker shape (ABC-123) and GitHub #issue shape, and warns via the step summary if any referenced ticket still has a live xfail row. Advisory only: always exits 0. Behavior is pinned by an embedded --self-test (the single source of truth for the rules).
  • .github/workflows/ci.yml — wires it as a non-blocking, non-required pull_request job on ubuntu-latest, reusing the already-pinned checkout action. PR title/body are passed via env: (never interpolated into the shell).
  • .github/pull_request_template.md — one ticket-neutral checkbox reminding authors to clear stale xfail rows for a fixed ticket.

Test plan

  • python3 scripts/xfail_expectations_hint.py --self-test — green (7 cases: tracker ref, Fixes #123, bare #123, no-xfail-row, nothing-tracked, URL-path-not-an-issue-ref, refs-from-commits).
  • Verified against the real expectations.toml: --body "Fixes EAI-7052" reproduces the ticket's concrete case (warns on serve-default-engine-inference + serve-default-engine-working-endpoint); an unreferenced ticket is silent; exit code is always 0.
  • ruff check clean; ci.yml parses; hawkeye license-header check passes.

Why match bare #123 too: a bare #123 sometimes means "PR 123", so this can occasionally nudge on an unrelated number — acceptable because the check is advisory. Favor recall: a stray nudge costs a glance; a missed stale xfail costs a mis-attributed red on an unrelated PR.

Comment thread scripts/xfail_expectations_hint.py Fixed
Comment thread scripts/xfail_expectations_hint.py Fixed
@fredespi
fredespi force-pushed the fix-xfail-cleanup-gap branch from 29a3792 to e0c9d12 Compare July 21, 2026 07:37
Comment thread scripts/xfail_expectations_hint.py Fixed

@rominf rominf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the matching logic, workflow wiring, Actions input handling, and the CodeQL remediation. The current head removes the flagged file sink and all checks are green. Non-blocking follow-up: scripts/xfail_expectations_hint.py:224 reads expectations.toml without guarding a missing file, so a PR that renames or removes it would make this advisory job exit 1 despite the script's never-fail contract.

@fredespi
fredespi force-pushed the fix-xfail-cleanup-gap branch from 47e74a2 to 04d1389 Compare July 21, 2026 13:25
fredespi added 3 commits July 21, 2026 15:30
A bug fix whose CI lane doesn't exercise the platform an xfail row is keyed
to merges green, leaving the stale row to surface later as a mis-attributed
XPASS on an unrelated PR. Close that gap at authoring time.

- scripts/xfail_expectations_hint.py: parse expectations.toml, collect the
  ticket ids a PR references (title, body, commit messages) in both the
  project tracker and GitHub #issue shapes, and warn if any still has a live
  xfail row. Advisory only: always exits 0. Behavior pinned by --self-test.
- ci.yml: wire it as a non-blocking, non-required pull_request job on
  ubuntu-latest, reusing the pinned checkout action; PR text passed via env
  (no shell interpolation).
- pull_request_template.md: one checkbox reminding authors to clear stale
  xfail rows for a fixed ticket.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
CodeQL flagged the open() on GITHUB_STEP_SUMMARY as a path-injection
sink, and GitHub's default code-scanning setup ignores the inline
`# codeql[...]` suppression comment. Drop the file write entirely:
emit() now prints the note to stdout and the workflow redirects it to
$GITHUB_STEP_SUMMARY, matching the existing convention in ci.yml.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
main() read the expectations matrix unconditionally, so a PR that renames
or removes it would raise FileNotFoundError and exit 1 — breaking the
script's never-fail advisory contract. Guard the read and exit 0 when the
file is gone.

Signed-off-by: fredespi <fredrik.espinoza@gmail.com>
@fredespi
fredespi force-pushed the fix-xfail-cleanup-gap branch from 04d1389 to 1889e21 Compare July 21, 2026 13:30
@fredespi fredespi closed this Jul 21, 2026
@fredespi fredespi reopened this Jul 21, 2026
@fredespi
fredespi added this pull request to the merge queue Jul 22, 2026
Merged via the queue into main with commit d82bcc6 Jul 22, 2026
20 of 21 checks passed
@fredespi
fredespi deleted the fix-xfail-cleanup-gap branch July 22, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants