Surface publish-time gates as PR-visible jobs#164
Merged
Conversation
Collaborator
Author
Extract require-latest, the pnpm-workspace/lock drift guard, and the scan-pnpm-repo Trivy scan from build-test-publish into separate preflight and security-scan jobs. Both are non-blocking on PRs and blocking on the default branch and in the merge queue, mirroring the existing check-changesets pattern. build-test-publish gates publish on both via needs + if.
scan-pnpm-repo discovers images via dist/artifacts/*.json which is only populated by the build step. A pre-build security-scan job silently passes in auto-discovery mode (scan_npm_package returns 0 when no images are found and _require_docker=false), making the Trivy gate a no-op. Restore scan-pnpm-repo as a step in build-test-publish after the build. preflight (require-latest + lockfile drift) is unaffected since those checks have no artifact dependency.
cc9ca1f to
cc1aa77
Compare
This was referenced May 22, 2026
PaulNewling
added a commit
that referenced
this pull request
May 22, 2026
The previous single 'preflight' job collapsed both checks under one PR status row, and when require-latest failed the pnpm-lock-sync step was skipped (job-level continue-on-error does not propagate to step ordering inside the job). Split into 'preflight-require-latest' and 'preflight-pnpm-lock-sync' so each surfaces as its own PR-visible check, each carries its own job-level continue-on-error, and a failure in one no longer hides the other. Downstream needs: in pre-calculated-build, build-test-publish, and notify slack release updated to depend on both new jobs. Follow-up to #164.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two publish-time gates move out of
build-test-publishinto a PR-visiblepreflightjob. Merge protection is unchanged — the merge queue still blocks any failure.Gates
require-latest(SDK drift)build-test-publish; failure skipped build / test / publishpreflightjob; non-blocking on PR, blocking in merge queue and on the default branchpnpm-workspace↔pnpm-lockdriftbuild-test-publishandpre-calculated-build(the latter ran withfetch-depth: 1, effectively a no-op)preflightjob, single canonical location withfetch-depth: '0'scan-pnpm-repo(Trivy)build-test-publishafter build / testdist/artifacts/*.jsonproduced by the build, so it must stay co-located with the build (see greptile comment)Per-trigger behavior
continue-on-errorpull_requesttruemerge_groupfalsepushto default branchfalseneeds+ifonbuild-test-publishNotes
preflightmirrors the existingcheck-changesetspattern:continue-on-error: ${{ github.ref_name != inputs.changeset-default-branch && github.event_name != 'merge_group' }}.build-test-publishaddspreflighttoneeds+if.build-test-publish, download in a downstream scan job, split publish into its own job). Out of scope here.Greptile Summary
This PR promotes two publish-time gate checks — SDK version drift (
require-latest) andpnpm-workspace.yaml/pnpm-lock.yamlsync — out ofbuild-test-publishinto a newpreflightjob that surfaces failures as PR-visible checks while remaining blocking in the merge queue and on the default branch.preflightmirrors the existingcheck-changesetspattern exactly:continue-on-erroristrueonpull_requestevents andfalseonmerge_group/default-branchpush, so downstream jobs (pre-calculated-build,build-test-publish) gate onneeds.preflight.result == 'success' || 'skipped'.fetch-depth: '0'inpreflight, replacing the previous copy inpre-calculated-buildwhich ran atfetch-depth: 1and was effectively a no-op.scan-pnpm-repo) correctly stays inbuild-test-publishsince it readsdist/artifacts/produced by the build step.Confidence Score: 5/5
Safe to merge — the refactoring is a clean extraction with no behavioral changes on the default branch or merge queue, and the continue-on-error + downstream if guards are correctly wired.
The preflight job follows the identical gating pattern as check-changesets, the lockfile-drift check now runs with a full clone where it was previously a no-op, and the Trivy scan correctly remains co-located with the build. No logic changes affect merge protection.
No files require special attention.
Important Files Changed
preflightjob withrequire-latestand pnpm-lock drift checks; correctly wirescontinue-on-error,needs, andifguards for all downstream jobs and the notify job.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD init["init"] metadata["metadata"] preflight["preflight\n(require-latest + pnpm-lock drift)\ncontinue-on-error: PR=true / MQ=false"] check_changesets["check-changesets\ncontinue-on-error: PR=true / MQ=false"] pre_calc["pre-calculated-build\nif: preflight==success|skipped"] btp["build-test-publish\nif: preflight==success|skipped"] notify["notify-slack-release"] init --> metadata init --> preflight metadata --> check_changesets preflight --> pre_calc check_changesets --> pre_calc metadata --> pre_calc preflight --> btp check_changesets --> btp metadata --> btp pre_calc --> btp btp --> notify preflight --> notify check_changesets --> notify pre_calc --> notify metadata --> notify init --> notifyReviews (2): Last reviewed commit: "Revert security-scan extraction: scan ne..." | Re-trigger Greptile