operator-controller
operator-controller copied to clipboard
Add a CI check to make sure that pull requests are not missing `make generate`
We need a check for PRs to make sure that we generate all the generated code and yamls as part of a PR.
Just need to add manifests to this target's dependencies?
https://github.com/operator-framework/operator-controller/blob/fd7cfb57680c3949d7317a4ad4c33dc7a42f09d5/Makefile#L82
CI already runs make verify as part of the sanity workflow.
@joelanford you are right we already have verify which runs git diff --exit-code and we can add manifests as a dependency.
However git diff --exit-code will only produce non-zero exit code if there is a diff in tracked files and it will miss cases when working copy is dirty due to new untracked files as result of code generation.
I think we need something like [[ -z "$(git status -s)" ]] instead.
/assign rashmi43
The make verify command runs make generate, and if the generated result differs from what was previously committed, it fails. This check ensures consistency. Given that, I will close this issue. However, if anyone sees a reason to reopen it, please feel free to do so.
@camilamacedo86 I think this issue is still valid. While verify target now has manifests as dependency it still uses git diff --exit-code which doesn't account for files not tracked by git (e.g. new files generated). See https://github.com/operator-framework/operator-controller/issues/348#issuecomment-1688129085 for a potential solution.
It is probably an edge case, but it is something I noticed while working on operator-controller and that's why I created this issue originally.