Skip to content

ci(executable): verify the packaged binary per PR and make the release verify actually fail#2307

Merged
rishigupta1599 merged 3 commits into
masterfrom
ci/executable-per-pr-verify
Jun 19, 2026
Merged

ci(executable): verify the packaged binary per PR and make the release verify actually fail#2307
rishigupta1599 merged 3 commits into
masterfrom
ci/executable-per-pr-verify

Conversation

@rishigupta1599

Copy link
Copy Markdown
Contributor

Separate PR for the two CI gaps surfaced by the _require is not a function binary crash (the code fix itself is #2306).

Issue 1 — a broken binary still got uploaded

The release Build Executables workflow runs ./percy --version as its "Verify executable" gate, then uploads. But the executables are built on Node 14, where an unhandled promise rejection is only a warning and the process still exits 0. So when the binary crashed on startup, --version printed the stack trace yet returned exit code 0 — the gate passed and the broken binary was uploaded anyway.

Fix: scripts/verify-executable.sh — a real smoke test that fails unless --version:

  • exits 0, and
  • prints a valid semver, and
  • emits no runtime-error markers (UnhandledPromiseRejection, is not a function, TypeError, Cannot find module, Error:, …).

It ignores benign Node deprecation warnings. Both the macOS and Windows verify steps in executable.yml now use it.

Issue 2 — nothing built the binary per PR

executable.yml only triggers on release: published, so a binary-breaking change was only caught after merge, at release time.

Fix: new executable-check.yml runs on pull_request → builds the executables and runs the same verify, without signing or uploading. A PR that breaks the binary now fails CI.

To make executable.sh usable without secrets, its macOS signing/notarization/upload block is now guarded by APPLE_DEV_CERT: when unset (PR builds, including forks) it's skipped and ./percy is left as the macOS binary so the verify step runs natively on the runner. The signed release path is unchanged (secret is present → identical behavior).

⚠️ Action required to actually block merges

A workflow alone doesn't block merges. To get the "any PR causing such issues will not even get merged" behavior, mark Build & verify executable as a required status check in branch protection for master.

Verification

  • scripts/verify-executable.sh self-tested locally: fails the exact Node-14 UnhandledPromiseRejectionWarning: ... _require is not a function output (exit 1), passes a healthy 1.32.2 (exit 0), and does not false-positive on a DeprecationWarning.
  • bash -n clean on both scripts; both workflow YAMLs parse.

🤖 Generated with Claude Code

…ctually fail

Two related fixes to the executable pipeline:

1. The release "Verify executable" step ran a bare `./percy --version`. The
   executables are built on Node 14, where an unhandled promise rejection is a
   non-fatal warning (exit 0), so a binary that crashes on startup still exits 0
   — the check passed and the broken binary was uploaded anyway. Replace it with
   scripts/verify-executable.sh, which fails unless `--version` exits 0, prints a
   real semver, and emits no runtime-error markers (used by both the macOS and
   Windows verify steps).

2. The build only ran on `release: published`, so a binary-breaking change was
   only caught after merge, at release time. Add a `pull_request` workflow
   (executable-check.yml) that builds the executables and runs the same verify,
   with no signing and no upload, so such PRs fail CI before merge.

scripts/executable.sh now skips the macOS signing/notarization/upload block when
APPLE_DEV_CERT is unset (PR builds, incl. forks), leaving ./percy as the macOS
binary so the verify step runs natively. The signed release path is unchanged.

Note: making this block merges requires marking "Build & verify executable" as a
required status check in branch protection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rishigupta1599 rishigupta1599 requested a review from a team as a code owner June 18, 2026 17:38
Comment thread .github/workflows/executable-check.yml Fixed
rishigupta1599 and others added 2 commits June 18, 2026 23:13
`pkg ... -d` enables pkg's debug mode, which logs every bundled file
("included as DISCLOSED code (with sources)" / "asset content") — thousands of
lines that drown the verify output. The flag only affects logging, not the
produced binaries, so remove it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@rishigupta1599 rishigupta1599 merged commit 02c9712 into master Jun 19, 2026
63 of 65 checks passed
@rishigupta1599 rishigupta1599 deleted the ci/executable-per-pr-verify branch June 19, 2026 09:58
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