Skip to content

ci(test): fail generate check on untracked generated files - #352

Open
scotchneat wants to merge 1 commit into
mainfrom
cg/fix-generate-check-untracked
Open

ci(test): fail generate check on untracked generated files#352
scotchneat wants to merge 1 commit into
mainfrom
cg/fix-generate-check-untracked

Conversation

@scotchneat

Copy link
Copy Markdown
Contributor

The original changes PR #345 hadn't included the generated docs changes and the generate check still succeeded:
https://github.com/coreweave/terraform-provider-coreweave/actions/runs/28622006850/job/84879970255?pr=345

Since git diff --exit-code only 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's
docs/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.

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.
Copilot AI review requested due to automatic review settings July 13, 2026 13:27
@scotchneat
scotchneat requested a review from a team as a code owner July 13, 2026 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@sosheskaz sosheskaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

3 participants