From ee6bdb3bab26f2796943c6cac03d8f62a5664937 Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Thu, 12 Mar 2026 16:22:21 -0700 Subject: [PATCH] feat: add --no-test flag to prepare-gates Allows skipping the full test suite during prepare phase. Testing is deferred to the dedicated Test phase in the pipeline. --- scripts/pr | 7 +++++-- scripts/pr-prepare | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/pr b/scripts/pr index dc0f4e2fc..5e73cf93b 100755 --- a/scripts/pr +++ b/scripts/pr @@ -1384,6 +1384,7 @@ validate_changelog_merge_hygiene() { prepare_gates() { local pr="$1" + local skip_test="${2:-false}" enter_worktree "$pr" false checkout_prep_branch "$pr" @@ -1418,7 +1419,9 @@ prepare_gates() { run_quiet_logged "pnpm build" ".local/gates-build.log" pnpm build run_quiet_logged "pnpm check" ".local/gates-check.log" pnpm check - if [ "$docs_only" = "true" ]; then + if [ "$skip_test" = "true" ]; then + echo "Test skipped (--no-test). Full suite deferred to Test phase." + elif [ "$docs_only" = "true" ]; then echo "Docs-only change detected with high confidence; skipping pnpm test." else run_quiet_logged "pnpm test" ".local/gates-test.log" pnpm test @@ -1987,7 +1990,7 @@ main() { prepare_validate_commit "$pr" ;; prepare-gates) - prepare_gates "$pr" + prepare_gates "$pr" "${3:-false}" ;; prepare-push) prepare_push "$pr" diff --git a/scripts/pr-prepare b/scripts/pr-prepare index 98f55df4f..93a568458 100755 --- a/scripts/pr-prepare +++ b/scripts/pr-prepare @@ -1,13 +1,20 @@ #!/usr/bin/env bash set -euo pipefail -if [ "$#" -ne 2 ]; then - echo "Usage: scripts/pr-prepare " +if [ "$#" -lt 2 ]; then + echo "Usage: scripts/pr-prepare [--no-test]" exit 2 fi mode="$1" pr="$2" +shift 2 +no_test=false +for arg in "$@"; do + case "$arg" in + --no-test) no_test=true ;; + esac +done script_dir="$(cd "$(dirname "$0")" && pwd)" base="$script_dir/pr" if common_git_dir=$(git -C "$script_dir" rev-parse --path-format=absolute --git-common-dir 2>/dev/null); then @@ -25,7 +32,11 @@ case "$mode" in exec "$base" prepare-validate-commit "$pr" ;; gates) - exec "$base" prepare-gates "$pr" + if [ "$no_test" = "true" ]; then + exec "$base" prepare-gates "$pr" true + else + exec "$base" prepare-gates "$pr" + fi ;; push) exec "$base" prepare-push "$pr"