Skip to content

Feature/dev setup#8

Open
turegjorup wants to merge 14 commits intodevelopfrom
feature/dev_setup
Open

Feature/dev setup#8
turegjorup wants to merge 14 commits intodevelopfrom
feature/dev_setup

Conversation

@turegjorup
Copy link

Link to ticket

https://leantime.itkdev.dk/TimeTable/TimeTable?showTicketModal=7041&fromDate=2026-03-23&toDate=2026-03-29#/tickets/showTicket/7041

Description

Summary

  • Modernize dev environment with ITK Dev docker setup, Taskfile, and multi-PHP test matrix (8.3, 8.4, 8.5)
  • Replace monolithic pr.yaml workflow with dedicated CI workflows (changelog, composer, PHP, markdown, YAML)
  • Upgrade to PHPUnit 12 and bump minimum PHP to 8.3
  • Fix all PHPStan errors at max level with proper type annotations
  • Add tests for error paths and Token model, raising line coverage from ~71% to 94%

Changes

Dev environment

  • Add Taskfile.yml with tasks for linting, testing, analysis, and a full CI matrix runner
  • Update docker-compose.yml with PHP 8.3/8.4/8.5 services and per-version vendor volume isolation
  • Add PHPStan config (phpstan.neon), markdownlint config, and LICENSE.md
  • Update .php-cs-fixer.dist.php to preserve @var PHPDoc annotations

CI workflows

  • Delete pr.yaml (used shivammathur/setup-php, outdated actions)
  • Add individual workflows: changelog.yaml, composer.yaml, php.yaml, markdown.yaml, yaml.yaml, github_build_release.yml

Code quality

  • Bump php requirement from >=8.2 to >=8.3 (required by PHPUnit 12)
  • Upgrade phpunit/phpunit from ^11.3 to ^12.0 and update phpunit.xml schema
  • Add dev dependencies: phpstan/phpstan, rector/rector, ergebnis/composer-normalize, symfony/runtime
  • Fix 41 PHPStan errors: type-narrow cache returns, add @var annotations for json_decode, use JSON_THROW_ON_ERROR on json_encode

Tests

  • Add TokenTest covering isExpired(), used(), usesLeft()
  • Add 8 error-path tests to VaultTest: HTTP client failures, vault error responses, missing keys, cache refresh bypass, version parameter
  • Line coverage: 94% (80/85 lines)

Test plan

  • task test:matrix — all 6 combinations pass (PHP 8.3/8.4/8.5 × lowest/stable)
  • task analyze:php — PHPStan max level, no errors
  • task lint:php — php-cs-fixer clean
  • task test:coverage — 94.12% line coverage

Screenshot of the result

If your change affects the user interface, you should include a screenshot of the result with the pull request.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

If your code does not pass all the requirements on the checklist, you have to add a comment explaining why this change
should be exempt from the list.

Additional comments or questions

If you have any further comments or questions for the reviewer, please add them here.

turegjorup and others added 9 commits March 24, 2026 10:49
Add Taskfile, PHPStan config, LICENSE, README badges, and
update docker-compose with PHP 8.3-8.5 matrix services.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split pr.yaml into dedicated workflows for changelog, composer,
markdown, PHP (coding standards, PHPStan, unit tests), and YAML linting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump phpunit/phpunit from ^11.3 to ^12.0, add dev dependencies
(phpstan, rector, composer-normalize, symfony/runtime), and update
phpunit.xml for PHPUnit 12 schema compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add type annotations for json_decode results, narrow cache return
types with instanceof/is_array checks, and specify generic return
types for getSecrets().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allow @var PHPDoc annotations via phpdoc_to_comment ignored_tags,
and bump minimum PHP version to match PHPUnit 12 requirement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add TokenTest covering isExpired, used, and usesLeft methods.
Add VaultTest error path tests for HTTP failures, vault error
responses, missing keys, cache refresh, and version parameter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@turegjorup turegjorup requested a review from cableman March 24, 2026 10:19
@turegjorup turegjorup self-assigned this Mar 24, 2026
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

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