From 1578f6005781780fd7080d6b40a630d0bc4320ce Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 1 Apr 2025 09:42:23 +0200 Subject: [PATCH 1/2] Fixed digital post command. Updated GitHub Actions steps. --- .github/workflows/pr.yml | 12 ++++++------ CHANGELOG.md | 4 ++++ modules/os2forms_digital_post/drush.services.yml | 9 --------- .../src/Drush/Commands/DigitalPostTestCommands.php | 6 ++++++ 4 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 modules/os2forms_digital_post/drush.services.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index f50b23dc..69766ce9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 2 @@ -39,7 +39,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -71,7 +71,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -104,7 +104,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -118,12 +118,12 @@ jobs: name: markdownlint steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - name: Cache yarn packages - uses: actions/cache@v2 + uses: actions/cache@v4 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b72289f..e77a5d9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +- [PR-166](https://github.com/OS2Forms/os2forms/pull/166) + - Fix digital post commands + - Updated versions in GitHub Actions `uses` steps + ## [4.0.0] 2025-03-06 - This is an alias for for 3.22.2. Major change is the module removal, which can lead to lack of backward support. diff --git a/modules/os2forms_digital_post/drush.services.yml b/modules/os2forms_digital_post/drush.services.yml deleted file mode 100644 index ac0d5f8e..00000000 --- a/modules/os2forms_digital_post/drush.services.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - Drupal\os2forms_digital_post\Drush\Commands\DigitalPostTestCommands: - arguments: - - '@Drupal\os2forms_digital_post\Helper\DigitalPostHelper' - - '@token' - - '@plugin.manager.entity_print.print_engine' - - '@Drupal\os2forms_digital_post\Helper\Settings' - tags: - - { name: drush.command } diff --git a/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php b/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php index 248452a3..201581c5 100644 --- a/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php +++ b/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php @@ -3,6 +3,7 @@ namespace Drupal\os2forms_digital_post\Drush\Commands; use Drupal\Component\Serialization\Yaml; +use Drupal\Core\DependencyInjection\AutowireTrait; use Drupal\Core\Utility\Token; use Drupal\entity_print\Plugin\EntityPrintPluginManagerInterface; use Drupal\os2forms_digital_post\Helper\DigitalPostHelper; @@ -12,20 +13,25 @@ use ItkDev\Serviceplatformen\Service\SF1601\SF1601; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface; /** * Test commands for digital post. */ class DigitalPostTestCommands extends DrushCommands { + use AutowireTrait; /** * Constructor. */ public function __construct( + #[Autowire(service: DigitalPostHelper::class)] private readonly DigitalPostHelper $digitalPostHelper, private readonly Token $token, + #[Autowire(service: 'plugin.manager.entity_print.print_engine')] private readonly EntityPrintPluginManagerInterface $entityPrintPluginManager, + #[Autowire(service: Settings::class)] private readonly Settings $digitalPostSettings, ) { } From 9ad3ea86429a6c14a184afe963d6e9374826c93d Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Tue, 1 Apr 2025 11:16:21 +0200 Subject: [PATCH 2/2] Cleaned up changelog --- CHANGELOG.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e77a5d9b..f53f5b14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,9 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [4.0.0] 2025-03-06 -- This is an alias for for 3.22.2. Major change is the module removal, which can lead to lack of backward support. -See full release note here: -https://github.com/OS2Forms/os2forms_docs/blob/master/docs/releases/2024-Q4-Release-notes.md +- This is an alias for for 3.22.2. Major change is the module removal, which can + lead to lack of backward support. See full release note here: + ## [3.22.2] 2025-02-28 @@ -94,9 +94,8 @@ https://github.com/OS2Forms/os2forms_docs/blob/master/docs/releases/2024-Q4-Rele ## [3.16.0] 2024-08-27 f/OS-115_dawa_address -- [OS-115] Skipping empty maktrikula objects - +- [OS-115] Skipping empty maktrikula objects [#110](https://github.com/OS2Forms/os2forms/pull/110)