Skip to content

CI: run the Pester guard on Windows without the smoke suite - #7753

Merged
danielhanchen merged 2 commits into
mainfrom
guard-covers-its-own-file
Aug 3, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
guard-covers-its-own-file

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

Problem

The Pester guard added in #7743 runs on windows-latest inside the pester job, so editing the bootstrap runs the guard. Editing the guard itself did not run it on any Windows runner.

That is not theoretical. #7750 fixed a Windows-only bug in the guard (Path.relative_to() returns backslashes, so a membership test against the forward-slash paths in the YAML could never match). It changed exactly one file, tests/studio/test_pester_bootstrap_hardening.py, and the setup.ps1 unit tests job never appeared in its checks. A Windows-only fix merged with no Windows coverage.

The obvious fix, adding the guard to studio-windows-inference-smoke.yml's paths, is worse than the problem: none of that workflow's eight jobs has an if:, so a guard-only .py edit would launch all of them, including four GGUF download and inference jobs that run 30 to 35 minutes.

Changes

  • New .github/workflows/pester-guard-ci.yml: one job, windows-latest, checkout + setup-python + pytest. It triggers on the guard file and on itself.
  • The guard asserts that workflow keeps the guard file in its paths, stays a single job, and stays on windows-latest.

studio-windows-inference-smoke.yml is unchanged. Coverage is now split by cost:

  • editing the bootstrap runs the guard in the existing pester job, at no extra cost
  • editing the guard runs the new one-job workflow on the same OS

Verification

Measured on a staging repo, changing only the two files a guard-only edit touches:

  • Pester guard / Pester bootstrap guard ran on windows-latest, 9 passed, 26 seconds wall clock
  • Windows Unsloth GGUF CI did not trigger

Negative controls, each of which fails the guard: dropping the guard from the new workflow's paths, moving the job off windows-latest, deleting the workflow.

The six bootstrap mutations from #7743 are all still caught: dropping the Install-PSResource call, dropping either or both registration commands, re-silencing a registration, dropping the initial client selection, dropping the guard step.

The workflow's paths filter covers tests/studio/*.ps1, which does not match the
guard's .py file, so editing the guard alone did not run the job that executes
it on windows-latest. That is how the backslash comparison fixed in #7750 was
merged without the Windows job ever running.

Add the guard to the filter and assert its own coverage, so this cannot regress.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6e391238e

ℹ️ 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".

# The guard runs on windows-latest, so editing it must run this job. Without
# this, a Windows-only break in the guard lands and only shows up later, on an
# unrelated PR.
- 'tests/studio/test_pester_bootstrap_hardening.py'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid launching every smoke job for guard-only changes

When a PR changes only this Python guard, this workflow-level paths entry enables the entire workflow, not just pester. The inspected workflow has no job-level path conditions, so the unrelated inference, Visual Studio, and VC++ jobs also launch—including multiple 30–35 minute GGUF download and inference jobs—despite the adjacent filter comment explicitly avoiding GGUF jobs for Python-only changes. Move the guard to a lightweight workflow or add change-based job gating so guard-only edits run pester without starting every Windows smoke job.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Confirmed: none of the eight jobs in that workflow has an if:, so a guard-only .py edit would have launched all of them, including the four 30 to 35 minute GGUF download and inference jobs. That is the opposite of what the entry was for. Reverted it and moved the guard to a dedicated one-job pester-guard-ci.yml on windows-latest, which runs the same guard in about a minute. The guard now asserts that workflow stays a single Windows job, and three negative controls (dropping the path, moving it off windows-latest, deleting the workflow) each fail the guard.

Listing the guard's .py file in studio-windows-inference-smoke.yml made a
guard-only edit launch all eight Windows smoke jobs, four of which download
GGUF models and run 30+ minutes, because that workflow has no job-level path
gating.

Run the same guard on the same OS in a single one-job workflow instead, and
assert it stays one Windows job.
@danielhanchen

Copy link
Copy Markdown
Member Author

Reworked after the review point about launching the whole smoke suite. Verified on staging that a guard-only change now runs one job, not eight.

Staging PR (shimmyshimmer#179) changed exactly the two files a guard-only edit would touch:

  • Pester guard / Pester bootstrap guard ran on windows-latest, 9 passed, 26 seconds wall clock
  • Windows Unsloth GGUF CI did not trigger, so none of the four 30 to 35 minute GGUF jobs started

Coverage is unchanged and split by cost:

  • editing the bootstrap runs the guard inside the existing pester job, at no extra cost
  • editing the guard runs the new one-job workflow on the same OS

The one red check on staging is Mac Studio UI CI / Chat UI Tests, failing on a floating-monitor geometry assertion (initial bottom inset: expected 884, got 930.5). That is the known flake on that suite and this PR touches no frontend code.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 970bfc9caf

ℹ️ 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".

@danielhanchen danielhanchen changed the title CI: run the Windows Pester job when the guard itself changes CI: run the Pester guard on Windows without the smoke suite Aug 2, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

On the cancelled checks above: those are workflows I stopped by hand to keep the org runners free, not failures.

This PR adds a workflow file and edits one test file. tests/studio/** is in the paths filter of the Studio API and UI suites, so they queued despite nothing in this diff being reachable from them. The same broad validation ran on a staging repo instead.

Left running here: Pester guard (the new job), Backend CI (whose Repo tests (CPU) runs the guard on Linux), Lint CI and CodeQL.

Windows Unsloth GGUF CI is absent by design rather than by cancellation: this PR no longer touches studio-windows-inference-smoke.yml, which is the behaviour it exists to produce.

@danielhanchen
danielhanchen merged commit 8b8eba6 into main Aug 3, 2026
13 of 23 checks passed
@danielhanchen
danielhanchen deleted the guard-covers-its-own-file branch August 3, 2026 05:39
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.

1 participant