chore: update upgrade plan with current state of the project

This commit is contained in:
Björn Fromme
2026-03-16 12:01:09 +01:00
parent 9baed0987e
commit 6d5f7cfd22
+59 -89
View File
@@ -1,9 +1,9 @@
# Symfony 7.4 Upgrade Plan # Symfony 7.4 Upgrade Plan
**Project:** MyEP Next Booking **Project:** MyEP Next Booking
**Current Version:** Symfony 6.4.27 **Current Version:** Symfony 6.4.31
**Target Version:** Symfony 7.4 (LTS) **Target Version:** Symfony 7.4 (LTS)
**Date:** 2025-12-06 **Date:** 2026-01-05
**Status:** Ready for Upgrade **Status:** Ready for Upgrade
--- ---
@@ -14,7 +14,7 @@
**Risk Level: LOW** **Risk Level: LOW**
**Status: READY FOR UPGRADE** **Status: READY FOR UPGRADE**
The MyEP Next Booking application is well-positioned for a Symfony 7.4 upgrade. The codebase follows modern Symfony best practices, uses PHP 8 features extensively, and avoids most deprecated patterns. The MyEP Next Booking application is well-positioned for a Symfony 7.4 upgrade. The codebase follows modern Symfony best practices, uses PHP 8 features extensively, and avoids most deprecated patterns. All pre-upgrade fixes have been completed.
**Key Facts:** **Key Facts:**
- Symfony 7.4 was released on November 27, 2025 - Symfony 7.4 was released on November 27, 2025
@@ -24,39 +24,36 @@ The MyEP Next Booking application is well-positioned for a Symfony 7.4 upgrade.
**Pre-Upgrade Status:** **Pre-Upgrade Status:**
- PHP version: 8.2.29 (compatible) - PHP version: 8.2.29 (compatible)
- OAuth2 Server Bundle: 1.0.0 (compatible) - OAuth2 Server Bundle: 1.1.0 (compatible)
- Stimulus Bundle: 2.31.0 (compatible) - Stimulus Bundle: 2.32.0 (compatible)
- KnpMenuBundle: Removed (no longer in use) - KnpMenuBundle: Removed (no longer in use)
- Doctrine ORM: 3.5.8 (compatible) - Doctrine ORM: 3.6.0 (compatible)
- All 281 tests passing (1 unrelated test failure to investigate) - All 312 tests passing
- 18 deprecation warnings to resolve (Email validator loose mode) - Email validation mode: Configured (html5)
- 18 test-only deprecation warnings (cosmetic, do not affect runtime)
--- ---
## Previous Plan Status ## Previous Plan Status
The previous upgrade plan (dated 2025-10-24) was written for Symfony 7.3. Several items have changed: The previous upgrade plan (dated 2025-12-06) has been updated. All pre-upgrade tasks are now complete.
### Completed Items ### Completed Items
| Item | Previous Status | Current Status | | Item | Previous Status | Current Status |
|------|----------------|----------------| |------|----------------|----------------|
| OAuth2 Server Bundle | ^1.0 | **1.0.0 installed** | | OAuth2 Server Bundle | 1.0.0 | **1.1.0 installed** |
| Stimulus Bundle | ^2.30 | **2.31.0 installed** | | Stimulus Bundle | 2.31.0 | **2.32.0 installed** |
| PHP 8.2 deprecations (ParticipantDto::$touched) | Planned | **Completed** | | PHP 8.2 deprecations (ParticipantDto::$touched) | Planned | **Completed** |
| Doctrine config (controller_resolver) | Planned | **Completed** | | Doctrine config (controller_resolver) | Planned | **Completed** |
| SecurityController null safety | Planned | **Needs verification** | | SecurityController null safety | Needs verification | **Completed** (uses `?->` and `??`) |
| Email validator "loose" mode deprecation | Needs fix | **Completed** (validator.yaml configured) |
| Failing test in BookingDataProcessorTest | Unrelated to upgrade | **Resolved** (test now passes) |
### Items No Longer Relevant ### Items No Longer Relevant
| Item | Reason | | Item | Reason |
|------|--------| |------|--------|
| KnpMenuBundle upgrade | **Bundle removed from project** | | KnpMenuBundle upgrade | **Bundle removed from project** |
### New Items Discovered
| Item | Priority | Status |
|------|----------|--------|
| Email validator "loose" mode deprecation | MEDIUM | **Needs fix** |
| Failing test in BookingDataProcessorTest | LOW | **Unrelated to upgrade** |
--- ---
## Current State Analysis ## Current State Analysis
@@ -71,19 +68,19 @@ The previous upgrade plan (dated 2025-10-24) was written for Symfony 7.3. Severa
### Installed Dependencies ### Installed Dependencies
#### Core Symfony Packages (6.4.x) #### Core Symfony Packages (6.4.x)
All 32 Symfony packages currently at 6.4.x need version constraint updates to 7.4.* All 33 Symfony packages currently at 6.4.x need version constraint updates to 7.4.*
#### Third-Party Bundles - Compatible #### Third-Party Bundles - Compatible
| Package | Installed | Symfony 7.4 Compatible | | Package | Installed | Symfony 7.4 Compatible |
|---------|-----------|------------------------| |---------|-----------|------------------------|
| `doctrine/orm` | 3.5.8 | Yes | | `doctrine/orm` | 3.6.0 | Yes |
| `doctrine/doctrine-bundle` | 2.18.1 | Yes | | `doctrine/doctrine-bundle` | 2.18.1 | Yes |
| `doctrine/doctrine-migrations-bundle` | 3.7.0 | Yes | | `doctrine/doctrine-migrations-bundle` | 3.7.0 | Yes |
| `league/oauth2-server-bundle` | 1.0.0 | Yes | | `league/oauth2-server-bundle` | 1.1.0 | Yes |
| `symfony/stimulus-bundle` | 2.31.0 | Yes | | `symfony/stimulus-bundle` | 2.32.0 | Yes |
| `symfony/webpack-encore-bundle` | 2.4.0 | Yes | | `symfony/webpack-encore-bundle` | 2.4.0 | Yes |
| `symfony/monolog-bundle` | 3.11.0 | Yes | | `symfony/monolog-bundle` | 3.11.0 | Yes |
| `zenstruck/schedule-bundle` | ^1.8 | Verify during upgrade | | `zenstruck/schedule-bundle` | 1.9.0 | Yes |
### Code Quality Assessment ### Code Quality Assessment
@@ -98,21 +95,13 @@ The codebase implements modern Symfony/PHP patterns:
--- ---
## Pre-Upgrade Fixes Required ## Pre-Upgrade Fixes - COMPLETED
### 1. Email Validator "loose" Mode Deprecation (MEDIUM Priority) ### 1. Email Validator "loose" Mode Deprecation - DONE
**Issue:** The default mode for `#[Assert\Email]` is "loose", which is deprecated in Symfony 6.2+ and removed in Symfony 7.0. **Issue:** The default mode for `#[Assert\Email]` is "loose", which is deprecated in Symfony 6.2+ and removed in Symfony 7.0.
**Current State:** Most Email constraints already have `mode: 'strict'`, but the framework default is still being triggered somewhere during validation. **Resolution:** Framework default configured in `config/packages/validator.yaml`:
**Files to verify:**
- `src/Form/Model/ParticipantDto.php` - Has `mode: 'strict'`
- `src/Form/Model/RegistrationDto.php` - Has `mode: 'strict'`
- `src/BusProNet/Model/Communication.php` - Has `mode: 'strict'`
- `src/Controller/ResetPasswordController.php` - Has `mode: 'strict'`
**Action:** Configure framework default email validation mode in `config/packages/validator.yaml`:
```yaml ```yaml
framework: framework:
@@ -120,14 +109,24 @@ framework:
email_validation_mode: html5 email_validation_mode: html5
``` ```
This sets the global default to `html5` (recommended for Symfony 7+), eliminating deprecation warnings. All Email constraints in the codebase also explicitly use `mode: 'strict'`:
- `src/Form/Model/ParticipantDto.php` - Has `mode: 'strict'`
- `src/Form/Model/RegistrationDto.php` - Has `mode: 'strict'`
- `src/BusProNet/Model/Communication.php` - Has `mode: 'strict'`
- `src/Controller/ResetPasswordController.php` - Has `mode: 'strict'`
### 2. Test Failure Investigation (LOW Priority) ### 2. Test Deprecation Warnings - COSMETIC ONLY
**File:** `tests/BusProNet/DataProcessor/BookingDataProcessorTest.php:171` **Issue:** 18 deprecation warnings appear during test runs.
**Issue:** Expected 'Original', got 'Updated'
This appears to be a test that's failing due to recent code changes unrelated to the Symfony upgrade. Should be investigated separately but does not block the upgrade. **Cause:** `ParticipantEditDtoTest` creates a standalone validator using `Validation::createValidatorBuilder()` which bypasses the framework's `validator.yaml` configuration.
**Impact:** These warnings are cosmetic and do not affect:
- Runtime behavior (all Email constraints use explicit `mode: 'strict'`)
- Symfony 7.4 compatibility (no code changes needed)
- Test results (all 312 tests pass)
**Note:** Warnings can be silenced with `SYMFONY_DEPRECATIONS_HELPER=disabled` if desired.
--- ---
@@ -154,6 +153,7 @@ Update all packages from `6.4.*` to `7.4.*`:
"symfony/html-sanitizer": "7.4.*", "symfony/html-sanitizer": "7.4.*",
"symfony/http-client": "7.4.*", "symfony/http-client": "7.4.*",
"symfony/intl": "7.4.*", "symfony/intl": "7.4.*",
"symfony/lock": "7.4.*",
"symfony/mailer": "7.4.*", "symfony/mailer": "7.4.*",
"symfony/mime": "7.4.*", "symfony/mime": "7.4.*",
"symfony/notifier": "7.4.*", "symfony/notifier": "7.4.*",
@@ -204,23 +204,13 @@ Update all packages from `6.4.*` to `7.4.*`:
} }
``` ```
### 3. Configure Email Validation Mode
**File:** `config/packages/validator.yaml`
```yaml
framework:
validation:
email_validation_mode: html5
```
--- ---
## Potential Breaking Changes ## Potential Breaking Changes
### 1. Symfony Core Changes (Symfony 7.0 7.4) ### 1. Symfony Core Changes (Symfony 7.0 -> 7.4)
Symfony 7.0 removed all deprecated features from 6.4. Our codebase is mostly compliant: Symfony 7.0 removed all deprecated features from 6.4. Our codebase is fully compliant:
- **Native Return Types:** Already implemented - **Native Return Types:** Already implemented
- **Attribute-based Configuration:** Already implemented - **Attribute-based Configuration:** Already implemented
@@ -232,7 +222,7 @@ Symfony 7.0 removed all deprecated features from 6.4. Our codebase is mostly com
**Breaking Change:** The default `mode` for `Email` constraint changes from `loose` to `html5` in Symfony 7.0. **Breaking Change:** The default `mode` for `Email` constraint changes from `loose` to `html5` in Symfony 7.0.
**Status:** Already using `mode: 'strict'` in most places. Setting global default will ensure consistency. **Status:** Already handled - all constraints use explicit `mode: 'strict'` and framework default is set to `html5`.
### 3. Deprecation Cleanup ### 3. Deprecation Cleanup
@@ -245,26 +235,7 @@ Deprecations accumulated in Symfony 7.1-7.4 will need review:
## Upgrade Procedure ## Upgrade Procedure
### Phase 1: Pre-Upgrade Fixes (30 minutes) ### Phase 1: Preparation (15 minutes)
1. **Configure Email Validation Mode**
```bash
# Edit config/packages/validator.yaml
```
2. **Clear Caches**
```bash
ddev exec bin/console cache:clear
ddev exec "php -r 'opcache_reset();'"
```
3. **Run Tests**
```bash
ddev exec ./vendor/bin/phpunit
```
Verify deprecation warnings are resolved.
### Phase 2: Preparation (15 minutes)
1. **Create Feature Branch** 1. **Create Feature Branch**
```bash ```bash
@@ -276,7 +247,7 @@ Deprecations accumulated in Symfony 7.1-7.4 will need review:
git tag before-symfony-7.4-upgrade git tag before-symfony-7.4-upgrade
``` ```
### Phase 3: Dependency Updates (30 minutes - 1 hour) ### Phase 2: Dependency Updates (30 minutes - 1 hour)
1. **Update composer.json** 1. **Update composer.json**
- Update all Symfony package constraints to `7.4.*` - Update all Symfony package constraints to `7.4.*`
@@ -300,7 +271,7 @@ Deprecations accumulated in Symfony 7.1-7.4 will need review:
ddev exec "php -r 'opcache_reset();'" ddev exec "php -r 'opcache_reset();'"
``` ```
### Phase 4: Testing & Validation (1-2 hours) ### Phase 3: Testing & Validation (1-2 hours)
1. **Run PHPUnit Test Suite** 1. **Run PHPUnit Test Suite**
```bash ```bash
@@ -313,7 +284,7 @@ Deprecations accumulated in Symfony 7.1-7.4 will need review:
2. **Run PHP-CS-Fixer** 2. **Run PHP-CS-Fixer**
```bash ```bash
/opt/homebrew/bin/php-cs-fixer fix --dry-run --diff ddev php vendor/bin/php-cs-fixer fix --dry-run --diff
``` ```
3. **Manual Testing - Critical Paths** 3. **Manual Testing - Critical Paths**
@@ -349,7 +320,7 @@ Deprecations accumulated in Symfony 7.1-7.4 will need review:
- Verify Toastify notifications - Verify Toastify notifications
- Check TailwindCSS compilation - Check TailwindCSS compilation
### Phase 5: Bug Fixes (0-2 hours) ### Phase 4: Bug Fixes (0-2 hours)
Address any issues discovered during testing: Address any issues discovered during testing:
@@ -362,7 +333,7 @@ Address any issues discovered during testing:
- Use Symfony Profiler to identify deprecations - Use Symfony Profiler to identify deprecations
- Update code to use modern alternatives - Update code to use modern alternatives
### Phase 6: Deployment (1 hour) ### Phase 5: Deployment (1 hour)
1. **Deploy to Staging** 1. **Deploy to Staging**
```bash ```bash
@@ -415,7 +386,7 @@ ddev exec vendor/bin/dep rollback production
## Testing Checklist ## Testing Checklist
### Unit Tests ### Unit Tests
- [ ] All PHPUnit tests pass - [ ] All PHPUnit tests pass (312 tests)
- [ ] No new deprecation warnings - [ ] No new deprecation warnings
- [ ] Code coverage maintained - [ ] Code coverage maintained
@@ -449,13 +420,12 @@ ddev exec vendor/bin/dep rollback production
| Phase | Estimated Time | Notes | | Phase | Estimated Time | Notes |
|-------|---------------|-------| |-------|---------------|-------|
| **Phase 1:** Pre-Upgrade Fixes | 30 min | Email validation mode config | | **Phase 1:** Preparation | 15 min | Branch creation |
| **Phase 2:** Preparation | 15 min | Branch creation | | **Phase 2:** Dependency Updates | 30 min - 1 hour | composer.json updates, composer update |
| **Phase 3:** Dependency Updates | 30 min - 1 hour | composer.json updates, composer update | | **Phase 3:** Testing & Validation | 1-2 hours | Automated + manual testing |
| **Phase 4:** Testing & Validation | 1-2 hours | Automated + manual testing | | **Phase 4:** Bug Fixes | 0-2 hours | Address any issues |
| **Phase 5:** Bug Fixes | 0-2 hours | Address any issues | | **Phase 5:** Deployment | 1 hour | Staging deployment |
| **Phase 6:** Deployment | 1 hour | Staging deployment | | **Total** | **2.5-6 hours** | Average: **3.5 hours** |
| **Total** | **3-6 hours** | Average: **4 hours** |
--- ---
@@ -472,7 +442,7 @@ Symfony 8.0 was released alongside 7.4 (November 2025) with identical features b
## Success Criteria ## Success Criteria
- [ ] All PHPUnit tests pass - [ ] All PHPUnit tests pass (312 tests)
- [ ] No deprecation warnings in Symfony Profiler - [ ] No deprecation warnings in Symfony Profiler
- [ ] All critical user flows functional - [ ] All critical user flows functional
- [ ] OAuth2 authentication working - [ ] OAuth2 authentication working
@@ -499,7 +469,7 @@ Symfony 8.0 was released alongside 7.4 (November 2025) with identical features b
--- ---
**Document Version:** 4.0 **Document Version:** 5.0
**Previous Version:** 3.0 (Symfony 7.3 plan, dated 2025-10-24) **Previous Version:** 4.0 (dated 2025-12-06)
**Last Updated:** 2025-12-06 **Last Updated:** 2026-01-05
**Status:** Ready for Symfony 7.4 Upgrade **Status:** Ready for Symfony 7.4 Upgrade