Skip to content

Update CI runner to ubuntu-22.04#60

Merged
wachterjohannes merged 4 commits into
masterfrom
fix/update-ubuntu-runner
May 19, 2026
Merged

Update CI runner to ubuntu-22.04#60
wachterjohannes merged 4 commits into
masterfrom
fix/update-ubuntu-runner

Conversation

@wachterjohannes
Copy link
Copy Markdown
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets -
Related issues/PRs #59
License MIT

What's in this PR?

Replace ubuntu-20.04 with ubuntu-22.04 for the test workflow runner.

Why?

The ubuntu-20.04 GitHub Actions runner image is no longer available, so CI jobs hang waiting for a runner until they hit the 24h timeout. See GitHub's changelog and sulu/sulu#7615 for reference.

The ubuntu-20.04 runner image is no longer available, causing jobs to
hang waiting for a runner. See:
https://github.blog/changelog/2025-01-15-github-actions-ubuntu-20-runner-image-brownout-dates-and-other-breaking-changes/
@wachterjohannes
Copy link
Copy Markdown
Member Author

This PR addresses the CI runner image issue per @alexander-schranz' comment on #59. With the runner updated to ubuntu-22.04, the jobs now actually execute (instead of timing out waiting for the retired ubuntu-20.04 image).

The pipeline runs now surface pre-existing failures that are not caused by this PR (verified on master locally):

  1. PHP 8.0–8.4 (all storages)TypeError: TaskExecutionRepository::create(): Argument #2 must be DateTimeImmutable, DateTime given from vendor/php-task/php-task/src/Task/Scheduler/TaskScheduler.php:110. Upstream TaskScheduler passes getNextRunDate() (returns \DateTime from dragonmantank/cron-expression) into an interface requiring \DateTimeImmutable. Needs an upstream fix in php-task/php-task 3.x.
  2. PHP 8.x array storageCall to undefined method ArrayTaskRepository::findAll() / ArrayTaskExecutionRepository::findAll(). Tests still call findAll() but the vendor repositories only expose findAllPaginated().
  3. PHP 8.1+ doctrine storageOperation "Doctrine\DBAL\Platforms\SQLitePlatform::getCreateDatabaseSQL" is not supported by platform. DBAL 3+ no longer supports getCreateDatabaseSQL for SQLite; tests/app/console doctrine:database:create needs a different approach (or just schema:create, which auto-creates the SQLite file).

These can be tackled in follow-up PRs once the runner is unblocked.

- Update CI runner from ubuntu-20.04 to ubuntu-22.04
- Replace 'doctrine:database:create' (unsupported on DBAL 3 SQLite
  platform) with a touch on the sqlite file before schema:create
- Pin symfony/var-exporter to ^6.4 || ^7.0 so doctrine/orm 3.6 can find
  ProxyHelper::generateLazyGhost, which was removed in Symfony 8
- Widen TaskExecutionRepository::create to accept DateTimeInterface and
  normalize to DateTimeImmutable, so DateTime returned by
  CronExpression::getNextRunDate() in upstream TaskScheduler is accepted
- Add ArrayTaskExecutionRepository subclass that performs the same
  normalization for array storage and initializes the result field so
  getResult() returns null instead of false (unserialize(null) === false)
- Update tests to call findAllPaginated() instead of removed findAll()
Comment thread src/Resources/config/storage/array.xml Outdated
<services>
<service id="task.storage.task" class="Task\Storage\ArrayStorage\ArrayTaskRepository" public="true"/>
<service id="task.storage.task_execution" class="Task\Storage\ArrayStorage\ArrayTaskExecutionRepository" public="true"/>
<service id="task.storage.task_execution" class="Task\TaskBundle\Storage\ArrayStorage\ArrayTaskExecutionRepository" public="true"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reverted in b1a79a9 — the subclass was only there to mirror the workaround above, so it's gone too. Fix needs to happen upstream in TaskScheduler.

Comment thread src/Entity/TaskExecutionRepository.php Outdated
* {@inheritdoc}
*/
public function create(TaskInterface $task, \DateTimeImmutable $scheduleTime)
public function create(TaskInterface $task, \DateTimeInterface $scheduleTime)
Copy link
Copy Markdown
Member

@alexander-schranz alexander-schranz May 19, 2026

Choose a reason for hiding this comment

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

this does not reflect the interface: https://github.com/php-task/php-task/blob/2c9685e1188a0054a28f2036a449fdc293563c63/src/Task/Storage/TaskExecutionRepositoryInterface.php#L30

So I would not do that I think it more requires handling converting DateTime to DateTimeImmutable on caller side.

This is else a BC Break.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch — you're right, widening the parameter is a BC break. Reverted in b1a79a9. The conversion has to happen in the upstream TaskScheduler (which is where the DateTime from CronExpression::getNextRunDate() enters the call). I'll open a follow-up PR on php-task/php-task.

@wachterjohannes
Copy link
Copy Markdown
Member Author

Follow-up upstream fix opened: php-task/php-task#54 — fixes the caller-side DateTimeDateTimeImmutable conversion in TaskScheduler::scheduleTask (plus the related getResult() quirk and the broken syntax in the upstream test suite). Once that's merged & tagged, the php-task/php-task constraint here can be bumped and CI will go green on this PR without any caller-side workarounds.

Revert the changes that altered TaskExecutionRepository::create() to
accept DateTimeInterface and that subclassed the upstream
ArrayTaskExecutionRepository. The interface requires DateTimeImmutable
and widening it breaks BC for consumers. The conversion belongs on the
caller side (upstream TaskScheduler in php-task/php-task), not on every
TaskExecutionRepository implementation.
@wachterjohannes wachterjohannes force-pushed the fix/update-ubuntu-runner branch from b1a79a9 to 6a33385 Compare May 19, 2026 12:57
@wachterjohannes wachterjohannes merged commit 3364fda into master May 19, 2026
11 checks passed
@wachterjohannes wachterjohannes deleted the fix/update-ubuntu-runner branch May 19, 2026 12:58
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