From 1da25919cd7c4641d64b116263a980af10f0b313 Mon Sep 17 00:00:00 2001 From: Nicolas Joubert Date: Thu, 8 Oct 2026 17:06:32 +0200 Subject: [PATCH] cleverage/ui-process-bundle#62 - Add demo.ui.notification and demo.ui.notification_failing Co-Authored-By: Claude Opus 5.5 (1M context) --- .env | 5 ++++ composer.json | 2 ++ config/packages/notifier.yaml | 10 +++++++ .../process/demo.ui.notification.yaml | 27 +++++++++++++++++++ .../process/demo.ui.notification_failing.yaml | 19 +++++++++++++ symfony.lock | 21 +++++++++++++++ 6 files changed, 84 insertions(+) create mode 100644 config/packages/notifier.yaml create mode 100644 config/packages/process/demo.ui.notification.yaml create mode 100644 config/packages/process/demo.ui.notification_failing.yaml diff --git a/.env b/.env index 5590f5a..5de03a5 100644 --- a/.env +++ b/.env @@ -57,3 +57,8 @@ WIREMOCK_URL=http://wiremock:8080 # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands DEFAULT_URI=http://process-bundle-demo.localhost ###< symfony/routing ### + +###> symfony/fake-chat-notifier ### +# Notifications of the process executions written in the logs (cleverage/ui-process-bundle#62) +FAKE_CHAT_DSN=fakechat+logger://default +###< symfony/fake-chat-notifier ### diff --git a/composer.json b/composer.json index 2a08056..40b76e6 100644 --- a/composer.json +++ b/composer.json @@ -19,9 +19,11 @@ "league/flysystem-sftp-v3": "^3.0", "symfony/cache": "^6.4 || ^7.4 || ^8", "symfony/cache-contracts": "^3", + "symfony/fake-chat-notifier": "^6.4 || ^7.4 || ^8", "symfony/flex": "^v2.3", "symfony/framework-bundle": "^6.4 || ^7.4 || ^8", "symfony/http-kernel": "^6.4 || ^7.4 || ^8", + "symfony/notifier": "^6.4 || ^7.4 || ^8", "symfony/password-hasher": "^6.4 || ^7.4 || ^8", "symfony/scheduler": "^6.4 || ^7.4 || ^8" }, diff --git a/config/packages/notifier.yaml b/config/packages/notifier.yaml new file mode 100644 index 0000000..2923c87 --- /dev/null +++ b/config/packages/notifier.yaml @@ -0,0 +1,10 @@ +framework: + notifier: + chatter_transports: + # Notifications written in the logs ("notifier" channel), see the demo.ui.notification* processes + fakechat: '%env(FAKE_CHAT_DSN)%' + channel_policy: + urgent: ['chat/fakechat'] + high: ['chat/fakechat'] + medium: ['chat/fakechat'] + low: ['chat/fakechat'] diff --git a/config/packages/process/demo.ui.notification.yaml b/config/packages/process/demo.ui.notification.yaml new file mode 100644 index 0000000..b433549 --- /dev/null +++ b/config/packages/process/demo.ui.notification.yaml @@ -0,0 +1,27 @@ +clever_age_process: + configurations: + demo.ui.notification: + description: > + Notification of the end of a process execution (cleverage/ui-process-bundle#62): the process logs a + warning, so it finishes with a report ({"Warning": 1}) and the "finish_with_report" status is notified. + The notification is enabled by the process options (it is disabled by default) and sent with the + fakechat transport, which writes it in the logs ("notifier" channel). + help: > + Ex: bin/console cleverage:process:execute demo.ui.notification -vv + options: + ui: + source: Foo + target: Bar + notification: + enabled: true + tasks: + entry: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' + options: + output: 'data' + outputs: [log] + log: + service: '@CleverAge\ProcessBundle\Task\Reporting\LoggerTask' + options: + message: Warning counted in the report of the process execution + level: warning diff --git a/config/packages/process/demo.ui.notification_failing.yaml b/config/packages/process/demo.ui.notification_failing.yaml new file mode 100644 index 0000000..61562c4 --- /dev/null +++ b/config/packages/process/demo.ui.notification_failing.yaml @@ -0,0 +1,19 @@ +clever_age_process: + configurations: + demo.ui.notification_failing: + description: > + Notification of a failed process execution (cleverage/ui-process-bundle#62): the ConstantOutputTask + misses its required "output" option, the process fails and the "failed" status is notified, with the + error. The notification is enabled by the process options (it is disabled by default) and sent with + the fakechat transport, which writes it in the logs ("notifier" channel). + help: > + Ex: bin/console cleverage:process:execute demo.ui.notification_failing -vv + options: + ui: + source: Foo + target: Bar + notification: + enabled: true + tasks: + entry: + service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask' diff --git a/symfony.lock b/symfony.lock index 7d66216..47e368d 100644 --- a/symfony.lock +++ b/symfony.lock @@ -171,6 +171,15 @@ "config/packages/debug.yaml" ] }, + "symfony/fake-chat-notifier": { + "version": "7.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.3", + "ref": "25bdcc3ae00d284b863f1faecf14610aecebfeb5" + } + }, "symfony/flex": { "version": "2.4", "recipe": { @@ -249,6 +258,18 @@ "config/packages/monolog.yaml" ] }, + "symfony/notifier": { + "version": "7.4", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "5.0", + "ref": "178877daf79d2dbd62129dd03612cb1a2cb407cc" + }, + "files": [ + "config/packages/notifier.yaml" + ] + }, "symfony/property-info": { "version": "7.3", "recipe": {