Skip to content

CO-3490: Fix changelog extractor flow and unify QA workflows - #37

Open
Andreas Kempe (AndreasKempeJTL) wants to merge 27 commits into
developfrom
CO-3490-changelog-extractor-not-working
Open

Andreas Kempe (AndreasKempeJTL) wants to merge 27 commits into
developfrom
CO-3490-changelog-extractor-not-working

Conversation

@AndreasKempeJTL

Copy link
Copy Markdown
Contributor

Summary

  • keep changelog update trigger on release.published
  • remove auto-draft PR workflow
  • unify QA check workflow structure per project constraints
  • make build/deploy depend on central check workflow (no duplicated QA logic)

Notes

  • PHP matrix follows each project's composer requirements
  • no unrelated local changes included (e.g. .gitignore/composer.lock)

BREAKING CHANGE: Minimum PHP version raised from 7.4 to 8.2.
Multiple major dependency upgrades require consumers to align.

Dependencies upgraded:
- PHP >=7.4 -> >=8.2
- symfony/* ^5.0|^6.0 -> ^8.0 (console, event-dispatcher, filesystem, finder, http-foundation)
- doctrine/dbal ^3.0 -> ^4.0
- doctrine/collections ^2.2 -> ^3.0
- monolog/monolog ^2.0|^3.0 -> ^3.0
- php-di/php-di ^6.0 -> ^7.0
- phpunit/phpunit ^9.0 -> ^11.0
- phpstan/phpstan ^1.0 -> ^2.0
- squizlabs/php_codesniffer ^3.10 -> ^4.0
- slevomat/coding-standard ^8.15 -> ^8.29
- micheh/phpcs-gitlab ^1.1 -> ^2.0
- jtl/connector-cq * -> ^2.0
- mockery/mockery ^1.3 -> ^1.6

Dependencies removed:
- doctrine/annotations (zero usage)
- doctrine/cache (zero usage)
- jtl/unit-test (helpers inlined into tests/src/dbc/TestCase.php)

DBAL 4 migration:
- Rewrite QueryBuilder to track query type internally (INSERT/UPDATE/DELETE/SELECT)
- Replace execute() with executeQuery()/executeStatement()
- Replace fetch()/fetchAll() with fetchAssociative()/fetchAllAssociative()
- Replace getSchemaManager() with createSchemaManager()
- Replace Schema::getMigrateToSql() with Comparator + Platform::getAlterSchemaSQL()
- Replace Type::getName() with TypeRegistry::lookupName()
- Replace Connection::PARAM_STR_ARRAY with ArrayParameterType::STRING
- Replace DBALException with Exception, SchemaException with ColumnDoesNotExist::new()
- Replace ConversionException::conversionFailedInvalidType() with InvalidType::new()
- Add normalizeIntrospectedSchema() for SQLite type round-trip mismatches
- Update platform class references (MySqlPlatform -> MySQLPlatform, SqlitePlatform -> SQLitePlatform)
- Update connection params (driver key mandatory, pdo key removed)

Symfony 8 migration:
- Replace removed Request::get() with Request::request->get() / Request::query->get()
- Replace Request mock with real Request in tests (typed  property)

Monolog 3 / PHP-DI 7:
- Remove useAnnotations(true) call
- Clean up backward-compat union type hints in logger processors/handlers

PHPUnit 11 migration:
- Convert 69 @dataProvider annotations to #[DataProvider()] attributes across 27 files
- Make all data provider methods static
- Convert @Depends to #[Depends()], @runInSeparateProcess to #[RunInSeparateProcess]
- Replace setMethods() with onlyMethods()
- Remove SebastianBergmann\RecursionContext\InvalidArgumentException (85 occurrences, 45 files)
- Remove invalid PHPUnit MockObject exception imports and @throws (~260 annotations)
- Fix unqualified exception names in @throws to prevent namespace misresolution
- Inline jtl/unit-test reflection helpers into tests/src/dbc/TestCase.php
- Update phpunit.xml.dist schema to 11.5, replace <coverage> with <source>

PHPStan 2 migration:
- Fix ~148 errors across ~47 files at level max
- Narrow mixed types before binary ops, casts, foreach, offset access
- Remove redundant type checks (instanceof, is_int, is_string, is_array, is_object)
- Fix ReflectionClass template covariance (inline instead of property)
- Add @var annotations for superglobals and loosely-typed returns
- Extract typed variables from method chains for static analysis

phpcs 4 / slevomat 8.29:
- Auto-fix 364 @throws annotation ordering violations across 77 files
- Console command: $defaultName property -> #[AsCommand] attribute
Replace the single Mockery usage in IdentityLinkerTest with PHPUnit's
built-in createMock(). Sequential return values are handled via
willReturnCallback() with array queues. This also removes the transitive
hamcrest/hamcrest-php dependency.
…oSubscriber for empty language value"

This reverts commit 85f8adf.
… as success

DBAL 4 executeStatement() returns int; using > 0 would return false on an
idempotent UPDATE (0 rows changed), breaking the previous contract where any
non-exception result was considered success. Reverts to >= 0 to match
delete() and clear() semantics.
- src/dbc/DbManager.php: SchemaManagerFactory no longer used after
  schema diffing was rewritten with Comparator
- tests/src/dbc/TestCase.php: AbstractPlatform and Result were leftover
  from removed jtl/unit-test helpers
- tests/src/dbc/DbManagerStub.php: RuntimeException import not referenced
- RequestParamsTransformSubscriberTest: three docblocks had bare
  "\Exception" lines without the @throws tag prefix
- SqliteSessionHandlerTest: @throws \InvalidArgumentException was
  listed twice in testWriteInsert() and testWriteUpdate()
- DbManagerStub: duplicate @throws DbcRuntimeException on getSchemaTables()
feat!: upgrade all dependencies to current stable versions
CO-3450: the too-large exception referenced the numeric ZipArchive
loop index instead of the affected entry's name, making it impossible
to identify which image exceeded the 20MB limit from the error alone.
…_add_composer_lock

change php min requ to php8.3, fix language bug in LanguageIsoSubscriber for empty language value
…to_too_large_error

bugfix/CO-3450_add_image_id_to_too_large_error
Remove is_array() checks made redundant by prior @var docblock casts,
guard mixed getData() before offset access and fromISO_639_2b() call,
and drop non-throwable @throws tags (AnnotationException doesn't
exist; unqualified InvalidArgumentException resolved to the wrong
namespace instead of the global SPL class already listed alongside it).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates CI/workflow automation (QA checks + changelog update on releases) and aligns the PHP codebase/dependencies with updated runtime/tooling requirements, while also tightening a serializer edge case.

Changes:

  • Adds centralized GitHub Actions workflows for checks and changelog updates (triggered on release.published).
  • Updates PHP dependencies/tooling and raises the Composer PHP platform requirement to >=8.3.
  • Hardens LanguageIsoSubscriber::onPreDeserialize() handling for non-array/non-string input; adjusts related tests.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/src/Serializer/Subscriber/LanguageIsoSubscriberTest.php Updates JSON exception constant usage and test annotations for compatibility.
src/Serializer/Subscriber/LanguageIsoSubscriber.php Adds input-type guards before converting languageISO to languageIso.
src/Serializer/Subscriber/CrossSellingSubscriber.php Alters pre-deserialize handling for items (now less strict about type).
src/Controller/ConnectorController.php Adjusts features parsing logic for entities/flags (now less strict about type).
composer.json Updates dependency constraints and sets PHP requirement to >=8.3.
composer.lock Lockfile updates reflecting dependency/tooling changes and PHP platform bump.
.github/workflows/update-changelog.yaml Adds a release-published triggered reusable workflow for changelog updates.
.github/workflows/check.yaml Adds a consolidated “Check” workflow for lint + PHP static analysis + tests.

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

Comment thread src/Serializer/Subscriber/CrossSellingSubscriber.php
Comment thread src/Controller/ConnectorController.php
Comment thread src/Controller/ConnectorController.php

jobs:
update-changelog:
uses: jtl-software/changelog-extractor/.github/workflows/update-changelog.yaml@CO-3490-changelog-extractor-not-working # v2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

valid, please check again Andreas Kempe (@AndreasKempeJTL)

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.

3 participants