ci(test): fail generate check on untracked generated files - #352
ci(test): fail generate check on untracked generated files#352scotchneat wants to merge 1 commit into
Conversation
git diff --exit-code only reports changes to tracked files, so the generate job passed even when 'make generate' created brand-new docs pages that were never committed (e.g. PR #345's docs/resources/object_storage_bucket_inventory.md). Register untracked files under docs/ with git add -N (intent-to-add) first so new generated docs also fail the check, while keeping the compact-summary diff output.
sosheskaz
left a comment
There was a problem hiding this comment.
AI review: Requesting changes because this introduces a false negative for deleted generated docs.
git add -N docs/ stages deletions of tracked files under docs/. The following unstaged git diff --compact-summary --exit-code therefore returns success when make generate deletes a tracked docs page. I reproduced this in an isolated repository: after the command, git status --short showed D docs/tracked.md, the unstaged diff exited 0, and the cached diff exited 1.
Please preserve deletion detection while registering untracked files. The narrow change git add -N --ignore-removal docs/ did so in the same test: new files remained visible to the unstaged diff, while deleted tracked files were not staged and also caused it to fail.
The original changes PR #345 hadn't included the generated docs changes and the
generatecheck still succeeded:https://github.com/coreweave/terraform-provider-coreweave/actions/runs/28622006850/job/84879970255?pr=345
Since
git diff --exit-codeonly reports changes to tracked files, the generate job passed even when 'make generate' created brand-new docs pages that were never committed (e.g. PR #345'sdocs/resources/object_storage_bucket_inventory.md).
This registers untracked files under docs/ with git add -N (intent-to-add) first so new generated docs also fail the check, while keeping the compact-summary diff output.