-
Notifications
You must be signed in to change notification settings - Fork 47
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
Mark release as beta #73
Conversation
if (isset($options['beta'])) { | ||
$beta = $options['beta']; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else should be on the previous line
@jeanmonod can you have a look? |
I'm working on better solution discussed in in issue #71, and about else in new - i did it like this because this is standard in current library code. |
@acrobat, @jeanmonod, @lsmith77 - this should be much better, i don't know if it's easy to understand for every one. Help with code organization (if(){}else{}) would be great. |
Looks good! 👍 But with this change it should be different
In this case you should go from 0.0.1-alpha to 0.0.1-alpha2 because a label with no digit behind it, is always -_label_1 I'm going to take a look at the if/else code for label checking! |
@acrobat and this works like you said. My description was wrong. |
Test It in action please. |
oh ok, great! Yes i'm going to take a checkout of this branch and test it! |
I've just use this branch version of RMT and it works good, alpha and beta get the correct numbers behind it if multiple versions of label! But there is are some problems with the RC label.
Maybe it's a good idea to add some tests for the new label option and versions with labels |
Looks like wrong regex for version. I will look at It. I will try also with tests. |
if (isset($options['label'])) { | ||
$label = $options['label']; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else needs to be on the previous line :)
can't you also use https://github.com/vierbergenlars/php-semver for parsing? |
@lsmith77 i will fix cs with next commit + missing test, I use vierbergenlars/php-semver for versions comparison. About rc label problem - it must be wiath small letters, vierbergenlars/php-semver don't recognize 'RC' properly - works perfectly with 'rc' - so question is - should i leave it with small letters or try to find how to fix it with big letters? |
I think it's ok to use lowercase rc, it looks like it doesn't matter much because symfony tags it's pre-release (alpha, beta, rc) with all uppercase. So it's just a standard you agree on i think! |
$patch = substr($patch, 0, strpos($patch, "-")); | ||
|
||
return implode(array($major, $minor, $patch), '.').'-'.$label.$labelVersion; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the following code does not need to be in an else, since the if statement before ends with a return
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that being said .. seems like the end of the if statement could be refactored to no longer contain duplicate code in the else clause
beta_releases add missing option
// if label is new clear version | ||
if ($label !== $oldLabel) { | ||
$labelVersion = false; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be an elseif now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
@acrobat it's ready to merge. |
great, nice work! But i think we should ping @lsmith77 @jeanmonod for the merge |
👍 |
Thanks for help guys! |
…the label management. Most of the users were currently not using the label system, so forced them to always answer 'none' could be painful. To activate it on your project (or a dedicated branch) just add 'allow-label' in your config
Hi guys, First thanks you all for taking care of this. I was in holidays those last weeks, so not very present on the subject. |
👍 thanks @jeanmonod! |
Fix for #71.
How it work?
label
. It have 3 choices (RC, beta, alpha, none). If none is choosen then new version will be without label.example workflow:
Any help with this is welcome.