Skip to content

Conversation

@cjcocokrisp
Copy link
Contributor

Overview

The following PR improves the registry-scanner/hack/create-release.sh with the following:

  • Switching to annotated tags instead of using lightweight tags
  • Automatically push the changed VERSION file in addition to the new tag to remote
  • Added some usage examples to the header
  • Improved help messages for missing arguments

I also noticed that the VERSION file's contents was 0.111.0. Not sure if this was intentional because the tag listed is 0.1.0. I changed the file to match the tag. If it should stay 0.111.0, I can revert the change.

Testing:

The below screenshots show the testing that I did to validate that my changes functioned properly.

The output of git tag -n registry-scanner/* after running ./hack/create-release.sh TEST HelloHello and ./hack/create-release.sh TEST2 HelloHello2:
Screenshot 2025-06-03 at 3 04 31 PM

The commits and tags in the remote after running those two commands above:
Screenshot 2025-06-03 at 3 05 52 PM
Screenshot 2025-06-03 at 3 06 28 PM

The error messages output if you are missing either the TARGET_VERSION or MESSAGE arguments:
Screenshot 2025-06-03 at 3 08 33 PM

…o annotated tags, automatically pushing updated VERSION file, and adding some examples

Signed-off-by: Christopher Coco <[email protected]>
@cjcocokrisp cjcocokrisp force-pushed the chore/improve-registry-scanner/hack/create-release.sh branch from 823714e to c8d07ef Compare June 3, 2025 20:18
@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.34%. Comparing base (975081e) to head (d78e85f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1157   +/-   ##
=======================================
  Coverage   63.34%   63.34%           
=======================================
  Files          15       15           
  Lines        2357     2357           
=======================================
  Hits         1493     1493           
  Misses        769      769           
  Partials       95       95           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -1 +1 @@
0.111.0
0.1.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

# `./hack/create-release.sh 0.1.X "TEST"` origin Would create a new tag "registry-scanner/v0.1.X" with
# the message "TEST" and edit VERSION to be 0.1.X which
# would be committed. The contents would be pushed to the
# remote "origin."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having a message gives more control for users to custom a tag and commit message, but at the same time also makes it slightly harder to run this command. I think the tag and commit message are pretty standard, using the tag name should suffice.

#if [[ ! "${CURRENT_BRANCH}" == registry-scanner/release-* ]]; then
# echo "!! Please checkout branch 'registry-scanner/release-X.Y' (currently in branch: '${CURRENT_BRANCH}')" >&2
# exit 1
#fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

the above validation is useful and should be preserved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops forgot to uncomment when I was testing 😅


# Commit updated VERSION file
git add VERSION
git commit -s -m "automated: bump VERSION file to version ${TARGET_VERSION}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should use the conventional commit message: "Release ${NEW_TAG}"

# Create tag for registry-scanner
git tag "${NEW_TAG}"
git push "${REMOTE}" tag "${NEW_TAG}"
git tag -a "${NEW_TAG}" -m "${MESSAGE}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

message can be the same as ${NEW_TAG}

git tag "${NEW_TAG}"
git push "${REMOTE}" tag "${NEW_TAG}"
git tag -a "${NEW_TAG}" -m "${MESSAGE}"
git push "${REMOTE}" --follow-tags #tag "${NEW_TAG}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

the trailing comment seems redundant.

since we're usually directly pushing to upstream, I'd like to be specific about which tags and branches, something like:

git push "${REMOTE}" ${RELEASE_BRANCH} ${NEW_TAG}

Will that achieve the same effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That flag prevents you from needing to do a git push for the VERSION file commit and then needing to do another git push to commit the tag. It can be split up no problem but I left the comment as a note of what was originally was there. Which would be preferred the two separate pushes or just the one?

…t branch check, seperate push of commit and tag, and update tag message

Signed-off-by: Christopher Coco <[email protected]>
@cjcocokrisp cjcocokrisp force-pushed the chore/improve-registry-scanner/hack/create-release.sh branch from 7081583 to a16276e Compare June 4, 2025 13:45
@chengfang chengfang enabled auto-merge (squash) June 4, 2025 15:30
@chengfang chengfang merged commit 338bc33 into argoproj-labs:master Jun 4, 2025
9 checks passed
@cjcocokrisp cjcocokrisp deleted the chore/improve-registry-scanner/hack/create-release.sh branch June 4, 2025 17:28
cjcocokrisp added a commit to cjcocokrisp/argocd-image-updater that referenced this pull request Jun 18, 2025
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