Skip to content

ci: catch untracked generated files in check-crds-sync#268

Merged
whg517 merged 1 commit into
zncdatadev:mainfrom
whg517:ci/check-crds-sync-untracked
Jul 22, 2026
Merged

ci: catch untracked generated files in check-crds-sync#268
whg517 merged 1 commit into
zncdatadev:mainfrom
whg517:ci/check-crds-sync-untracked

Conversation

@whg517

@whg517 whg517 commented Jul 19, 2026

Copy link
Copy Markdown
Member

What

The check-crds-sync job runs make manifests and then git diff --exit-code, but git diff only reports changes to tracked files. A brand-new generated CRD/RBAC file that was never committed is untracked, so it passed the gate silently — stale-by-omission escaped CI.

This stages everything first and diffs the index instead, so untracked generated files fail the check too:

make manifests
git add -A
if ! git diff --cached --exit-code; then

Applied to the check-crds-sync job in both chart-lint-test.yml and release.yml.

Why it's safe

  • git add -A respects .gitignore, so the bin/ tooling downloaded by make manifests does not trip the check (bin is gitignored in this repo).
  • Verified in a scratch repo: the old check misses an untracked generated file; the new check catches it; a clean tree with only ignored bin/ content still passes.

Part of an org-wide rollout of the same fix to all operator repos with this job.

🤖 Generated with Claude Code

git diff --exit-code only reports changes to tracked files, so a brand-new
generated CRD/RBAC file that was never committed passed the sync gate
silently. Stage everything first and diff the index instead, so untracked
generated files fail the check too.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@whg517
whg517 merged commit 31cdb8a into zncdatadev:main Jul 22, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant