cozystack/.github
myasnikovdaniil 82d1f8a1d2
ci(api): add codegen drift check (#2463)
## What this PR does

- Adds a pre-commit hook and a dedicated GitHub Actions workflow that
run `make generate` at the repo root to catch drift in generated API
code (CRDs, DeepCopy, clients, RBAC) before it lands on main.
- Pre-commit hook is scoped to paths that actually affect codegen
(`api/`, `pkg/apis/`, `hack/update-codegen.sh`,
`hack/boilerplate.go.txt`) so unrelated commits are not slowed down.
- CI workflow (`.github/workflows/codegen-drift.yml`) installs Go from
`go.mod`, runs `make generate`, and fails on drift with an error
pointing contributors to the local fix.
- Includes one drift fix the check surfaced: `RestoreJobSpec.Options`
(added in #2437) had no `DeepCopyInto` handling — regenerated.

### Release note

```release-note
ci(api): add pre-commit hook and GitHub Actions workflow that verify generated API code (CRDs, deepcopy, clients, RBAC) is in sync with `make generate`.
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Added a CI workflow that checks generated code during PRs and fails
the build if generated artifacts diverge.
* Added a pre-commit hook that runs generation checks locally to prevent
committing outdated generated files.
* Fixed deep-copy behavior for backup restore job specs so nested
options are correctly duplicated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-28 12:41:48 +05:00
..
ISSUE_TEMPLATE chore(ci): adopt CNCF/k8s label conventions 2026-04-27 03:15:09 +03:00
workflows ci(api): add codegen drift check (#2463) 2026-04-28 12:41:48 +05:00
CODEOWNERS chore(maintenance): add @myasnikovdaniil to CODEOWNERS 2026-04-21 14:31:07 +05:00
labels.yml chore(ci): normalize hex color case in labels.yml 2026-04-27 03:30:09 +03:00
PULL_REQUEST_TEMPLATE.md docs(maintenance): mirror illustrative-scopes wording in PR template 2026-04-27 11:20:13 +03:00