rsyslog/.codex/hooks.json
Rainer Gerhards 0ff5792ee4 codex: wire local container testing hook into agent workflow
Why:
Mandate the local container testing validation per AGENTS.md before push.
To make it completely robust, we prevent empty or invalid marker commits
from bypassing the check, expand the file types that trigger re-run
(including Python, Dockerfile, YAML metadata, and tests), and handle git
history changes gracefully without crashes.

Impact:
Developer/AI agents are blocked from pushing if they touch C, Python, Docker,
YAML, or test files without running container validation first.

Before/After:
Before, container validation wasn't wired, or empty/invalid markers could
be bypassed or cause shell crashes. Now, the hook is fully integrated, robust
against invalid commit hashes, and covers all relevant file extensions.

Technical Overview:
1. Wire pre_push_container_gate.sh into hooks.json under PreToolUse for Bash.
2. Use git rev-parse to verify the validation marker commit hash actually
   exists in the local repository before running diffs.
3. Expand file matching regex to include .py, Dockerfile,
   MODULE_METADATA.yaml, and any files under tests/.
4. Gitignore .codex/container_validated.marker to keep mutable local developer
   state out of commits.

With the help of AI-Agents: Antigravity
2026-05-23 15:52:22 +02:00

22 lines
595 B
JSON

{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/usr/bin/env bash \"$(git rev-parse --show-toplevel)/.codex/pre_commit_format_gate.sh\"",
"statusMessage": "Running pre-commit format gate"
},
{
"type": "command",
"command": "/usr/bin/env bash \"$(git rev-parse --show-toplevel)/.codex/pre_push_container_gate.sh\"",
"statusMessage": "Running pre-push container validation gate"
}
]
}
]
}
}