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

Picking last minor release vs. the last release #307

Closed
ondrejmirtes opened this issue May 28, 2021 · 18 comments
Closed

Picking last minor release vs. the last release #307

ondrejmirtes opened this issue May 28, 2021 · 18 comments
Assignees
Milestone

Comments

@ondrejmirtes
Copy link

Hi,
I just noticed an oddity in the logic - the tool compares current HEAD against the last minor release, meaning even if there's 2.2.5, it will compare HEAD against 2.2.0.

I think this will lead to not noticing BC breaks between patch versions.

Let's say I add a new method in 2.2.1. Because the method does not exist in 2.2.0, the tool will consider it as a new method in the current HEAD when getting ready to release 2.2.5. Which means that if I add a new required argument between 2.2.4 and 2.2.5, I just caused a BC break for users that started relying on the method meanwhile (between 2.2.1 and 2.2.4).

I know that patch versions are for bugfixes only, but I can imagine a scenario where adding a new method can be interpreted as part of a bugfix...

Is there something I'm not seeing? Thanks!

@Ocramius
Copy link
Member

Because the method does not exist in 2.2.0

This should IMO have been where the new API method is introduced?

@Ocramius
Copy link
Member

Reading the whole thing, I think it makes sense to compare BC against the latest patch, instead of the latest minor.

The initial idea I had when developing this library is that:

  • new features are developed in new minors
  • those new minors need to be protected against BC

In fact though, if BC is incrementally maintained between patch releases too, that shouldn't be a problem.

@ondrejmirtes
Copy link
Author

Yeah, I guess I'd sleep calmer if HEAD was always compared against the latest release, be it major, minor, or even patch :)

ondrejmirtes added a commit to ondrejmirtes/BackwardCompatibilityCheck that referenced this issue May 28, 2021
@asgrim
Copy link
Member

asgrim commented May 29, 2021

Maybe make it an option? --compare-against-latest-patch, --compare-against-latest-minor, etc.?

@Ocramius
Copy link
Member

Ocramius commented May 29, 2021 via email

@Ocramius Ocramius added this to the 6.0.0 milestone Jun 6, 2021
@Ocramius
Copy link
Member

Ocramius commented Jun 6, 2021

I'm targeting this for 6.0: it's a behavioral change that is worth a BC break.

@Ocramius
Copy link
Member

Ocramius commented Nov 5, 2021

Not going to be able to drag this into 6.0 - removing milestone for now.

@Ocramius Ocramius removed this from the 6.0.0 milestone Nov 5, 2021
@Ocramius
Copy link
Member

Looking back at this, I can imagine that:

  • roave/backward-compatibility-check is generally used in CI, to verify pull requests
  • merging a red PR from a contributor will lead to all subsequent PRs going red, until a new minor release is cut
  • the idea is to check BC from patch to patch

I suggest changing the defaults of this library from checking the latest minor release to checking the base of the current PR (which will probably require looking at the current environment variables, probably), or HEAD^1, should that fail.

@Ocramius Ocramius added this to the 7.0.0 milestone Jan 20, 2022
@Ocramius Ocramius removed the question label Jan 20, 2022
@asgrim
Copy link
Member

asgrim commented Jan 20, 2022

merging a red PR from a contributor will lead to all subsequent PRs going red, until a new minor release is cut

Yes, I observed this where I'm using roave/backward-compatibility-check; I figured it was desirable, but I can see why it's not ideal for others.

@Ocramius
Copy link
Member

Yup, and also, nothing denies providing a --from= manually, allowing for consumers to always pick their own approach.

@Ocramius Ocramius removed this from the 7.0.0 milestone Mar 31, 2022
@Ocramius
Copy link
Member

I removed the milestone for now, since I released 7.0.0 just to get another BC break out of the door, for now.

ondrejmirtes added a commit to ondrejmirtes/BackwardCompatibilityCheck that referenced this issue Sep 27, 2022
ondrejmirtes added a commit to ondrejmirtes/BackwardCompatibilityCheck that referenced this issue Oct 17, 2022
@michael-rubel
Copy link
Contributor

michael-rubel commented Nov 7, 2022

Hey @Ocramius, can we change this tool to pick the latest release? There's a case, for example, when methods were added to a class by mistake (from a trait) and weren't meant to be used in the class at all. Looking from a clear technical perspective, this is of course a BC break, but looking from practical usage, the methods are meaningless and can be fixed (removed) in a patch.

@Ocramius
Copy link
Member

Ocramius commented Nov 7, 2022

@michael-rubel see #307 (comment)

Feel free to send a patch for the next major.

@michael-rubel
Copy link
Contributor

@Ocramius looks like @ondrejmirtes already done that in his fork. Should I resubmit that as a separate PR?

@Ocramius
Copy link
Member

Ocramius commented Nov 7, 2022

Sure 👍

@michael-rubel
Copy link
Contributor

@Ocramius done in: #687

Not sure the target branch is right, but I haven't found the 8.0.x.

@Ocramius
Copy link
Member

Ocramius commented Nov 8, 2022

I'll change the target branch before merging :)

@Ocramius Ocramius added this to the 8.0.0 milestone Nov 13, 2022
@Ocramius
Copy link
Member

Handled in #687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants