[TASK] Mitigate TYPO3 v14.2 ext_emconf.php deprecation#724
Open
sbuerk wants to merge 4 commits intob13:masterfrom
Open
[TASK] Mitigate TYPO3 v14.2 ext_emconf.php deprecation#724sbuerk wants to merge 4 commits intob13:masterfrom
ext_emconf.php deprecation#724sbuerk wants to merge 4 commits intob13:masterfrom
Conversation
From time to time it could be use-full to have the ability to apply composer patches on packages, for example TYPO3 to have fixes in place before they are released. > [!NOTE] > Having this available in general does not hurt and has > no impact and can also be kept if no patches are needed > to be applied. This change makes this possible with following tasks: * 'vaimo/composer-patches' is added as development dependency to have it available, providing a lot of composer commands around applying and managing patches. * `Build/Scripts/download-patch-from-gerrit.phpsh` to have a simple tool to download gerrit changes and makes it available in `runTests.sh. The script splits them into the different patch files for each sysext containted in the change along with adding basic annotations like package name and link information. Changes on tests are automatically stripped because they are not included in composer dist archives and paths are also aligned to reduce required manual modifications. * Configure `patches/` as folder to search for patch files to avoid the need to manage patch files in the composer.json file and reduce changes on it. Used command(s): ```bash composer config \ "allow-plugins"."vaimo/composer-patches" true \ && composer config \ "extra"."patches-search" "patches/" \ && composer require --dev \ 'vaimo/composer-patches':'^6.0.1' ```
With [1] included in TYPO3 v14.2 `ext_emconf.php` has been deprecated and emits a deprecation error in case following criteria's are not included within the root `composer.json` file for classic-mode installations: * "version" must be set * and "extra"."typo3/cms"."Package"."providesPackages" must at least exists. Having a "version" in the "composer.json" file is not best-practice in the composer world in case that the package is published on `packagist.org` or similar composer package registries [2]: ``` Note: Packagist uses VCS repositories, so the statement above is very much true for Packagist as well. Specifying the version yourself will most likely end up creating problems at some point due to human error. ``` This has been discussed and relaxed with [3] introducing `"extra"."typo3/cms"."version"` as mitigation strategy for extension development. To get functional tests green for TYPO3 14.2 the related change is now added as composer patch along with required pre-changes, restricted to `~14.2.0` only. The can be removed as soon as 14.3 (LTS) is released and testing against 14.2 is not required anymore. * Download gerrit changes using `downloadGerritPatch`. * Restrict to `~14.2.0` manually editing the patch files. * Use `@after` to ensure correct order of related changes and avoid apply issues. > [!NOTE] > Required changes to `composer.json` using the relaxed > variant will be done with follup change to have them > separated from introducing these TYPO3 composer patches > allow simply reverting this change at a later point. Used command(s): ```bash Build/Scripts/runTests.sh -s downloadGerritPatch 93530 \ && Build/Scripts/runTests.sh -s downloadGerritPatch 93484 \ && Build/Scripts/runTests.sh -s downloadGerritPatch 93536 ``` [1] https://review.typo3.org/c/Packages/TYPO3.CMS/+/91908 [2] https://getcomposer.org/doc/04-schema.md#version [3] https://review.typo3.org/c/Packages/TYPO3.CMS/+/93536
This change sets following missing `composer` values
to mitigate the `ext_emconf.php` deprecation message
in functional tests (hard failing) and also in real
classic mode instances:
* Set current development version `3.2.4-dev`
as `"extra"."typo3/cms"."version"`. [1]
* Add `"extra"."typo3/cms"."Package"."providesPackages"` [1]
* `ext_emconf.php` version is set to next patchlevel
version. [1]
* Publish GitHub action workflow is modified to ensure
that tag version is set in `composer.json`, which is
a must requirement. [1]
* Combine `title` and `description` with ` - ` separator
and set it as `composer.json` description. [2]
> [!NOTE]
> Version to set has been derieved by looking up the
> latest tagged/released version and raised on patch
> level.
> [!IMPORTANT]
> This requires adoption for a release process to set the
> version as pre-change (1.), doing the release (2.) and
> setting next development version (3.) again, which can't
> be updated with this change as there is no documentation
> for it included in the repository.
Used command(s):
```bash
composer config "extra"."typo3/cms"."version" "3.2.4-dev" \
&& composer config \
"extra"."typo3/cms"."Package" '{}' \
&& composer config \
--json "extra"."typo3/cms"."Package" '{"providesPackages": {}}' \
&& composer config "description" \
"Container Content Elements - Create Custom Container Content Elements for TYPO3"
```
[1] https://review.typo3.org/c/Packages/TYPO3.CMS/+/93536
[2] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.0/Breaking-108304-PopulateExtensionTitleFromComposerJson.html
This change updates the used TYPO3 v14 constraints to support and test against: * TYPO3 v13.4 -> latest released patchlevel version for minor version (feature freeze) * TYPO3 v14.2 -> latest released patchlevel version for minor version (feature freeze) * TYPO3 v14.3 -> current development (main branch) and automatically switching to LTS patchlevel version once 14.3.0 LTS release has been released. Handling in `Build/Scripts/runTests.sh` is aligned to test 14.2 and 14.3-dev and drop testing against and support for 14.1. Used command(s): ```bash composer config sort-packages true \ && composer require --dev --no-update \ "typo3/cms-install":"^13.4 || ^14.2 || 14.3.*@dev" \ "typo3/cms-fluid-styled-content":"^13.4 || ^14.2 || 14.3.*@dev" \ "typo3/cms-info":"^13.4 || ^14.2 || 14.3.*@dev" \ "typo3/cms-workspaces":"^13.4 || ^14.2 || 14.3.*@dev" \ "typo3/testing-framework":"^9.5" ```
f469151 to
d796fea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Note
Still failing functional tests are related to not matching
database state related to content-defender/core content
defending feature and needs to be addressed in a dedicated
pull-request. Not part of this pull-request goal.
This pull-request contains a series of changes to migitate
the
ext_emconf.phpdeprecation added in TYPO3 14.2 andslightly relaxed in future TYPO3 v14.3.
With 14.2 the only way would be to set the
"version"inthe
composer.jsondirectly, which violates communicatedcomposer best-practises and the reason this has been now
releaxed in TYPO3 coming with 14.3.
A composer patcher package is now added as development
dependency, required merged TYPO3 14.3 changes added as
composer patches limited to
~14.2.0and finally theneeded adoption applied to
composer.jsononly workablewith TYPO3 14.3.
Important
This needs adoption in the release process of the
extension now, which could not be modified because
no release (merger) documentation has been found
in the repository. See last section of the PR for
some general hints.
Commits
[TASK] Add ability for composer patches for development
From time to time it could be use-full to have the ability
to apply composer patches on packages, for example TYPO3
to have fixes in place before they are released.
This change makes this possible with following tasks:
'vaimo/composer-patches' is added as development
dependency to have it available, providing a lot
of composer commands around applying and managing
patches.
Build/Scripts/download-patch-from-gerrit.phpshtohave a simple tool to download gerrit changes and
makes it available in `runTests.sh. The script splits
them into the different patch files for each sysext
containted in the change along with adding basic
annotations like package name and link information.
Changes on tests are automatically stripped because
they are not included in composer dist archives and
paths are also aligned to reduce required manual
modifications.
Configure
patches/as folder to search for patchfiles to avoid the need to manage patch files in
the composer.json file and reduce changes on it.
Used command(s):
[TASK] Allow mitigation of
ext_emconf.phpdeprecationWith [1] included in TYPO3 v14.2
ext_emconf.phphasbeen deprecated and emits a deprecation error in case
following criteria's are not included within the root
composer.jsonfile for classic-mode installations:must at least exists.
Having a "version" in the "composer.json" file is not
best-practice in the composer world in case that the
package is published on
packagist.orgor similarcomposer package registries [2]:
This has been discussed and relaxed with [3] introducing
"extra"."typo3/cms"."version"as mitigation strategyfor extension development.
To get functional tests green for TYPO3 14.2 the related
change is now added as composer patch along with required
pre-changes, restricted to
~14.2.0only. The can beremoved as soon as 14.3 (LTS) is released and testing
against 14.2 is not required anymore.
Download gerrit changes using
downloadGerritPatch.Restrict to
~14.2.0manually editing the patchfiles.
Use
@afterto ensure correct order of related changesand avoid apply issues.
Used command(s):
[1] https://review.typo3.org/c/Packages/TYPO3.CMS/+/91908
[2] https://getcomposer.org/doc/04-schema.md#version
[3] https://review.typo3.org/c/Packages/TYPO3.CMS/+/93536
[TASK] Mitigate
ext_emconf.phpdeprecationThis change sets following missing
composervaluesto mitigate the
ext_emconf.phpdeprecation messagein functional tests (hard failing) and also in real
classic mode instances:
Set current development version
3.2.4-devas
"extra"."typo3/cms"."version". [1]Add
"extra"."typo3/cms"."Package"."providesPackages"[1]ext_emconf.phpversion is set to next patchlevelversion. [1]
Publish GitHub action workflow is modified to ensure
that tag version is set in
composer.json, which isa must requirement. [1]
Combine
titleanddescriptionwith-separatorand set it as
composer.jsondescription. [2]Used command(s):
[1] https://review.typo3.org/c/Packages/TYPO3.CMS/+/93536
[2] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/14.0/Breaking-108304-PopulateExtensionTitleFromComposerJson.html
[TASK] Update TYPO3 version constraints
This change updates the used TYPO3 v14 constraints
to support and test against:
for minor version (feature freeze)
for minor version (feature freeze)
and automatically switching to LTS patchlevel
version once 14.3.0 LTS release has been released.
Handling in
Build/Scripts/runTests.shis alignedto test 14.2 and 14.3-dev and drop testing against
and support for 14.1.
Used command(s):
Extension release process
Commonly a release needs to be prepared, for example setting version
for the rendered documentation,
ext_emconfand similar andtailoris used for this task.
This can be in different ways and is also related to working style and
repository permission and settings. Assuming that the
Releaserhasthe permission to push commits directly on the main branch the three
step release can be done with a singe command chain, but splitted up
into dedicated parts, for example using pull-requests and waiting for
tests to pass.
Simple one-command chain example
This assumes that
tailoris available globally and also thatcomposer is globally available. Otherwise can be adjusted using
variables at the beginning of the script.
Also ensure to adjust following variables:
RELEASE_BRANCHRELEASE_VERSIONNEXT_DEV_VERSION