Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CI check to fail on change to an example without a new version #3940

Merged
merged 5 commits into from
Nov 7, 2024

Conversation

wheatear-dev
Copy link
Contributor

@wheatear-dev wheatear-dev commented Aug 10, 2024

What type of PR is this?

/kind feature

What this PR does / Why we need it:

Further to issue #3794, if any files change within an example - outside of a simple denylist - and the version in its Makefile is not updated, this new tool will fail the CI pipeline.

Which issue(s) this PR fixes:

Closes #3794

Special notes for your reviewer:

Hi 👋

It wasn't obvious where or how to add automated tests for this script. My manual strategy was as follows:

  1. Change at least one (non-denylist) file, in two relevant examples
  2. Run the example in its directory, observing that it fails the "CI"
  3. Increase the version of one of the two examples
  4. Run the example again in its directory, observing that it still fails the "CI", but now only on one example.
  5. Ensure the version of both examples are updated
  6. Run again, and observe that it succeeds.

N.B. the above changes have to be committed each time, otherwise they are invisible to this script.

@github-actions github-actions bot added kind/feature New features for Agones size/L labels Aug 10, 2024
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 24fcaddf-62fd-422b-b2a4-8572dc67376c

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-8c50ac4

@wheatear-dev

This comment has been minimized.

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: e5c417b9-c40f-4b57-8d22-ec319d6726b5

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-9102a53

@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: afeffcd8-012a-401d-b47a-99bd40addf41

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@wheatear-dev wheatear-dev force-pushed the fail-ci-version branch 2 times, most recently from 87268c8 to 67bbc64 Compare August 29, 2024 17:52
@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: d2eabb81-1b6f-4c49-ab7e-1169fe5671c8

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@wheatear-dev wheatear-dev force-pushed the fail-ci-version branch 3 times, most recently from 31ad313 to c987444 Compare August 29, 2024 19:29
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: c8c39e0e-3256-453a-855a-c0106d81be8a

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-c987444

@wheatear-dev wheatear-dev force-pushed the fail-ci-version branch 2 times, most recently from ac9a564 to 127f2f7 Compare August 30, 2024 07:08
@wheatear-dev wheatear-dev marked this pull request as ready for review August 30, 2024 07:13
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: cf93ffd9-fcca-448e-9ae5-3f44b5255e4b

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.43.0-dev-127f2f7

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 5225d7e0-11f8-432c-986f-400657727524

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.44.0-dev-f52c415

If any files change within an example - outside of a simple denylist
- and the version in its Makefile is not updated, this new tool will
fail the CI pipeline.
@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 5eb75ed2-cd0b-4fbf-a4c5-ff4f7a551b8a

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.45.0-dev-d608862

}

func lineContainsVersion(line string) bool {
return strings.HasPrefix(line, "version")
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: better to make it stricter i.e. `strings.HasPrefix(line, "version :=")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi. 👋

Do you want me to action this change now?

You appear to be operating on this branch, and I have no desire to interfere. 😄

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah feel free to go ahead and make the change. Thanks

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 801feea7-f975-4197-bf70-9258673b2c03

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.45.0-dev-24c7d08

@gongmax gongmax enabled auto-merge (squash) November 6, 2024 23:09
@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: 39a6d2c5-0615-4e0f-bc19-81f9cd41edf4

Status: FAILURE

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: d3458c8b-95f3-4ecd-9f39-c5af277f2cee

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

git fetch https://github.com/googleforgames/agones.git pull/3940/head:pr_3940 && git checkout pr_3940
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.45.0-dev-950578f

@gongmax gongmax merged commit 10a8bca into googleforgames:main Nov 7, 2024
4 checks passed
@wheatear-dev wheatear-dev deleted the fail-ci-version branch November 7, 2024 15:21
0xaravindh pushed a commit to 0xaravindh/agones that referenced this pull request Nov 26, 2024
…oogleforgames#3940)

* Add a CI check to fail on change to an example without a new version

If any files change within an example - outside of a simple denylist
- and the version in its Makefile is not updated, this new tool will
fail the CI pipeline.

* Make prefix check for version stricter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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