diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 82be215..a4c0c3c 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -18,6 +18,13 @@ RUN apk update && apk add \ RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime \ && sed -i "s/^;date.timezone =.*/date.timezone = Europe\/Paris/" $PHP_INI_DIR/php.ini +# pcov, to measure the coverage as the CI (built from its tarball: PECL downloads are unreliable) +RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS linux-headers \ + && curl -sSL https://github.com/krakjoe/pcov/archive/refs/tags/v1.0.12.tar.gz | tar xz -C /tmp \ + && cd /tmp/pcov-1.0.12 && phpize && ./configure && make -j"$(nproc)" && make install \ + && docker-php-ext-enable pcov \ + && cd / && rm -rf /tmp/pcov-1.0.12 && apk del .build-deps + COPY --from=composer:2 /usr/bin/composer /usr/bin/composer RUN usermod -u $UID www-data \ diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 9eef506..c3f0e8c 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -49,6 +49,7 @@ Tested on `main` (``), cleverage/process-bundle x.y, PHP x.y, Symfony x. * Documentation updates - [ ] Reference + - [ ] Cookbooks - [ ] Changelog * [ ] Unit tests diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0086358..8ce78f8 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,8 @@ blank_issues_enabled: true +contact_links: + - name: Security vulnerability + url: https://github.com/cleverage/cache-process-bundle/security/advisories/new + about: Report a security vulnerability privately, never in a public issue. + - name: Documentation + url: https://github.com/cleverage/cache-process-bundle/blob/main/docs/index.md + about: How to install and use the bundle. diff --git a/.github/ISSUE_TEMPLATE/issue.md b/.github/ISSUE_TEMPLATE/issue.md index bb3c922..f0d69c2 100644 --- a/.github/ISSUE_TEMPLATE/issue.md +++ b/.github/ISSUE_TEMPLATE/issue.md @@ -14,6 +14,7 @@ assignees: '' * Documentation updates - [ ] Reference + - [ ] Cookbooks - [ ] Changelog * [ ] Unit tests diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 58db37d..ad8dadf 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,6 +6,7 @@ * Documentation updates - [ ] Reference + - [ ] Cookbooks - [ ] Changelog * [ ] Unit tests diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f5fcaf5..89c38bf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,7 +2,7 @@ # See https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" \ No newline at end of file + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.gitignore b/.gitignore index ca08796..9abb697 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ .phpunit.result.cache .phpunit.cache .php-cs-fixer.cache +/.php-cs-fixer.php coverage-report diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 94f3224..64919cb 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -27,7 +27,7 @@ return (new PhpCsFixer\Config()) ->setRules([ '@PHP8x2Migration' => true, - '@PHPUnit7x5Migration:risky' => true, + '@PHPUnit10x0Migration:risky' => true, '@Symfony' => true, '@Symfony:risky' => true, 'protected_to_private' => false, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5375ee2..b400c2c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,11 +50,13 @@ configured accordingly. ## Deprecations notices -When a feature should be deprecated, or when you have a breaking change for a future version, please : +When a feature should be deprecated, or when you have a breaking change for a future version, please: * [Fill an issue](https://github.com/cleverage/cache-process-bundle/issues/new) -* Add TODO comments with the following format: `@TODO deprecated v2.0` -* Trigger a deprecation error: `@trigger_error('This feature will be deprecated in v2.0', E_USER_DEPRECATED);` +* Trigger a deprecation notice with `trigger_deprecation('cleverage/cache-process-bundle', '', '...')` + (`symfony/deprecation-contracts`), `` being the next minor version, and add a `@deprecated` tag stating + the version of the removal (the next major version) +* Describe the deprecation in the CHANGELOG and in `UPGRADE.md` -You can check which deprecation notice is triggered in tests +The tests fail on any deprecation notice (`failOnDeprecation` in `phpunit.xml.dist`): * `make bash` -* `SYMFONY_DEPRECATIONS_HELPER=0 ./vendor/bin/phpunit` +* `vendor/bin/phpunit` diff --git a/Makefile b/Makefile index 0a58e32..8dc089a 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,24 @@ .ONESHELL: SHELL := /bin/bash +.PHONY: start upd up stop down build ps bash logs quality phpstan php-cs-fixer rector tests phpunit + DOCKER_RUN_PHP = docker compose -f .docker/compose.yaml run --rm php "bash" "-c" DOCKER_COMPOSE = docker compose -f .docker/compose.yaml start: upd #[Global] Start application -src/vendor: #[Composer] install dependencies +vendor: composer.json #[Composer] Install dependencies (again when composer.json changes) $(DOCKER_RUN_PHP) "composer install --no-interaction" upd: #[Docker] Start containers detached touch .docker/.env - make src/vendor + $(MAKE) vendor $(DOCKER_COMPOSE) up --remove-orphans --detach up: #[Docker] Start containers touch .docker/.env - make src/vendor + $(MAKE) vendor $(DOCKER_COMPOSE) up --remove-orphans stop: #[Docker] Down containers @@ -31,7 +33,7 @@ build: #[Docker] Build containers ps: # [Docker] Show running containers $(DOCKER_COMPOSE) ps -bash: #[Docker] Connect to php container with current host user +bash: upd #[Docker] Connect to php container with current host user $(DOCKER_COMPOSE) exec php bash logs: #[Docker] Show logs diff --git a/README.md b/README.md index cb5b76d..3a13c39 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,27 @@ CleverAge/CacheProcessBundle ======================= +[![Test](https://github.com/cleverage/cache-process-bundle/actions/workflows/test.yml/badge.svg)](https://github.com/cleverage/cache-process-bundle/actions/workflows/test.yml) +[![Packagist Version](https://img.shields.io/packagist/v/cleverage/cache-process-bundle)](https://packagist.org/packages/cleverage/cache-process-bundle) +[![License](https://img.shields.io/packagist/l/cleverage/cache-process-bundle)](LICENSE) + This bundle is a part of the [CleverAge/ProcessBundle](https://github.com/cleverage/process-bundle) project. It provides [Cache](https://symfony.com/doc/current/components/cache.html) integration on Process bundle. Compatible with [Symfony stable version and latest Long-Term Support (LTS) release](https://symfony.com/releases). +## Installation + +```bash +composer require cleverage/cache-process-bundle +``` + +Without Symfony Flex, register the bundle in `config/bundles.php`: + +```php +CleverAge\CacheProcessBundle\CleverAgeCacheProcessBundle::class => ['all' => true], +``` + ## Documentation For usage documentation, see: diff --git a/composer.json b/composer.json index 09dec3c..f6813c6 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,12 @@ "role": "Maintainer" } ], + "support": { + "issues": "https://github.com/cleverage/cache-process-bundle/issues", + "source": "https://github.com/cleverage/cache-process-bundle", + "docs": "https://github.com/cleverage/cache-process-bundle/blob/main/docs/index.md", + "security": "https://github.com/cleverage/cache-process-bundle/security/policy" + }, "autoload": { "psr-4": { "CleverAge\\CacheProcessBundle\\": "src/" @@ -72,8 +78,7 @@ }, "config": { "allow-plugins": { - "phpstan/extension-installer": true, - "symfony/runtime": true + "phpstan/extension-installer": true }, "sort-packages": true } diff --git a/tests/Functional/KernelTest.php b/tests/Functional/KernelTest.php index 2af0af7..493a67e 100644 --- a/tests/Functional/KernelTest.php +++ b/tests/Functional/KernelTest.php @@ -75,9 +75,6 @@ public function testPoolsAreWrappedInAnAdapter(): void public function testTasksAreResolvedByCode(): void { - if (!class_exists(TaskRegistry::class)) { - self::markTestSkipped('The tasks are referenced by code since cleverage/process-bundle 5.4.'); - } $processConfigurationRegistry = self::getContainer()->get('test.process_configuration_registry'); self::assertInstanceOf(ProcessConfigurationRegistry::class, $processConfigurationRegistry); $taskRegistry = self::getContainer()->get('test.task_registry');