Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update worker config to use cronjobs #63

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Conversation

shyim
Copy link
Member

@shyim shyim commented Nov 9, 2023

No description provided.

Copy link

github-actions bot commented Nov 9, 2023

Thanks for the PR 😍

How to test these changes in your application

  1. Add the Shopware flex endpoint in your composer.json to https://raw.githubusercontent.com/shopware/recipes/flex/pull-63/index.json.

    # When jq is installed
    jq '.extra.symfony.endpoint |= [ "https://raw.githubusercontent.com/shopware/recipes/flex/pull-63/index.json" ] + .' composer.json > composer.tmp && mv composer.tmp composer.json

    or manually

    "endpoint": [
        "https://raw.githubusercontent.com/shopware/recipes/flex/pull-63/index.json",
        "https://raw.githubusercontent.com/shopware/recipes/flex/main/index.json",
        "flex://defaults"
    ]
  2. Install the package(s) related to this recipe:

    composer req 'doctrine/annotations:^1.0' 'enqueue/dbal:^0.10' 'enqueue/enqueue-bundle:^0.10' 'enqueue/redis:^0.10' 'frosh/code-quality-meta:^0.2' 'frosh/devenv-meta:^0.2' 'frosh/gitpod-meta:^6.4' 'shopware/administration:^6.4' 'shopware/core:^6.4' 'shopware/dev-tools:^1.0' 'shopware/docker:^0.1' 'shopware/elasticsearch:^6.4' 'shopware/fastly-meta:^6.4' 'shopware/paas-meta:^6.4' 'shopware/platform:^6.4' 'shopware/storefront:^6.4' 'sroze/messenger-enqueue-transport:^0.4' 'symfony/console:^5.4' 'symfony/framework-bundle:^5.4' 'symfony/messenger:^6.0' 'symfony/monolog-bundle:^3.3' 'symfony/routing:^5.4' 'symfony/translation:^5.4' 'symfony/twig-bundle:^5.4'

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

frosh/code-quality-meta

0.1 vs 0.2
diff --git a/frosh/code-quality-meta/0.1/root/rector.php b/frosh/code-quality-meta/0.2/root/rector.php
index 30bc217..3ca7dca 100644
--- a/frosh/code-quality-meta/0.1/root/rector.php
+++ b/frosh/code-quality-meta/0.2/root/rector.php
@@ -4,13 +4,12 @@ declare(strict_types=1);
 
 use Frosh\Rector\Set\ShopwareSetList;
 use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
-use Rector\CodeQuality\Rector\Foreach_\SimplifyForeachToArrayFilterRector;
 use Rector\Config\RectorConfig;
 use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
 use Rector\PostRector\Rector\NameImportingPostRector;
 use Rector\Set\ValueObject\LevelSetList;
 use Rector\Set\ValueObject\SetList;
-use Rector\Symfony\Rector\Return_\SimpleFunctionAndFilterRector;
+use Rector\Symfony\Twig134\Rector\Return_\SimpleFunctionAndFilterRector;
 use Rector\Symfony\Set\SymfonySetList;
 
 return static function (RectorConfig $rectorConfig): void {
@@ -27,7 +26,6 @@ return static function (RectorConfig $rectorConfig): void {
 
     $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
     $rectorConfig->rule(NameImportingPostRector::class);
-    $rectorConfig->rule(SimplifyForeachToArrayFilterRector::class);
     $rectorConfig->rule(SimpleFunctionAndFilterRector::class);
 
     $rectorConfig->sets([
@@ -37,9 +35,11 @@ return static function (RectorConfig $rectorConfig): void {
         SymfonySetList::SYMFONY_60,
         SymfonySetList::SYMFONY_61,
         SymfonySetList::SYMFONY_62,
+        SymfonySetList::SYMFONY_63,
         SymfonySetList::SYMFONY_CODE_QUALITY,
         SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
         LevelSetList::UP_TO_PHP_81,
+        LevelSetList::UP_TO_PHP_82,
         ShopwareSetList::SHOPWARE_6_5_0,
     ]);
 
diff --git a/frosh/code-quality-meta/0.1/vendor-bin/rector/composer.json b/frosh/code-quality-meta/0.2/vendor-bin/rector/composer.json
index 801401b..7f86567 100644
--- a/frosh/code-quality-meta/0.1/vendor-bin/rector/composer.json
+++ b/frosh/code-quality-meta/0.2/vendor-bin/rector/composer.json
@@ -1,6 +1,6 @@
 {
     "require-dev": {
-        "rector/rector": "^0.15.24",
-        "frosh/shopware-rector": "^0.1.0"
+        "rector/rector": "^0.17.3",
+        "frosh/shopware-rector": "^0.2.2"
     }
 }

frosh/devenv-meta

0.1 vs 0.2
diff --git a/frosh/devenv-meta/0.1/root/devenv.nix b/frosh/devenv-meta/0.2/root/devenv.nix
index b3e5d88..b0751e7 100644
--- a/frosh/devenv-meta/0.1/root/devenv.nix
+++ b/frosh/devenv-meta/0.2/root/devenv.nix
@@ -8,12 +8,12 @@
 
   languages.javascript = {
     enable = lib.mkDefault true;
-    package = lib.mkDefault pkgs.nodejs-16_x;
+    package = lib.mkDefault pkgs.nodejs-18_x;
   };
 
   languages.php = {
     enable = lib.mkDefault true;
-    version = lib.mkDefault "8.1";
+    version = lib.mkDefault "8.2";
 
     ini = ''
       memory_limit = 2G
@@ -98,9 +98,6 @@
   env.MAILER_DSN = lib.mkDefault "smtp://127.0.0.1:1025";
   env.DATABASE_URL = lib.mkDefault "mysql://shopware:[email protected]:3306/shopware";
 
-  # Webpack compatibility
-  env.NODE_OPTIONS = lib.mkDefault "--openssl-legacy-provider";
-
   # Shopware 6 related scripts
   scripts.build-js.exec = lib.mkDefault "bin/build-js.sh";
   scripts.build-storefront.exec = lib.mkDefault "bin/build-storefront.sh";

symfony/messenger

5.4 vs 6.0
diff --git a/symfony/messenger/5.4/config/packages/messenger.yaml b/symfony/messenger/6.0/config/packages/messenger.yaml
index ce25a11..672b6c4 100644
--- a/symfony/messenger/5.4/config/packages/messenger.yaml
+++ b/symfony/messenger/6.0/config/packages/messenger.yaml
@@ -1,8 +1,5 @@
 framework:
     messenger:
-        # reset services after consuming messages
-        reset_on_message: true
-
         # Uncomment this (and the failed transport below) to send failed messages to this transport for later handling.
         # failure_transport: failed
 
@@ -15,3 +12,11 @@ framework:
         routing:
             # Route your messages to the transports
             # 'App\Message\YourMessage': async
+
+# when@test:
+#    framework:
+#        messenger:
+#            transports:
+#                # replace with your transport name here (e.g., my_transport: 'in-memory://')
+#                # For more Messenger testing tools, see https://github.com/zenstruck/messenger-test
+#                async: 'in-memory://'

@vrobert78
Copy link
Contributor

@shyim the crons directive is currently missing in your PR, right before line 213 scheduler.
It should be something like:

crons:
    scheduler:
        spec: '*/5 * * * *'
        cmd: 'php bin/console scheduled-task:run --no-wait'

@shyim shyim force-pushed the update-worker-cfg branch from 9b9624a to a914b9d Compare November 20, 2023 12:41
@shyim shyim force-pushed the update-worker-cfg branch from a914b9d to 91d92f1 Compare November 20, 2023 12:42
@shyim shyim merged commit 4155c75 into main Nov 20, 2023
1 of 2 checks passed
@shyim shyim deleted the update-worker-cfg branch November 20, 2023 12:43
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