fix: fail loudly when test MSIX signing has no inputs - #31
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
The signing script previously skipped both architecture directories when the artifact root was not CI-shaped, then reported success after creating and discarding a certificate. Validate the expected architecture directories before creating signing material so a no-op cannot look like a signed result. Add a regression test that runs the script against an empty artifact root and verifies the failure message, non-zero exit, absence of output, and absence of a newly created publisher certificate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97c31f3f-0c7b-43e8-b979-6418dcb7fedc
ffc1699 to
fc9812b
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 6:40 PM ET / 22:40 UTC. ClawSweeper reviewWhat this changesThe PR makes Windows test signing reject artifact roots without x64 or arm64 directories before creating signing material, and adds a regression test. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main and has no blocking correctness findings. The supplied Windows transcript exercises the reported failure through the real signing script. Priority: P2 Review scores
Verification
How this fits togetherThe Windows packaging pipeline passes architecture-specific MSIX packages to a test-signing script. That script produces signed packages, public certificates, and updated metadata for local installation. flowchart TD
A[Unsigned artifact root] --> B{Supported architecture folder exists?}
B -->|No| C[Actionable error and nonzero exit]
B -->|Yes| D[Discover signing tool]
D --> E[Create temporary certificate]
E --> F[Validate and sign packages]
F --> G[Signed packages and metadata]
F --> H[Clean up signing material]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Preserve the architecture-specific input contract and reject empty signing jobs before creating output or key material. Do we have a high-confidence way to reproduce the issue? Yes: on Windows with the signing prerequisites available, passing an existing root without x64 or arm64 directories reaches main's unconditional success. Source inspection and the contributor's before/after transcript support this; the reviewer did not execute it. Is this the best way to solve the issue? Yes: checking the accepted layout before side effects directly fixes the silent no-op without introducing another input format or changing successful signing. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 52f2a53fb62b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Summary
-ArtifactsDirectorycontains at least one supported architecture directory before doing any workscripts/Test-Sign-TestMSIX.Tests.ps1covering the no-input pathThis addresses a silent-success failure mode only. It intentionally does not change the signing, metadata, or certificate-cleanup behavior, and it does not broaden the accepted input layout.
Why
Sign-TestMSIX.ps1iteratesx64andarm64, skipping each architecture whose directory is absent. When the artifact root is not CI-shaped, both iterations are skipped, the loop body never runs, and control falls through to an unconditional success message and a zero exit code.Found by a real local signing run. Pointing the script at a directory that directly contained
OpenClawGateway-x64.msixprinted:exited
0, and produced no files whatsoever. Passing the wrong shape was operator error; reporting success after signing nothing is the defect. In a release flow this can present a missing or unsigned artifact as a green step, and the only symptom is an empty output directory that nothing forces you to look at.The validation is deliberately placed before
New-SelfSignedCertificate. The previous ordering created a signing certificate, skipped every architecture, and discarded the certificate infinally— doing key-management work for a job it had already established it could not perform.Scope decision
The CI-shaped input contract is retained rather than extended to also accept a directory containing an MSIX directly. Output directories, the exported
.cer, andmsix-metadata.jsonare all written per architecture, so accepting a flat layout would require inventing an architecture for artifacts that do not declare one. A clear error is better than a guess.Validation
The regression test is verified to fail without the fix. Running the new test against the unmodified script from
main:With the fix applied:
The test drives the real script in a child process against an isolated temporary artifact root and asserts the observable outcome: a non-zero exit, an error naming the missing architecture directories, no output directory created, and no new certificate for the policy publisher left in
Cert:\CurrentUser\My. It removes its temporary directory afterwards and matches publisher subjects exactly, so unrelated development certificates are neither inspected nor removed.