agones icon indicating copy to clipboard operation
agones copied to clipboard

Fail CI if a PR updates an example without modifying the version

Open zmerlynn opened this issue 1 year ago • 5 comments

If someone modifies anything in examples/foo, there should be a corresponding change to the version := line in the Makefile. This should be easy to catch in CI. This would catch some of the common cases like #3793 (which should have been flagged), and also fail Dependabot PRs against examples/ early.

If we want to get fancy, there's technically files like README.md that can be ignored in every directory.

zmerlynn avatar Apr 19 '24 16:04 zmerlynn

@zmerlynn, The version value in the Makefile should be incremented only if there are any changes in the following files: main.go, Dockerfile, Dockerfile.windows, go.mod, and go.sum.

The following files can be ignored: *.md, *.yaml, *.pb, *.tpl, *.tf, *.csproj, *.cs, *.txt, *.cc, OWNERS, *.json, .gitignore, *.toml, *.sh, *.xml, *.meta, *.asset.

Please let me know if I have included any files in the ignored list by mistakenly.

Kalaiselvi84 avatar May 03 '24 04:05 Kalaiselvi84

I would tend towards to a denylist but make it less broad. In particular, things like .sh, .toml, .asset, .csproj are all part of the build, so maybe ignore: *.md, *.yaml, OWNERS, .gitignore

In addition, if you want you can add to each of the version files (probably right above the version or on the same line?) a comment line # Change this to ignore the version change presubmit: XYZ. Basically, show the user some way if they trip the presubmit to have it ignored, and an easy way is a line that will show up in the diff.

zmerlynn avatar May 03 '24 12:05 zmerlynn

Update: I'm working on this issue and have noticed that the script should ignore comments. I'm currently looking into this.

Kalaiselvi84 avatar May 03 '24 22:05 Kalaiselvi84