Skip to content

ci: replace broken TYPO3_11 CI infrastructure with TYPO3_12 structure#357

Merged
CybotTM merged 6 commits into
TYPO3_11from
TYPO3_11_ci_fixes
Oct 20, 2025
Merged

ci: replace broken TYPO3_11 CI infrastructure with TYPO3_12 structure#357
CybotTM merged 6 commits into
TYPO3_11from
TYPO3_11_ci_fixes

Conversation

@CybotTM
Copy link
Copy Markdown
Member

@CybotTM CybotTM commented Oct 20, 2025

Summary

Replace the non-functional TYPO3_11 CI setup with the complete, working CI infrastructure from TYPO3_12/main branches, adapted for TYPO3 v11 compatibility.

Problem

The existing TYPO3_11 CI workflows are broken and non-functional, preventing automated testing, quality checks, and continuous integration. The previous setup used outdated Docker-based workflows and incomplete configurations.

Solution

Complete replacement of CI infrastructure by backporting the proven TYPO3_12 CI setup:

1. GitHub Actions Workflow (.github/workflows/ci.yml)

  • Matrix strategy testing PHP 7.4, 8.0, 8.1, 8.2 with TYPO3 ^11.5
  • Composer dependency caching for faster builds
  • Automated security audits (composer audit)
  • PHP linting, PHPStan static analysis, functional tests
  • Code coverage generation and Codecov upload
  • All steps use composer ci:* scripts for consistency

2. Composer Scripts (composer.json)

  • ci:security - Security vulnerability scanning
  • ci:test:php:lint - PHP syntax validation
  • ci:test:php:phpstan - Static analysis with PHPStan
  • ci:test:php:phpstan:baseline - Baseline generation
  • ci:test:php:functional - PHPUnit functional test suite
  • ci:coverage:functional - Coverage report generation
  • ci:test - Combined quality gate (lint + phpstan + functional)

3. PHPStan Configuration (Build/phpstan.neon)

  • Level 8 analysis (appropriate for TYPO3 v11)
  • Strict rules for maximum code quality
  • PHPUnit extension integration
  • Comprehensive path coverage (Classes, Configuration, Resources, Tests)
  • Advanced type inference and checking
  • Empty baseline for clean start

Changes Made

New Files:

  • .github/workflows/ci.yml - Complete CI workflow for TYPO3 v11
  • Build/phpstan.neon - PHPStan configuration adapted for v11
  • Build/phpstan-baseline.neon - Empty baseline (clean slate)

Modified Files:

  • composer.json - Added complete ci:* scripts section

Adaptations for TYPO3 v11

  • PHP version matrix: 7.4-8.2 (v11 support range)
  • TYPO3 constraint: ^11.5 instead of ^12.4
  • PHPStan level: 8 (v11 appropriate) instead of 9 (v12)
  • Removed phpstan-deprecation-rules (not in v11 dependencies)
  • Coverage PHP version: 8.1 (stable for v11) instead of 8.2
  • Included typo3/cms-recordlist dependency (v11 requirement)

Technical Details

  • All CI steps use composer scripts for local reproducibility
  • Workflow includes proper error formatting (--error-format=github)
  • SQLite database driver for zero-dependency functional tests
  • Composer cache strategy optimizes build times
  • Coverage reports uploaded only on PHP 8.1 to avoid duplicates

Impact

✅ Functional CI pipeline with automated quality gates
✅ Local and CI consistency through composer scripts
✅ Static analysis catches errors before review
✅ Test coverage tracking and reporting
✅ Security vulnerability monitoring
✅ Foundation for automated PR checks and branch protection

Backport from TYPO3_12 (caf8279) to fix coverage generation.

Problem:
- PHPUnit requires coverage source filter when generating coverage reports
- Missing configuration causes "No filter is configured" warning
- Coverage generation fails in PHP 8.x builds

Solution:
- Add <coverage><include> configuration to FunctionalTests.xml
- Specify Classes directory for coverage analysis
- Resolves warning during coverage generation

Original-Commit: caf8279
Original-Author: Sebastian Mendel <sebastian.mendel@netresearch.de>
Replace the non-functional TYPO3_11 CI setup with the complete, working
CI infrastructure from TYPO3_12/main branches, adapted for TYPO3 v11
compatibility.

Problem:
--------
The existing TYPO3_11 CI workflows are broken and non-functional, preventing
automated testing, quality checks, and continuous integration. The previous
setup used outdated Docker-based workflows and incomplete configurations.

Solution:
---------
Complete replacement of CI infrastructure by backporting the proven TYPO3_12
CI setup:

1. **GitHub Actions Workflow** (.github/workflows/ci.yml)
   - Matrix strategy testing PHP 7.4, 8.0, 8.1, 8.2 with TYPO3 ^11.5
   - Composer dependency caching for faster builds
   - Automated security audits (composer audit)
   - PHP linting, PHPStan static analysis, functional tests
   - Code coverage generation and Codecov upload
   - All steps use composer ci:* scripts for consistency

2. **Composer Scripts** (composer.json)
   - ci:security - Security vulnerability scanning
   - ci:test:php:lint - PHP syntax validation
   - ci:test:php:phpstan - Static analysis with PHPStan
   - ci:test:php:phpstan:baseline - Baseline generation
   - ci:test:php:functional - PHPUnit functional test suite
   - ci:coverage:functional - Coverage report generation
   - ci:test - Combined quality gate (lint + phpstan + functional)

3. **PHPStan Configuration** (Build/phpstan.neon)
   - Level 8 analysis (appropriate for TYPO3 v11)
   - Strict rules for maximum code quality
   - PHPUnit extension integration
   - Comprehensive path coverage (Classes, Configuration, Resources, Tests)
   - Advanced type inference and checking
   - Empty baseline for clean start

Changes Made:
-------------
**New Files:**
- .github/workflows/ci.yml - Complete CI workflow for TYPO3 v11
- Build/phpstan.neon - PHPStan configuration adapted for v11
- Build/phpstan-baseline.neon - Empty baseline (clean slate)

**Modified Files:**
- composer.json - Added complete ci:* scripts section

**Adaptations for TYPO3 v11:**
- PHP version matrix: 7.4-8.2 (v11 support range)
- TYPO3 constraint: ^11.5 instead of ^12.4
- PHPStan level: 8 (v11 appropriate) instead of 9 (v12)
- Removed phpstan-deprecation-rules (not in v11 dependencies)
- Coverage PHP version: 8.1 (stable for v11) instead of 8.2
- Included typo3/cms-recordlist dependency (v11 requirement)

Technical Details:
------------------
- All CI steps use composer scripts for local reproducibility
- Workflow includes proper error formatting (--error-format=github)
- SQLite database driver for zero-dependency functional tests
- Composer cache strategy optimizes build times
- Coverage reports uploaded only on PHP 8.1 to avoid duplicates

Impact:
-------
✅ Functional CI pipeline with automated quality gates
✅ Local and CI consistency through composer scripts
✅ Static analysis catches errors before review
✅ Test coverage tracking and reporting
✅ Security vulnerability monitoring
✅ Foundation for automated PR checks and branch protection
TYPO3 v11 supports PHP 7.4-8.3, so include PHP 8.3 in the CI matrix to
ensure full compatibility testing across all supported PHP versions.
Remove the old, non-functional CI workflows that are being replaced by
the new unified ci.yml workflow:

- testing.yml - Old Docker-based functional tests using runTests.sh script
- phpstan.yml - Separate PHPStan workflow with wrong config path
- phpcs.yml - PHP_CodeSniffer workflow (not in TYPO3_11 dependencies)

All functionality is now consolidated in the new ci.yml workflow which
uses composer scripts for consistency and maintainability.
Test all CI scripts locally and fix issues found:

1. **PHP Linting** (composer ci:test:php:lint)
   - Fixed find command to exclude both .Build and .build directories
   - Added node_modules exclusion to prevent false positives
   - Changed from '!' to '-not' for better compatibility
   - ✅ All PHP files lint successfully

2. **PHPStan** (composer ci:test:php:phpstan)
   - Disabled phpstan-phpunit extension (incompatible with PHPStan 1.x)
   - Generated baseline for 36 existing issues (to be fixed separately)
   - ✅ PHPStan passes with baseline

3. **Functional Tests** (composer ci:test:php:functional)
   - ✅ All 1 functional test passes (1/1, 100%)
   - Minor PHPUnit deprecation noted (non-blocking)

All CI checks now pass locally before pushing to CI.
PHP 7.4 uses different parameter names in error messages () compared
to PHP 8+ () for strncmp and strncasecmp functions.

Use regex pattern to match both parameter name variants:
- $(string1|str1) matches both PHP 7.4 and PHP 8+ error messages

This ensures PHPStan passes on all supported PHP versions (7.4-8.3).
@CybotTM CybotTM merged commit 12502f6 into TYPO3_11 Oct 20, 2025
5 checks passed
@CybotTM CybotTM deleted the TYPO3_11_ci_fixes branch October 20, 2025 05:41
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.

1 participant