feat: pre-merge infra validation hook (Phase 17a) #122
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/claude-custom#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-pal-e-agency→ Phase 17 → Phase 17a (pre-merge infra validation gate)Repo
forgejo_admin/claude-customUser Story
As the platform operator
I want a PreToolUse hook that blocks merging infra PRs without validation evidence
So that infrastructure changes are never merged without plan/kustomize output, reducing Change Failure Rate
Context
Currently no pre-merge validation for infrastructure changes. Kustomize overlays and terraform changes are only tested after merge, creating CFR risk. The
sop-platform-tf-changesSOP documents the desired validation patterns but enforcement is manual.This hook runs on
mcp__forgejo__merge_approved_pr— same event as the existingblock-mcp-merge.shbut a separate check. It only fires for infra repos (pal-e-platform, pal-e-services, pal-e-deployments).File Targets
Files to create:
hooks/check-infra-validation.sh— the PreToolUse hook scriptFiles to modify:
settings.json— register the new hook under the PreToolUse >mcp__forgejo__merge_approved_prmatcherFiles NOT to touch:
hooks/block-mcp-merge.sh— existing merge gate, separate concernAcceptance Criteria
hooks/check-infra-validation.shexists and is executablesettings.jsonunder PreToolUse with matchermcp__forgejo__merge_approved_prpal-e-platform: checks Woodpecker CI status — pipeline must have passed (green)pal-e-services: checks PR body or comments fortofu planorPlan:evidencepal-e-deployments: checks PR body or comments forkubectl kustomizeorkustomize buildevidencesop-platform-tf-changesTest Expectations
bash -n hooks/check-infra-validation.sh(syntax check)Constraints
/tmp/claude-custom-{branch}— never work in~/claude-customdirectly~/secrets/pal-e-services/forgejo.env(same pattern ashooks/forgejo-helper.sh)~/secrets/pal-e-services/woodpecker.envif it exists, otherwise from env varsjqChecklist
Related
project-pal-e-agency— project this affectstodo-pre-merge-infra-validation— full spec with pseudocode and evidence patterns