Skip to content

infra: port .github/actions/windows-patches to Python (GEN-005 sweep, #962) #2804

Closed

Description

@zackees

What

.github/actions/windows-patches/action.yaml is nine multi-line run: steps in PowerShell, so ci-lint precheck reports 12 GEN-005 approved exceptions for that path (runs.steps[0..10], one per shell block plus the shell: pwsh keys). The Python-port sweep has already gone through the sibling composite actions (setup-macos-codesigning #2794/#2795, compatibility-validator #2692, services-validator, flatpak-manifest-validator, qt-xml-validator, generate-docs, check-changes, run-swift-format #2792); this action is the largest one still shell.

Findings on origin/master (ci-lint precheck, pin a1917ce7…, header 5 violation(s), 400 approved exception(s), 10 needs_review); the action path appears 12 times in the GEN-005 section:

grep -c 'APPROVED EXCEPTION .github/actions/windows-patches/action.yaml' precheck.out
12

Steps that carry a finding:

step what the block does
Download Release Artifact gh release download the Windows zip, gh attestation verify --owner obsproject, Expand-Archive to build/
Setup bouf gh release download the bouf and bouf-nsis zips, compare both SHA-256s, Expand-Archive to bin/ and nsis/
Install NSIS winget install --id NSIS.NSIS
Install rclone and pandoc choco install rclone pandoc -y --no-progress
Download Previous Builds rclone -q copy :s3:obs-builds/<arch> old_builds (env carries the GCS credentials)
Prepare Release Notes git tag -l --format=%(contents:subject) + a # rule + %(contents:body) into notes.rst
Run bouf bouf.exe with the config/version/branch/notes/-i/-p/-o argument list

The three .ps1 helpers (Ensure-Location.ps1, Invoke-External.ps1, Logger.ps1) keep their own path-scoped exceptions and are not part of this unit; this PR removes only the action.yaml block.

Fix

One module, ci/windows_patches.py (#!/usr/bin/env -S uv run --no-project --script), one subcommand per step, each step a single uv run call — the shape #2794/#2795 used for the macOS signing action:

  • a pinned astral-sh/setup-uv step at the top of the action (both callers, publish.yaml and dispatch.yaml, check the repository out before the action and install nothing else) with the save-cache: ${{ github.ref == 'refs/heads/master' }} expression and the CACHE-013 cache-suffix pr-<N> expression, so the new step adds no CACHE-013 finding;
  • download — gh release download + gh attestation verify as two child processes and zipfile for the extraction;
  • setup-bouf — the same two downloads, hashlib.sha256 against BOUF_HASH / BOUF_NSIS_HASH (a mismatch fails the step), zipfile into bin/ and nsis/;
  • install-nsis, install-tools — the same winget / choco argv;
  • download-previous — the same rclone argv, environment untouched;
  • prepare-notes — the same three git tag -l --format= calls, written with the same # rule and blank line;
  • run-bouf — the same argument list, path resolved from GITHUB_WORKSPACE.

RED/GREEN is the precheck header: 400 -> 388 approved exception(s), no other count moving, and ci/test_windows_patches.py pins it offline (module absent + ci.toml block present on master; argv, hash mismatch and exit statuses against stubs).

Activity

  1. added
    infra
    on Oct 28, 2026
  2. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Claiming: investigation — the twelve GEN-005 findings for .github/actions/windows-patches/action.yaml are enumerated in the body, so this is the port itself, not an open question.

    Plan (one PR, from origin/master):

    1. RED: ci/test_windows_patches.py — module absent, ci.toml GEN-005 block for this path still present.
    2. GREEN: ci/windows_patches.py (one subcommand per step), the action reduced to one uv run call per step plus a pinned Set Up uv, and the ci.toml block deleted.
    3. ci-lint precheck 400 -> 388 approved exceptions, no other count moving.
  3. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    /ready

    Twelve enumerated findings in one action, one module, one offline test — scope is settled, so this is Ready rather than an open investigation.

  4. added
    needs-investigation
    on Oct 28, 2026
  5. added
    ready
    and removed
    needs-investigation
    on Oct 28, 2026
  6. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    /ready

  7. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Claiming: the port (single PR, infra/2804-windows-patches-python)

    RED ci/test_windows_patches.py first, then ci/windows_patches.py, the action edit and the ci.toml block deletion.

  8. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Port opened as #2806 (infra/2804-windows-patches-python).

    • RED 3e4b4a5c5: ci/test_windows_patches.py only, 18 cases; fails on master (module absent + action still PowerShell + ci.toml block present).
    • GREEN 78f341842: ci/windows_patches.py (seven subcommands), the action reduced to one uv run --no-project --script call per step with a pinned Set Up uv first, and the GEN-005 block deleted.

    Correction to the body's header: master moved while this tick ran, so the measured pair is 407 -> 395 approved exceptions (not 400 -> 388), exactly the twelve windows-patches/action.yaml lines, with no other rule moving — CACHE-013 stays 12, so the new setup-uv step adds no finding.

    Local: ci/test_windows_patches.py 18/18, ci.test_uv_run + ci.test_ci_toml 50/50, ruff check clean. Not verified: no Windows lane runs this action from a PR path, so the real winget/choco/rclone/bouf.exe execution is unproven here.

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

Metadata

Metadata

Assignees

Labels

infraready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions