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

Project management: Fix milestone version selection when RC is included in version #16084

Merged
merged 1 commit into from
Jun 11, 2019

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Jun 11, 2019

Description

The current version of the plugin is 5.9-rc.1. This causes that Milestone it action creates Gutenberg 5.10 milestone where it should create Gutenberg 6.0. I fixed manually some of the latest PRs merged to be assigned to the correct milestone but we need to fix in in the actions as well.

@gziolo gziolo added the [Type] Project Management Meta-issues related to project management of Gutenberg label Jun 11, 2019
@gziolo gziolo requested a review from aduth June 11, 2019 05:16
@gziolo gziolo self-assigned this Jun 11, 2019
@@ -29,7 +29,7 @@ minor=${parts[1]}

# 3. Determine next milestone.

if [ minor == '9' ]; then
if [[ $minor == 9* ]]; then
Copy link
Member Author

Choose a reason for hiding this comment

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

I followed: https://stackoverflow.com/a/2172367

I know little about bash :)

Copy link
Member

@noisysocks noisysocks left a comment

Choose a reason for hiding this comment

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

👍 looks good! Using [[ syntax here is okay because our shebang is #!/bin/bash and not #!/bin/sh.

@aduth
Copy link
Member

aduth commented Jun 11, 2019

Hmm, it's strange to me that it'd be doing this, or at least that the proposed changes would have any impact.

It should be reading from package.json and splitting on the dots, so 5.9.0-rc.1 should split to a major of 5, a minor of 9, and 0-rc.1 is effectively (or at least meant to be) thrown away.

I'm also (pleasantly?) surprised the action has been working, since previously I'd been having issues with it always being "Cancelled".

@aduth
Copy link
Member

aduth commented Jun 11, 2019

Or maybe it does fix the issue, but not because of the wildcard, and instead because of the difference between [ and [[, which clearly I did not understand. Or at least according to the following, the == operator is documented to not exist in "old test" [, but does exist in "new test" [[.

http://mywiki.wooledge.org/BashFAQ/031

Edit: Though, according to this one, they should be the "same" 😅

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Okay, I get it now. The key is changing minor to $minor. Maybe my floundering is obvious to you as the author 😄 It seems it is the only necessary change, but I suppose there's no harm in the other (single to double square brackets, wildcard comparison).

@gziolo
Copy link
Member Author

gziolo commented Jun 11, 2019

It should be reading from package.json and splitting on the dots, so 5.9.0-rc.1 should split to a major of 5, a minor of 9, and 0-rc.1 is effectively (or at least meant to be) thrown away.

Hmm, I no longer know if this is something that will fix the issue then. I tested it against 5.9-rc.1 and assumed that the issue comes from the fact that it reads minor as 9-rc but it looks like it should be 9 in this case:
https://github.com/WordPress/gutenberg/blob/master/package.json#L3

@aduth
Copy link
Member

aduth commented Jun 11, 2019

Hmm, I no longer know if this is something that will fix the issue then. I tested it against 5.9-rc.1 and assumed that the issue comes from the fact that it reads minor as 9-rc but it looks like it should be 9 in this case:
https://github.com/WordPress/gutenberg/blob/master/package.json#L3

That's not the fix, but these changes do resolve the issue. The issue comes from the fact that minor (vs. the resolved $minor variable value) will never equal 9, so it will always fall to the else case and bump the minor. This is why it created 5.10.0 instead of 6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Project Management Meta-issues related to project management of Gutenberg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants