discussions icon indicating copy to clipboard operation
discussions copied to clipboard

Add policy to align engines fields with ci

Open UlisesGascon opened this issue 1 year ago • 2 comments

  • closes: https://github.com/expressjs/discussions/issues/286
  • related: https://github.com/expressjs/discussions/issues/285

UlisesGascon avatar Oct 22 '24 19:10 UlisesGascon

we need a note in here about the possibility of continuing to run CI in older unsupported node versions so we know if/when a change clearly breaks back-compat. (we do this for express itself, for example)

I'll try to come up with good wording for this

ctcpip avatar Nov 05 '24 18:11 ctcpip

ping @ctcpip

UlisesGascon avatar Mar 03 '25 21:03 UlisesGascon

If a thing worked before, and stops working, it's a breaking change. Adding engines can be a breaking change even if it's exactly matching the previously working range, because there's tools that check for it in a graph and can fail CI.

ljharb avatar May 05 '25 15:05 ljharb

Fair, and that’s a strict take. If you have code that only runs on node 20+ or already has dependencies that restrict engines to node 20+ it seems like it should be safe to add engines documenting this.

That’s why the other option I see is deleting engines when it’s wrong. Or are you saying that’s also a breaking change to also remove engines here?

blakeembrey avatar May 05 '25 16:05 blakeembrey

I think the pragmatic thing is to see the "engines" as a best effort description at describing the intended compatibility of the code at the point of release.

If the description is out of sync with reality then either reality has to adapt to the description or the other way around.

If the change of the "engines" range can be seen as a bug fix – reality was clearly different to it – then I think it's correct to fix, else I think a new major or a widened reality is needed.

Bug fixes are always breaking for those reliant on the bugged behavior and it's always a balance of factors where it's primarily a fix or a breaking change.

voxpelli avatar May 05 '25 18:05 voxpelli

Removing engines entirely would be explicitly declaring that you support * (the documented default), so I'm not sure why that'd be desirable, but certainly that's not a breaking change.

ljharb avatar May 05 '25 18:05 ljharb

I'm not sure why that'd be desirable, but certainly that's not a breaking change.

It’s not, but it’s less desirable to try and release new major versions to fix the supported version range.

@voxpelli I agree, it’s the main point of contention. We need to document this somewhere.

blakeembrey avatar May 05 '25 18:05 blakeembrey

Notes for me summarizing while ulises talks about this bc it has been so long and I have to do this everytime:

We have engines field in our packages. We have a challenge w/ engines, the problem is if we forget to update the engines field (this has happened, I jon have done this), do we do a new major to fix the engines field? That was an open question, which has ended up being discussed in this ADR as well.

Its turned into a discussion into whether or not adding/fixing engines is always a major.

Im taking an action item to work with Ulises to caught back up on this and get a clear next step.

jonchurch avatar Oct 27 '25 18:10 jonchurch

relevant: https://github.com/jshttp/mime-types/pull/136

ctcpip avatar Nov 10 '25 19:11 ctcpip

Fixing engines is not a major if the implementation was already incompatible with the engines being excluded.

If that's the case, it's a patch! If that's not the case, then I'd suggest reconsidering changing engines in the first place :-)

ljharb avatar Nov 11 '25 08:11 ljharb