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

ci: on release check version string is the expected one #278

Merged
merged 5 commits into from
Oct 29, 2024

Conversation

eguzki
Copy link
Contributor

@eguzki eguzki commented Oct 24, 2024

What

Follow up work from #274

CI check to ensure release version in go code matches git version tag

Release version passed in by ldflag

Verification steps: create a release that should succeed.

git checkout -b release-0.7-testing ci-update-check-version-string

Run prepare release for final version v0.0.100.

make prepare-release VERSION=0.0.100 CHANNELS=stable REPLACES_VERSION=0.6.0

Verify local changes, commit, push and tag with the typo:

git add .
git commit -m "prepare-release: v0.7.0"
git tag v0.0.100 
git push origin release-0.7-testing
git push origin v0.0.100 

Verify that the build image for release tag workflow is triggered and completes for the new tag

  • Clean up
git checkout ci-update-check-version-string
git push --delete origin v0.0.100
git tag -d v0.0.100
git push --delete origin release-0.7-testing
git branch -D release-0.7-testing

Verification steps: create a release that should fail.

Let's prepare a release with a typo.

git checkout -b release-0.7-testing ci-update-check-version-string

Run prepare release for final version v0.0.200.

make prepare-release VERSION=0.0.200 CHANNELS=stable REPLACES_VERSION=0.6.0

Verify local changes, commit, push and tag with one typo: instead of tag v0.0.200 which would be the right one, tag it with v0.0.201.

git add .
git commit -m "prepare-release: v0.7.0"
git tag v0.0.201
git push origin release-0.7-testing
git push origin v0.0.201

Verify that the build image for release tag workflow is triggered and fails.

Checking CI logs

Git reference name = v0.0.201, release version = v0.0.200

So, the step named Verify git reference name matches the release version should fail.

  • Clean up
git checkout ci-update-check-version-string
git push --delete origin v0.0.201
git tag -d v0.0.201
git push --delete origin release-0.7-testing
git branch -D release-0.7-testing

Makefile Outdated Show resolved Hide resolved
@eguzki eguzki marked this pull request as ready for review October 24, 2024 10:30
@eguzki eguzki requested a review from mikenairn October 24, 2024 10:30
@eguzki eguzki force-pushed the ci-update-check-version-string branch from 5a02b09 to 8a14077 Compare October 28, 2024 21:37
@eguzki eguzki requested a review from maleck13 October 28, 2024 21:38
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
@@ -528,6 +528,9 @@ prepare-release: ## Generates a makefile that will override environment variable
$(MAKE) bundle
$(MAKE) helm-build VERSION=$(VERSION)

.PHONY: read-release-version
read-release-version: ## Reads release version
@echo "v$(VERSION)"
Copy link
Member

Choose a reason for hiding this comment

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

👍 Using the single version from the makefile makes sense to me. On release branches we set this as an override as part of the release process https://github.com/Kuadrant/dns-operator/blob/v0.6.0/make/release.mk#L7

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know :)

I think that I will bring this release.mk approach to the other projects

@eguzki eguzki added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit 2bf9520 Oct 29, 2024
15 checks passed
@eguzki eguzki deleted the ci-update-check-version-string branch October 29, 2024 13:43
@eguzki eguzki mentioned this pull request Oct 29, 2024
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