Skip to content

infra: port .github/actions/setup-macos-codesigning to Python (GEN-005 sweep, #962) #2794

Closed

Description

@zackees

What

.github/actions/setup-macos-codesigning/action.yaml carries four multi-line run: steps, so ci-lint precheck reports four GEN-005 approved exceptions for that path (ci.toml, block at the setup-macos-codesigning entry). The Python-port sweep has already gone through the sibling composite actions (compatibility-validator #2692, services-validator #2777-era, flatpak-manifest-validator, qt-xml-validator, generate-docs, check-changes, and run-swift-format is in flight as #2792); this action is the same shape and is still shell.

Findings on origin/master (ci-lint precheck, pin a1917ce7…, header 5 violation(s), 416 approved exception(s), 10 needs_review):

  • runs.steps[0] — the non-macOS runner guard (shell: bash, if: runner.os != 'macOS')
  • runs.steps[1] — macOS Code Signing ✍️ (id: codesign, zsh): decodes the PKCS12, creates/unlocks the temporary keychain, imports the certificate, sets set-key-partition-list, and writes haveCodesignIdent / codesignIdent / codesignTeam / MACOS_KEYCHAIN_PASSWORD
  • runs.steps[2] — Provisioning Profile 👤 (id: provisioning, zsh): decodes the profile, security cms -D, plutil -extract UUID / TeamIdentifier.0, and copies it to ~/Library/MobileDevice/Provisioning Profiles/<uuid>.provisionprofile
  • runs.steps[3] — Notarization 🧑‍💼 (id: notarization, zsh): sets haveNotarizationUser from the presence of the two credentials

runs.steps[4..8] are uses: steps / with: inputs and are not findings.

Fix

One module, ci/setup_macos_codesigning.py (#!/usr/bin/env -S uv run --script), one subcommand per step, each step a single uv run call, mirroring the merged compatibility-validator port (#2692):

  • a pinned astral-sh/setup-uv step at the top of the action — the callers (analyze-project.yaml, build-project.yaml, release-rust.yaml) install nothing before it — with the same save-cache: ${{ github.ref == 'refs/heads/master' }} expression and the CACHE-013 cache-suffix pr-<N> expression the sibling ports use, so the new step adds no CACHE-013 finding;
  • ci/setup_macos_codesigning.py guard (the action's own if: runner.os != 'macOS' still selects it, exit 2);
  • ci/setup_macos_codesigning.py codesign — same env inputs (MACOS_SIGNING_*, MACOS_KEYCHAIN_PASSWORD), same security argv, the same random keychain password when one is not supplied, the same $GITHUB_OUTPUT / $GITHUB_ENV lines, and the same team-id rule (${${IDENTITY##* }//(\(|\))/} — everything after the last space, parentheses removed);
  • ci/setup_macos_codesigning.py provisioning (if: still fromJSON(steps.codesign.outputs.haveCodesignIdent)) and … notarization, writing the same outputs;
  • ci/test_setup_macos_codesigning.py as the offline pin: load the module by path, stub security / plutil / base64 on PATH to record argv, assert the keychain/import/partition argv, the outputs each branch writes (credentials present and absent), and the team-id transform, plus a static pin that the action's four steps are single uv run calls and that the ci.toml GEN-005 block for this path is gone.

Why it is safe to change

The action's signing path only runs when the release credentials are configured; on PR runs the inputs are empty and the else branch writes haveCodesignIdent=false, so PR CI exercises the port's no-credentials path on every macOS job that calls it. The offline test covers the credential-present argv and outputs with stubs, which is the only part Linux cannot run. RED is the offline test (module absent, ci.toml block present); GREEN is the module plus the action and ci.toml edits, with ci-lint precheck moving 416 → 412 approved exceptions and no other count moving.

Activity

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

    @zackees
    MemberAuthor

    Claiming: investigation — the four GEN-005 findings are enumerated in the issue body, so this is the port itself, not an open question.

    Plan (one PR, from origin/master):

    1. RED: ci/test_setup_macos_codesigning.py — module absent, ci.toml GEN-005 block for this path still present.
    2. GREEN: ci/setup_macos_codesigning.py (guard / codesign / provisioning / notarization), the action's four steps become one uv run call each, a pinned astral-sh/setup-uv step at the top of the action, and the ci.toml block deleted.
    3. Verify: uv run --no-project ci/test_setup_macos_codesigning.py, uv run ci/local_gate.py --only self-test, and ci-lint precheck 416 -> 412 approved exceptions with no other count moving.

    First PR today.

  3. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    /ready

    Scope is settled (four enumerated findings in one action, one module, one offline test), 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

    Claiming: the port (single PR, infra/2794-setup-macos-codesigning-python)

    RED ci/test_setup_macos_codesigning.py first, then the module, the action edit and the ci.toml block deletion.

  7. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Port opened as #2795 (infra/2794-setup-macos-codesigning-python).

    • RED f3e84762d: ci/test_setup_macos_codesigning.py, 18 cases; fails on master because the module is absent (failures=18, errors=4) and the ci.toml block is present.
    • GREEN f3f448128: ci/setup_macos_codesigning.py (guard / codesign / provisioning / notarization), the action's four run: steps are one uv run --no-project --script call each, a pinned astral-sh/setup-uv step added above the guard, and the GEN-005 [[exceptions]] block deleted.
    • ci-lint precheck: 5 violation(s), 416 approved exception(s), 10 needs_review -> 5 violation(s), 412 approved exception(s), 10 needs_review, no other count moving.
    • Local: uv run python -m unittest ci.test_setup_macos_codesigning OK, ci/local_gate.py --only self-test ok, ./lint ok (37.5 s).
  8. added 2 commits that reference this issue on Oct 28, 2026
  9. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Closing: #2795 merged on master at 13:48Z (ci(#962): call the macOS code-signing action steps as Python), so the four GEN-005 exceptions for .github/actions/setup-macos-codesigning/action.yaml are gone from ci.toml. Nothing else was outstanding.

  10. added a commit that references this issue on Oct 30, 2026
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