82863[TASK] Replace former extension packages using self.version
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Oliver Klee +1
- Stefan Bürk +1
- Oliver Hader +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Oliver Klee +1
- Stefan Bürk +1
- Oliver Hader +1
- core-ci +1 CI
Issues 1
Files 4
Review log 3339
Show 1014 earlier messages
-
Thomas Hohn uploaded patch set 1 02/08/24, 11:10
-
core-ci voted on patch set 1 V +1 02/08/24, 11:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52893
-
Thomas Hohn updated the commit message in patch set 2
V +102/08/24, 11:18 -
Thomas Hohn updated the commit message in patch set 3 02/08/24, 11:19
-
Andreas Kienast commented on patch set 3 CR -1 02/08/24, 11:21
We have multiple composer.json files with `replace` sections, please adjust them too. -
core-ci voted on patch set 2 V +1 02/08/24, 11:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52894
-
core-ci voted on patch set 3 V +1 02/08/24, 11:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52895
-
Thomas Hohn commented on patch set 3 02/08/24, 11:36
Reply
I could only find these occurrences - where else? -
Andreas Kienast commented on patch set 3 02/08/24, 11:41
Reply
in main * `sysext/backend/composer.json` * `sysext/info/composer.json` * `sysext/workspaces/composer.json` -
Thomas Hohn uploaded patch set 4
CR -1V +102/08/24, 11:47 -
core-ci voted on patch set 4 V +1 02/08/24, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52899
-
Oliver Klee voted on patch set 4 V +1 02/08/24, 11:58
-
Thomas Hohn commented on patch set 4 02/08/24, 12:00
Reply
Get it now :-) - so ALL occurrences ;-) -
Thomas Hohn commented on patch set 4 02/08/24, 12:00
Reply
Done
-
Oliver Klee voted on patch set 4 CR +1 02/08/24, 12:13
-
Benjamin Franzke updated the commit message in patch set 5
CR +1V +102/08/24, 13:31 -
core-ci voted on patch set 5 V +1 02/08/24, 13:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52908
-
Oliver Klee voted on patch set 5 CR +1 V +1 02/08/24, 14:00
-
Morten Pless voted on patch set 5 V +1 02/08/24, 14:31
-
Morten Pless voted on patch set 5 CR +1 02/08/24, 14:31
-
Stefan Bürk voted on patch set 5 CR -1 02/09/24, 06:54
-
Stefan Bürk commented on patch set 5 CR -2 V -1 02/09/24, 08:58
Using `self.version` for the replaces is not usable for us. The answer from `Ocramius ` in the linked issue is a generic answer, and valid for a monorepo metapackage + splitt package style, for example what symfony provides. The TYPO3 has not such a approach. This change would render the `replaces` use-less from the original attempt. The attempt is, to silently replaces outdated/removed split packages with another image so an update simply works even if the old package is contained in the project/extension composer.json directly. For example, having a (simplified) ```json { "require": { "typo3/cms-core": "^10.4", "typo3/cms-about": "^10.4" } } ``` and a upgrade will be done using: ``` composer require "typo3/cms-core":"^13" ``` the death stare would remove the dedicated package due to the replace. With `self.version` it will complain with following errors: ``` Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - typo3/cms-about v10.4.0 requires typo3/cms-core 10.4.0 -> satisfiable by typo3/cms-core[v10.4.0] from composer repo (https://repo.packagist.org) but typo3/cms-core[13.1.x-dev] from path repo (../../typo3/sysext/*) has higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.org/repoprio for details and assistance. - typo3/cms-about v10.4.1 requires typo3/cms-core 10.4.1 -> satisfiable by typo3/cms-core[v10.4.1] from composer repo (https://repo.packagist.org) but typo3/cms-core[13.1.x-dev] from path repo (../../typo3/sysext/*) has higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.org/repoprio for details and assistance. .... +xxx similar errors ``` Even if following is used: ``` composer require "typo3/cms-core":"^13" "typo3/cms-about":"^13" ``` the current state would silently replace it where as the new thing would badly fail with a long list of errors. Sadly, most developers out there never really learned composer correctly and is not firm would really be confused and comming into cms channel asking for support. Just documenting it would not really help as they would not search for such things. The pinpoint here is, that there will not be a package version for the removed version in packagist meta-data matching the same version like the other packages. Therefore, I put a -2 on it for now to discuss this honestly. We should first discuss this deeply if we really want to have the change in behaviour towards a badly failing one and drastically making the `User eXperience` a multidude worser. Note: this can be simply tested with following steps (with and without this change: ``` cd Build/composer/ && \ rm -rf public vendor composer.json composer.lock && \ cp composer.dist.json composer.json && \ composer require --no-update --no-install \ "typo3/cms-about":"^10.4" && \ composer install && echo '>> success - yeah !' || echo '>> failed - bad' ``` -
Thomas Hohn commented on patch set 5 02/09/24, 09:04
Reply
The I suggest that we instead put these packages into the conflicts section - since they should no longer be used - I guess we could leave 11+12 as is and then update the main branch? -
Stefan Bürk commented on patch set 5 02/09/24, 09:09
Reply
conflict: this package conflicts with another replace: this package replaces another which means, that the replace is IMO correct as the extensions are not simply removed, but code moved to the extension which replaces the removed one. Using replace is exactly there for this use-case. I pinged helmut on this for his opinion and I want to get more thoughts of some (core) people on this and avoid a quick change. -
Stefan Bürk commented on patch set 5 02/09/24, 09:23
Reply
Additional note: This is not only about a direct replacement. For example, if a 3rd party extension is used which has not changed that in the require's the replace ensure everything is runnable. Using conflict will block this at least on the root level but even more on a dependency chain level which **may not be solvable** by our casual composer users (taken the questions and shown experiences in the community) -
Benjamin Franzke commented on patch set 5 02/09/24, 09:43
Reply
Hey Stefan, please see https://typo3.slack.com/archives/C0K5MU94J/p1707390275264979?thread_ts=1707381626.573329&cid=C0K5MU94J `self.version` is fine, since installing `about` in with `^10.4` is not a priority for us. `replaces` has one usecase: An extension needs to be able to support multiple major versions and thus being able to define: ``` "typo3/cms-about":"^10.4 || ^11.5 || ^12.4" ``` This usecase is covered by `self.version` and that's actually the job of the `replaces` section. Yes, an extension that support v13 and did only define `"typo3/cms-about":"^10.4"` needs to be fixed, that is true – but that is better than not being able to install TYPO3 with `roave/security-advisories` enabled at all. We need to merge this in order to allow proper updates on Tuesdays release, in case https://github.com/github/advisory-database/pull/3488 is not merged and imported into `roave/security-advisories`. Please rethink you vote ;) -
Stefan Bürk commented on patch set 5 CR 0 V 0 02/09/24, 10:48
Reply
"typo3/cms-about":"^10.4 || ^11.5 || ^12.4" would also fail because there is no ^11.5 version which can be replaced with another package using self.version. Literally the replace is superflous at all in that case and could be removed at all --- ending in similar errors and no need for a maintaining on our side. The mentioned use-case for replace only works with the death-star. But I'm unblocking this for now. TBH this makes it worser at all. Should really be rehtought how we deal in the future with such sysextenion mergings as the replace is not a solution anymore to provide a seemles approach. If it is considered it should fail we don't need the replace at all (for the packages, monorepo is another usecase ). replace.self-version says, that the extension in current version replaces the packages in the exact same version (which does not exists in that version). So really consider to remove the replaces than which has the same outcam as using self.version. -
Oliver Hader voted on patch set 5 CR +1 02/09/24, 11:01
-
Oliver Hader commented on patch set 5 V +1 02/09/24, 11:08
* `composer require typo3/cms-core:13.x@dev typo3/cms-saltedpasswords:^9.5` → fails now, as expected * `composer require typo3/cms-core:13.x@dev typo3/cms-saltedpasswords:13.x@dev` → still works, due to `self.version`, as expected -
Oliver Hader commented on patch set 5 CR -1 02/09/24, 11:09
`13.0` missing -
Oliver Hader updated the commit message in patch set 6
CR +1V +102/09/24, 11:09 -
Oliver Hader voted on patch set 6 CR +1 V +1 02/09/24, 11:09
-
Benjamin Franzke commented on patch set 6 CR +1 V +1 02/09/24, 11:15
Reply
> "typo3/cms-about":"^10.4 || ^11.5 || ^12.4" would also fail because there is no ^11.5 version which can be replaced with another package using self.version. No, typo3/cms-core qualifies itself as 12.4.8 with `self.version` (when it's current version is 12.4.8), that means for composer there *is* a 12.4.8 available. I build a minimal demo to show that it works: https://github.com/bnf/composer-replace-self-version-test -
core-ci voted on patch set 6 V +1 02/09/24, 11:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/52949
-
Benjamin Franzke voted on patch set 6 CR +2 V +2 02/09/24, 11:19
-
Oliver Klee voted on patch set 6 CR +1 V +1 02/09/24, 11:26
-
Benjamin Franzke commented on patch set 6 02/09/24, 11:29
Reply
We're very confident that this is the correct fix and therefore I'm going to merge now. Removing `replace` is an option for 13.x (but there is still the usecase of extensions supporting multiple major versions), but as shown, in my previous comment, `self.version` allows the current usecase to work. (I agree this is a hack and a ugly-ugly workaround around the problem that composer doesn't support conditional dependencies) -
Benjamin Franzke merged patch set 7 02/09/24, 11:29
-
Stefan Bürk commented on patch set 7 CR +1 V +1 02/10/24, 12:09
Reply
Never Mind - I rechecked my test and found the error. So post+1.