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

script: Update version check in Rolling release binary upload script to exclude '-dev' versions #903

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

DeeDeeG
Copy link
Member

@DeeDeeG DeeDeeG commented Jan 30, 2024

Identify the Bug

The Rolling Release upload script trusts CI to either give it a clean Regular version, e.g. v1.113.0, or a long, timestamped, Rolling version, e.g. v1.113.2024013003.

If someone (me) messes up the CI to where the version in package.json of the repo is somehow still e.g. v1.113.0-dev when the script is run (as I accidentally did in #858), the upload script will attempt to upload a binary based on this not-Rolling-style version string, setting up a tag on the rolling release binaries repo that shouldn't be there, and which potentially keeps getting overwritten multiple times due to the aforementioned (hypothetical, but also presently real) CI screw up persisting on master branch and running again after each PR lands, which I may have hypothetically, but definitely did practically, cause with #858.

Description of the Change

Teach the Rolling release binary upload script to recognize rogue "-dev" version strings that should not be uploaded, and not upload if those version strings are encountered (much like we already correctly do for well-formed Regular release version strings).

Alternate Designs

Maybe I should actually have the script exit with exit code 1 to have CI error, since this isn't a situation we should be in, attempting to upload bins without a proper version number, which screws with our Rolling release repo.

Yeah, maybe I'll go do that instead. Gonna open this as draft, because I need sleep.

Possible Drawbacks

Verification Process

Worked in local testing with a v1.113.0-dev version string.

Script now properly rejects this, instead of over-trustingly assuming it must be a proper Rolling version since "it's not short enough to be a Regular release version."

Any further verification is TBD. Looks like it's working. See: #903 (comment)

Release Notes

Tweak Rolling release binary upload script to reject -dev version strings, as it should.

These should be rejected as not Rolling versions.
@DeeDeeG DeeDeeG changed the title script: Update check to exclude '-dev' versions script: Update version check in Rolling release binary upload script to exclude '-dev' versions Jan 30, 2024
@DeeDeeG
Copy link
Member Author

DeeDeeG commented Feb 6, 2024

This worked!

According to our version: 1.113.0-dev this is not a rolling release...
Exiting without changes...

https://github.com/pulsar-edit/pulsar/actions/runs/7794998778/job/21257862924#step:7:33

Looking good to me, and ready for review.

@DeeDeeG DeeDeeG marked this pull request as ready for review February 6, 2024 06:00
@DeeDeeG DeeDeeG force-pushed the pulsar-rolling-script-version-check-tweak branch from cb0a56a to 5b58255 Compare February 6, 2024 06:03
Copy link
Member

@confused-Techie confused-Techie left a comment

Choose a reason for hiding this comment

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

LGTM! A very smart addition to this script here to help prevent rogue behavior like we saw. Love it, lets get it merged

@DeeDeeG DeeDeeG merged commit ca8ee62 into master Feb 6, 2024
205 checks passed
@DeeDeeG DeeDeeG deleted the pulsar-rolling-script-version-check-tweak branch April 19, 2024 16:51
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.

2 participants