-
Notifications
You must be signed in to change notification settings - Fork 60
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
[WIP] - Inform when there is no minor version #668
base: 8.0.x
Are you sure you want to change the base?
Conversation
@@ -24,6 +24,10 @@ public function assert(Version $version): bool | |||
return ! $version->isPreRelease(); | |||
} | |||
}); | |||
|
|||
if ($stableVersions->isEmpty()) { | |||
throw new \Exception('Your library does not have any minor version'); |
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.
Is a crash really the best approach? Perhaps it should be "green" when no BC breaks are detected instead?
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.
Thanks for the feedback. That's why I kinda put it as a draft with WIP. And yes when there is no stable version - there won't be any BC breaks. Note or Info message could be applied.
Stay tuned 😄
if ($stableVersions->isEmpty()) { | ||
$stdErr->writeln(Str\format('Your library does not have any stable versions. Therefore cannot have BC breaks.')); | ||
|
||
return Command::SUCCESS; |
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.
I just realized another problem, sorry @_@
Assume somebody incorrectly installs this tool with a CI setup that did not pull tags during clone operations (shallow clone: default on github), this leads to an exit code zero by default, hiding the underlying problem.
Perhaps an exception or non-zero exit code was really the best approach.
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.
Actually, maybe we can kill two birds with one stone. One is a misconfiguration which we could verify and the second is an exception :)
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.
One is a misconfiguration which we could verify
How do we verify it, if no git fetch
has occurred? 🤔
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.
Isn't that...
No tags -> possible misconfiguration so we can throw an exception. Like. THERE ARE NO TAGS. WE NEED THEM (yes, we gonna scream 😄)
Then at some point, we can assume that there are at least some tags (we verified that by the previous action), but we want to check out the stable ones. There are tags, but none of them are stable. Return success.
What do you think?
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.
THERE ARE NO TAGS. WE NEED THEM (yes, we gonna scream smile)
Works for me - indeed the tool cannot do auto---from=
without tags.
Then at some point, we can assume that there are at least some tags (we verified that by the previous action), but we want to check out the stable ones. There are tags, but none of them are stable. Return success.
Good enough :-)
I had probably the edge-case when my library had no minor versions. Only preleases. I was getting information that there are no versions at all. Which is false. There are versions. I would like just to improve the DX and show the proper message :)