You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extends .githooks/pre-commit to run 'make generate' and fail the commit
if CRDs/deepcopy are out of sync, but only when api/ type files are
staged (so normal commits stay fast).
Also documents required status checks for main branch protection, so
the Codegen & Helm sync job blocks PR merges instead of failing
silently post-merge.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,31 @@ make build # compile all binaries
108
108
go build ./... # quick compile check
109
109
```
110
110
111
+
### Pre-commit hook
112
+
113
+
The repo ships a pre-commit hook at `.githooks/pre-commit` that:
114
+
115
+
1. verifies all Go files are `gofmt`-formatted, and
116
+
2. if any `api/` type files are staged, runs `make generate` and fails the commit if CRDs/deepcopy are out of sync.
117
+
118
+
Enable it once per clone:
119
+
120
+
```bash
121
+
make setup-hooks
122
+
```
123
+
124
+
This catches codegen drift locally — without it, the drift only surfaces in the `Codegen & Helm sync` CI job after push.
125
+
126
+
### Required status checks
127
+
128
+
The following CI jobs should be configured as **required status checks** on the `main` branch in GitHub branch protection, so PRs can't merge while red:
0 commit comments