-
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
Compare with last tag on the same branch as the target branch #268
Comments
Hmm, yeah, implementing this sounds like a good addition, but here's another scenario that IMO should be considered:
It's a bit more blurry in this case, since the tool doesn't know about the branching mechanism at all. We can most certainly try to make a convention, but it needs to be quite verbose in the output. |
I'm not sure I see the issue, that must be because I don't know how the tool works well enough. |
That's only if your CI simulates merges |
Doesn't it always do that? By the way, we say it's the CI, but I think it is in fact Github that simulates the merge before passing it on to the actual CI system (Travis, Github Actions, Appveyor, etc.). the docs about pull request events seems to say it always does that since |
In pull requests, the commit is verified AFAIK, not the merge. Anyway, it is still an assumption, not the actual reality: the CLI tool should generally stay agnostic from this assumption. Getting the closest tagged ancestor from a specific patch seems valid, but is a problem if the merge target has different ancestors. |
Please check, I have always observed the opposite, the commit under test I have observed is always
True. What about this: if the verified commit is not a merge commit, behave as usual, otherwise use the behavior described in this PR. The contributor may still push a merge commit to their branch, but in that case I think the behavior would still be sensible: the tool would probably pick a parent and follow the ancestry until a tag. UPD: an extra check might be to compare the commit under test with the last commit on the branch. If it's a merge commit and it is not the same commit, then the assumption that it is a test merge is reasonable IMO. Another way to this properly could be to make the behavior configurable somehow. |
As it currently stands, the list of tags is sorted and iterated upon: BackwardCompatibilityCheck/src/Git/GetVersionCollectionFromGitRepository.php Lines 30 to 32 in 2eae3f7
What we could do is do a The default behavior doesn't really consider the current checked out REF at all, unless provided. |
|
Yes, but needs to be controlled by new parameter, which is the more complicated bit |
Isn't it simpler to have each base branch using |
Looking back at this, I must say that |
Here's an example of how to solve this using GH actions: https://github.com/lcobucci/jwt/pull/534/files#diff-828df298ab61cb562c901dd8bd15d49b8e7023ba87e3e60a6b1a06eefe252fd8 |
Works for me, I'm ok for closing this if you are. |
Gonna close here then: example is succinct. If you want, send a patch with docs, if relevant. |
Right now it detects that the last version is… 3.0.0, which is confusing.
I believe this could be done by detected what branch the commit being tested is based on. On most CI systems, the commit being tested is the result of a merge between the target branch and the last commit on PR. This means that the detection can be performed easily by looking at the parent commits, provided they are fetched, which implies doing stuff like this (example with Github Actions):
The text was updated successfully, but these errors were encountered: