Skip to content

fix: repair CI pipeline (testing-framework, test paths, matrix, DI, CGL)#3

Closed
CybotTM wants to merge 10 commits intomainfrom
fix/ci-repairs
Closed

fix: repair CI pipeline (testing-framework, test paths, matrix, DI, CGL)#3
CybotTM wants to merge 10 commits intomainfrom
fix/ci-repairs

Conversation

@CybotTM
Copy link
Member

@CybotTM CybotTM commented Mar 7, 2026

Summary

Comprehensive fix for all CI failures in a series of clean, atomic commits:

  1. fix: allow testing-framework ^9.0 — Widens the typo3/testing-framework constraint from ^8.0.9 to ^8.0.9 || ^9.0, enabling compatibility with TYPO3 v14 (dev-main)
  2. fix: use composer package name for test extension loading — Replaces the legacy typo3conf/ext/ path format with the composer package name typo3tests/example-extension in ExtensionTestCase.php; widens ext_emconf.php TYPO3 constraint to 12.4.0-14.99.99
  3. chore: update test matrix — Aligns workflow matrices with current TYPO3/PHP support:
    • v12.4: PHP 8.1–8.4
    • v13.4: PHP 8.2–8.5 (renamed from 13.1)
    • v14/main: PHP 8.2–8.5
    • Adds push: branches: [main] to avoid duplicate CI runs on PRs
    • Fixes duplicate "Unit Tests" step name → "Functional Tests"
    • Removes archived XLIFF linter job from CGL workflow
    • Cleans dead 13.0/13.1 code from runTests.sh
  4. fix: use DI container in PhpDomainRendererTest — Replaces GeneralUtility::makeInstance() with $this->get() so constructor-injected dependencies are resolved
  5. style: fix CGL violations — Fixes 8 files flagged by php-cs-fixer: modifier order, nullable syntax, operator linebreak, trailing commas, cast spacing

Supersedes

Test plan

  • CI workflows pass for all three TYPO3 version matrices
  • CGL check passes without violations
  • Functional tests resolve PhpDomainRenderer via DI container

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request provides a comprehensive set of fixes to resolve continuous integration failures. It updates dependency constraints, modernizes test configurations for compatibility with newer TYPO3 and PHP versions, refactors test setup to use dependency injection, and applies various code style improvements to align with coding guidelines. The changes ensure the CI pipeline remains robust and functional across the supported TYPO3 and PHP environments.

Highlights

  • typo3/testing-framework Compatibility: Widened the typo3/testing-framework constraint from ^8.0.9 to ^8.0.9 || ^9.0 to enable compatibility with TYPO3 v14 (dev-main).
  • Test Extension Loading Modernization: Replaced the legacy typo3conf/ext/ path format with the composer package name typo3tests/example-extension in ExtensionTestCase.php and widened ext_emconf.php TYPO3 constraint to 12.4.0-14.99.99.
  • CI Test Matrix Update: Aligned workflow matrices with current TYPO3/PHP support (v12.4: PHP 8.1–8.4; v13.4: PHP 8.2–8.5; v14/main: PHP 8.2–8.5), added push: branches: [main] to avoid duplicate CI runs, fixed "Unit Tests" step name to "Functional Tests", removed archived XLIFF linter job, and cleaned dead code from runTests.sh.
  • Dependency Injection in Tests: Replaced GeneralUtility::makeInstance() with $this->get() in PhpDomainRendererTest to ensure constructor-injected dependencies are resolved via the DI container.
  • Code Style Fixes (CGL): Addressed CGL violations across 8 files, including modifier order, nullable syntax, operator linebreak, trailing commas, and cast spacing.
Changelog
  • Build/Scripts/runTests.sh
    • Updated supported PHP versions in options to include 8.4 and 8.5, and changed default to PHP 8.2.
    • Updated supported TYPO3 versions in options to 12.4|13.4|main, removing 13.0 and 13.1.
    • Removed composer req commands for TYPO3 versions 13.0 and 13.1, replacing them with 13.4.
  • Classes/Command/BaselineCommand.php
    • Reordered readonly and protected modifiers for a class property.
  • Classes/Command/PhpDomainCommand.php
    • Reordered protected and readonly modifiers for a class property.
    • Added a space after the (string) type cast.
  • Classes/Domain/Factory/MemberFactory.php
    • Updated the nullable return type hint from ConstantMember|null to ?ConstantMember.
  • Classes/Domain/Factory/MethodFactory.php
    • Updated the nullable return type hint from MethodMember|null to ?MethodMember.
    • Adjusted the catch block to use | without spaces for multiple exception types.
  • Classes/Domain/Factory/PropertyFactory.php
    • Updated the nullable return type hint from PropertyMember|null to ?PropertyMember.
  • Classes/Renderer/CodeSnippetRenderer.php
    • Adjusted string concatenation in sprintf to remove the . operator at the end of the first line.
  • Classes/Renderer/Traits/GetCodeBlockRstTrait.php
    • Added a trailing comma to the implode function call arguments.
  • Classes/Util/CodeSnippetCreator.php
    • Added a trailing comma to the render method call arguments.
  • Tests/Functional/ExtensionTestCase.php
    • Changed the path for loading the example extension from typo3conf/ext/... to typo3tests/example-extension.
  • Tests/Functional/Fixtures/Extensions/example_extension/ext_emconf.php
    • Widened the TYPO3 dependency constraint from 13.1.0-13.99.99 to 12.4.0-14.99.99.
  • Tests/Functional/PhpDomainRendererTest.php
    • Removed TYPO3\CMS\Core\Utility\GeneralUtility import.
    • Replaced GeneralUtility::makeInstance(PhpDomainRenderer::class) with $this->get(PhpDomainRenderer::class).
  • composer.json
    • Updated the typo3/testing-framework dependency to allow version ^9.0 in addition to ^8.0.9.
Ignored Files
  • Ignored by pattern: .github/workflows/** (4)
    • .github/workflows/cgl.yml
    • .github/workflows/tests-12.4.yml
    • .github/workflows/tests-13.4.yml
    • .github/workflows/tests-main.yml
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request provides a comprehensive set of fixes for the CI pipeline, including updating dependencies, test paths, and the test matrix. It also refactors a test to use dependency injection and applies several coding style fixes. The changes are well-organized and accurately reflect the pull request description. I have one suggestion to improve the structure of a shell script for better readability and logic, but overall, the changes are solid.

@CybotTM CybotTM force-pushed the fix/ci-repairs branch 4 times, most recently from 08f4209 to 215b2f3 Compare March 7, 2026 16:29
@CybotTM
Copy link
Member Author

CybotTM commented Mar 7, 2026

CI Status

All jobs pass except tests-main (v14) functional tests — these are pre-existing failures not caused by this PR:

  1. LanguageService.rst fixture: TYPO3 v14 (dev-main) changed docblock wording from "that" to "which" — the expected fixture was generated against v13
  2. PageArguments.rst fixture: The renderer splits generic types like array<string,string|array> at commas, producing broken output — this is a rendering bug, not a test infrastructure issue

Both issues exist on main before this PR and should be addressed separately:

  • Fixture update for the wording change
  • Bug fix in the type parser for generic types with commas

Passing

  • Linting (5/5)
  • Code Quality — CGL, PHPStan, Composer validate/normalize (13/13)
  • tests-12.4 — Unit + Functional (4/4)
  • tests-13.4 — Unit + Functional (4/4)

@CybotTM CybotTM force-pushed the fix/ci-repairs branch 2 times, most recently from 604c7ee to 2375476 Compare March 7, 2026 16:51
@CybotTM
Copy link
Member Author

CybotTM commented Mar 7, 2026

CI Status — All Green

All 30/30 jobs pass across all TYPO3 versions and PHP versions.

Workflow Jobs Status
Linting PHP 8.1–8.5 5/5 ✅
Code Quality CGL, PHPStan, Composer (v12.4/v13.4/main × PHP) 13/13 ✅
tests-12.4 Unit + Functional (PHP 8.1–8.4) 4/4 ✅
tests-13.4 Unit + Functional (PHP 8.2–8.5) 5/5 ✅
tests-main (v14) Unit + Functional (PHP 8.2–8.5) 4/4 ✅

CybotTM added 10 commits March 7, 2026 18:08
testing-framework 8.x requires typo3/cms-backend 12.*.*@dev || 13.*.*@dev,
which conflicts with dev-main (now v14). testing-framework 9.x supports
13.*.*@dev || 14.*.*@dev. Allowing both ranges lets composer resolve the
correct version based on the TYPO3 core version being tested.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
The legacy path 'typo3conf/ext/codesnippet/Functional/Fixtures/...' cannot
be resolved by testing-framework's linkTestExtensionsToInstance(). Use the
composer package name 'typo3tests/example-extension' instead, which is
resolved via getPackageInfoWithFallback() using the path repository already
configured in composer.json.

Also widen example_extension ext_emconf.php TYPO3 constraint to 12.4-14.x.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- Update PHP versions per TYPO3 version:
  - v12.4: PHP 8.1, 8.2, 8.3, 8.4
  - v13.4: PHP 8.2, 8.3, 8.4, 8.5
  - v14/main: PHP 8.2, 8.3, 8.4, 8.5
- Replace tests-13.1 workflow with tests-13.4 (current LTS)
- Remove dead 13.0/13.1 code from runTests.sh
- Add PHP 8.4/8.5 support to runTests.sh
- Restrict push trigger to main branch to avoid duplicate CI runs on PRs
- Remove archived XLIFF linter job (TYPO3-CI-Xliff-Lint is archived,
  Docker image at container.registry.gitlab.typo3.org returns 403)
- Fix duplicate "Unit Tests" step name (now "Functional Tests")

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
PhpDomainRenderer requires ComponentFactory via constructor injection.
GeneralUtility::makeInstance() does not perform DI, causing:
  ArgumentCountError: Too few arguments to function __construct(), 0 passed

Use $this->get() from the functional test container instead.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
- modifier_keywords: reorder `readonly protected` to `protected readonly`
- operator_linebreak: move `.` concatenation operator to start of next line
- method_argument_space: fix indentation of multiline function arguments
- trailing_comma_in_multiline: add missing trailing comma
- nullable_type_declaration: use `?Type` instead of `Type|null`
- types_spaces: remove space in catch union type `\Exception|\Throwable`
- cast_spaces: add space after cast `(string) $var`

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
…tCase

PHPUnit 11 (from testing-framework v9) makes TestCase::__construct()
final. Move extension loading config from constructor to property
declarations, which is compatible with both PHPUnit 10 and 11.

Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
The render() methods referenced undefined variables ($sourceFile, $nodes,
$caption, etc.) instead of reading from the $config array parameter.
This caused 16 PHPStan errors.

Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
PHPUnit 11 (from testing-framework v9) removed static access to
assertion methods, but CGL enforces self:: call style. Both work at
runtime. Add PHPStan ignoreErrors pattern to suppress the false
positive.

Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
The extractTypeFromReturnComment method split at the first space, which
broke types like `array<string, string|array>`. Add bracket-depth-aware
splitting that only splits at spaces outside angle brackets.

Also replace LanguageService and PageArguments test fixtures with local
fixture classes to avoid dependency on TYPO3 core docblock wording that
changes between versions.

Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a comprehensive CI/test infrastructure repair, fixing multiple interrelated issues that were causing CI failures: testing-framework compatibility for TYPO3 v14, broken functional test extension loading paths, outdated CI matrices, DI container usage in tests, and CGL style violations.

Changes:

  • Widens typo3/testing-framework constraint to ^8.0.9 || ^9.0 for TYPO3 v14 (dev-main) compatibility, and replaces test fixture dependencies on TYPO3 core classes with self-contained example extension classes (PropertyExample, MethodExample) to avoid version-specific breakage
  • Updates all CI matrices (PHP 8.1–8.5, TYPO3 12.4/13.4/main), renames tests-13.1.ymltests-13.4.yml, adds push: branches: [main] to all workflows, removes the archived XLIFF linter job, and fixes the duplicate "Unit Tests" step name
  • Fixes code style violations (modifier order, nullable syntax, operator linebreak, trailing commas, cast spacing) and adds logic to handle generic type spacing normalization in return comment parsing

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
composer.json Widens typo3/testing-framework constraint to support v9 (TYPO3 v14)
Tests/Functional/ExtensionTestCase.php Replaces constructor-based property merging with direct property declarations; uses composer package name for extension loading
Tests/Functional/PhpDomainRendererTest.php Uses DI container ($this->get()) instead of GeneralUtility::makeInstance()
Tests/Functional/Fixtures/config/PageArguments.php Points to new MethodExample fixture class
Tests/Functional/Fixtures/config/LanguageService.php Points to new PropertyExample fixture class
Tests/Functional/Fixtures/results/PageArguments.rst Updates expected RST output for MethodExample
Tests/Functional/Fixtures/results/LanguageService.rst Updates expected RST output for PropertyExample
Tests/Functional/Fixtures/Extensions/example_extension/ext_emconf.php Widens TYPO3 version constraint to 12.4.0-14.99.99
Tests/Functional/Fixtures/Extensions/example_extension/Classes/PropertyExample.php New self-contained test fixture class replacing LanguageService
Tests/Functional/Fixtures/Extensions/example_extension/Classes/MethodExample.php New self-contained test fixture class replacing PageArguments
Classes/Domain/Factory/MethodFactory.php Adds splitTypeAndDescription and normalizeGenericTypeSpacing for correct generic type parsing; misc CGL fix
Classes/Domain/Factory/PropertyFactory.php CGL fix: nullable return type syntax
Classes/Domain/Factory/MemberFactory.php CGL fix: nullable return type syntax
Classes/Command/PhpDomainCommand.php CGL fix: modifier order + cast spacing
Classes/Command/BaselineCommand.php CGL fix: modifier order
Classes/Renderer/CodeSnippetRenderer.php CGL fix: string concatenation operator placement
Classes/Renderer/YamlCodeSnippetRenderer.php Refactors render method to read from $config array
Classes/Renderer/XmlCodeSnippetRenderer.php Refactors render method to read from $config array
Classes/Renderer/Traits/GetCodeBlockRstTrait.php CGL fix: indentation
Classes/Util/CodeSnippetCreator.php CGL fix: trailing comma
Build/phpstan/phpstan.neon Suppresses PHPStan false positives for static PHPUnit assertion methods
Build/Scripts/runTests.sh Adds PHP 8.4/8.5 support, replaces 13.0/13.1 with 13.4, uses elif chain
.github/workflows/tests-12.4.yml Adds push: branches: [main]; adds PHP 8.1 and 8.4; fixes duplicate step name
.github/workflows/tests-13.4.yml Replaces old 13.1 workflow; adds PHP 8.4/8.5; fixes duplicate step name
.github/workflows/tests-main.yml Adds push: branches: [main]; adds PHP 8.4/8.5; fixes duplicate step name
.github/workflows/cgl.yml Updates matrix to 13.4/main; adds PHP 8.4/8.5; removes XLIFF linter job

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
return preg_replace_callback('/<[^>]+>/', static function (array $match): string {
return str_replace(', ', ',', $match[0]);
}, $type);
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preg_replace_callback returns string|null (it returns null on PCRE error), but normalizeGenericTypeSpacing declares a string return type. While the pattern /<[^>]+>/ is valid and unlikely to trigger a PCRE error in practice, the return value should be safely handled to satisfy the declared return type. Wrapping the result with ?? $type (i.e., returning the original string as fallback if preg_replace_callback unexpectedly returns null) would make this type-safe.

Suggested change
}, $type);
}, $type) ?? $type;

Copilot uses AI. Check for mistakes.
@CybotTM CybotTM closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants