[RFC] Laminas composer replace - new releases approach

Goal

All new releases under Laminas organisation can replace legacy Zend Framework components.

Background

During the migration to Laminas we have added:

"replace": {
    "zend-xyz": "self.version"
}

into composer. It means that for example release 1.7.3 of laminas-xyz replaces ONLY zend-xyz in version 1.7.3.

Now, in Laminas we have released several bugfix and new minor versions. Unfortunately we haven’t changed replace value in composer.json so it is still self.version. This is not working, because new version released under Laminas org has never been released under ZF org. It means newer releases from Laminas do not replace any ZF packages.

Suggested Approach

  1. create script to update composer.json of all Laminas components - set replace to the latest version released under ZF organisation, as an example: latest of zend-xyz is 1.7.3 ==> we need update master and develop branches so we have in composer.json:
"replace": {
    "zend-xyz": "^1.7.3"
}
  1. fix all releases under Laminas, where replace was not updated in composer.json, for example:
  • latest zend-xyz is 1.7.3,
  • we have released laminas-xyz 1.7.4 and 1.8.0 ==> we should issue two new releases: 1.7.5 and 1.8.1; both with:
"replace": {
    "zend-xyz" : "^1.7.3"
}
  1. we should remove replace from composer.json for next major releases of Laminas components.

This would be for new releases, correct?

If so, this should be fine, as we follow semver. I’d like other TSC members to comment, though.

I would prefer replace to be for "^1.7" rather than specific patch version. Otherwise I agree, this is the only proper approach that will ensure access to the latest bug fixes

That’s problematic from a QA perspective. If the project tests using --prefer-lowest, they’d now potentially get an earlier version than they previously allowed.

It is a very valid point. Users reported QA issues around --prefer-lowest with patched versions and it was quite inconvenient effect on CI.

All packages are now updated and new releases has been issued.

2 Likes