chore: making PR review chores deterministic + less token hungry

This commit is contained in:
Gustavo Madeira Santana
2026-02-11 13:20:57 -05:00
parent 93411b74a0
commit 72fbfaa755
15 changed files with 2500 additions and 527 deletions

1056
scripts/pr Executable file

File diff suppressed because it is too large Load Diff

37
scripts/pr-merge Executable file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
set -euo pipefail
script_dir="$(cd "$(dirname "$0")" && pwd)"
usage() {
cat <<USAGE
Usage:
scripts/pr-merge <PR> # verify only (backward compatible)
scripts/pr-merge verify <PR> # verify only
scripts/pr-merge run <PR> # verify + merge + post-merge checks + cleanup
USAGE
}
if [ "$#" -eq 1 ]; then
exec "$script_dir/pr" merge-verify "$1"
fi
if [ "$#" -eq 2 ]; then
mode="$1"
pr="$2"
case "$mode" in
verify)
exec "$script_dir/pr" merge-verify "$pr"
;;
run)
exec "$script_dir/pr" merge-run "$pr"
;;
*)
usage
exit 2
;;
esac
fi
usage
exit 2

33
scripts/pr-prepare Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -ne 2 ]; then
echo "Usage: scripts/pr-prepare <init|validate-commit|gates|push|run> <PR>"
exit 2
fi
mode="$1"
pr="$2"
base="$(cd "$(dirname "$0")" && pwd)/pr"
case "$mode" in
init)
exec "$base" prepare-init "$pr"
;;
validate-commit)
exec "$base" prepare-validate-commit "$pr"
;;
gates)
exec "$base" prepare-gates "$pr"
;;
push)
exec "$base" prepare-push "$pr"
;;
run)
exec "$base" prepare-run "$pr"
;;
*)
echo "Usage: scripts/pr-prepare <init|validate-commit|gates|push|run> <PR>"
exit 2
;;
esac

3
scripts/pr-review Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
exec "$(cd "$(dirname "$0")" && pwd)/pr" review-init "$@"