Skip to content

Commit 41ad63a

Browse files
chore: make ready for store (#1)
Co-authored-by: Felix Schneider <felix.schneider@wimmelbach.de>
1 parent f9fbfcb commit 41ad63a

29 files changed

Lines changed: 612 additions & 242 deletions

.github/workflows/code-style.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Code Style
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
cs:
11+
if: github.event_name != 'schedule'
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Run CS
18+
uses: shopware/github-actions/extension-verifier@main
19+
with:
20+
action: format
21+
22+
check:
23+
runs-on: ubuntu-24.04
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
version-selection: [ 'lowest', 'highest']
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Run Check
33+
uses: shopware/github-actions/extension-verifier@main
34+
with:
35+
action: check
36+
check-against: ${{ matrix.version-selection }}

.github/workflows/store-info.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Update Store Info
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-store-info:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- name: Install shopware-cli
15+
uses: shopware/shopware-cli-action@v1
16+
- name: Build
17+
shell: bash
18+
run: shopware-cli account producer extension info push .
19+
env:
20+
SHOPWARE_CLI_ACCOUNT_EMAIL: ${{ secrets.ACCOUNT_USER }}
21+
SHOPWARE_CLI_ACCOUNT_PASSWORD: ${{ secrets.ACCOUNT_PASSWORD }}

.github/workflows/store.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build extension
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
uses: shopware/github-actions/.github/workflows/store-release.yml@main
11+
with:
12+
extensionName: ${{ github.event.repository.name }}
13+
secrets:
14+
clientId: ${{ secrets.SHOPWARE_CLI_ACCOUNT_CLIENT_ID }}
15+
clientSecret: ${{ secrets.SHOPWARE_CLI_ACCOUNT_CLIENT_SECRET }}
16+
ghToken: ${{ secrets.GITHUB_TOKEN }}

.shopware-extension.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
store:
2+
availabilities:
3+
- German
4+
- International
5+
default_locale: en_GB
6+
localizations:
7+
- de_DE
8+
- en_GB
9+
categories:
10+
- Administration
11+
type: extension
12+
icon: src/Resources/config/plugin.png
13+
automatic_bugfix_version_compatibility: true
14+
description:
15+
de: file:src/Resources/store/de.md
16+
en: file:src/Resources/store/en.md
17+
installation_manual:
18+
de: file:src/Resources/store/de_manual.md
19+
en: file:src/Resources/store/en_manual.md
20+
tags:
21+
de:
22+
- Flow
23+
- Flow Builder
24+
en:
25+
- Flow
26+
- Flow Builder
27+
videos:
28+
de: []
29+
en: []
30+
highlights:
31+
de:
32+
- Ausführungshistorie für jeden Flow
33+
- Fehler-Tracking mit Exception-Details im Flow-Detail
34+
- Erfasst Auslöser (Benutzer, Integration, Kunde)
35+
- FroshTools Health-Check (optional)
36+
en:
37+
- Execution history for every flow
38+
- Error tracking with exception details on the flow detail page
39+
- Captures the trigger (user, integration, customer)
40+
- FroshTools health check (optional)
41+
features:
42+
de:
43+
- Flow-Ausführungshistorie
44+
- Fehler-Tracking während der Flow-Ausführung
45+
- Event-Payload-Inspektion
46+
- Auslöser-Erkennung (Benutzer/Integration/Kunde)
47+
- Geplante Bereinigung der Protokolle
48+
- Optionaler FroshTools Check
49+
en:
50+
- Flow execution history
51+
- Error tracking during flow execution
52+
- Event payload inspection
53+
- Trigger detection (user/integration/customer)
54+
- Scheduled cleanup of logs
55+
- Optional FroshTools check
56+
faq:
57+
de: []
58+
en: []
59+
images:
60+
- file: src/Resources/store/img-0.png
61+
activate:
62+
de: true
63+
en: true
64+
preview:
65+
de: true
66+
en: true
67+
priority: 0
68+
- file: src/Resources/store/img-1.png
69+
activate:
70+
de: true
71+
en: true
72+
preview:
73+
de: false
74+
en: false
75+
priority: 0
76+
build:
77+
zip:
78+
assets:
79+
enable_es_build_for_admin: true
80+
enable_es_build_for_storefront: false
81+
npm_strict: true
82+
composer:
83+
enabled: true
84+
changelog:
85+
enabled: true

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Friends of Shopware
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Frosh Flow Builder
2+
3+
This plugin extends the Shopware 6 Flow Builder with execution history and error tracking.
4+
5+
The current feature set consists of:
6+
7+
- **Flow Execution History**
8+
- Records every flow execution (success and error) in a dedicated `frosh_flow_state` table
9+
- Adds a history tab to the Flow detail page in the administration
10+
- Captures which user, integration or customer triggered the flow
11+
- Stores the event payload
12+
- **Error Inspection**
13+
- Persists exception message, file, line and class for failed flow executions
14+
- Modal viewer to inspect the stored event data and error details
15+
- **Automatic Cleanup**
16+
- Scheduled task removes old flow history entries based on a configurable retention time
17+
- Default retention: 30 days (configurable in plugin configuration)
18+
- **FroshTools Integration (optional)**
19+
- Health check that reports the number of failed flow executions in the system status
20+
- Activates automatically when `frosh/tools` is installed
21+
22+
## Installation
23+
24+
### Git
25+
- Clone this repository into custom/plugins of your Shopware 6 installation
26+
- Install composer dependencies `shopware-cli extension prepare custom/plugins/FroshFlowBuilder`
27+
- Build the assets with `shopware-cli extension build custom/plugins/FroshFlowBuilder`
28+
- Install and activate via `bin/console plugin:refresh && bin/console plugin:install --activate FroshFlowBuilder`
29+
30+
### Packagist
31+
composer require frosh/frosh-flow-builder
32+
bin/console plugin:refresh
33+
bin/console plugin:install --activate FroshFlowBuilder
34+
35+
## Configuration
36+
37+
Configure the plugin via the administration (Settings → Extensions → Frosh Flow Builder) or via system config:
38+
39+
| Key | Default | Description |
40+
|-----|---------|-------------|
41+
| `retentionTime` | `30` | Number of days after which flow history entries are deleted by the cleanup scheduled task |
42+
43+
## Requirements
44+
45+
- Shopware 6.7 or higher
46+
47+
## Scheduled Tasks
48+
49+
| Task | Description |
50+
|------|-------------|
51+
| `Frosh\FlowBuilder\ScheduledTask\CleanupFlowStateTableTask` | Deletes flow execution history entries older than the configured retention time |

composer.json

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,48 @@
11
{
2-
"name": "frosh-flow-builder/frosh-flow-builder",
3-
"description": "frosh-flow-builder/frosh-flow-builder",
2+
"name": "frosh/flow-builder",
3+
"description": "Extends the Shopware 6 Flow Builder with history and error tracking",
4+
"license": "MIT",
45
"type": "shopware-platform-plugin",
56
"version": "1.0.0",
6-
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "FriendsOfShopware",
10+
"homepage": "https://friendsofshopware.com"
11+
}
12+
],
713
"require": {
14+
"shopware/administration": "~6.7.0",
815
"shopware/core": "~6.7.0"
916
},
17+
"autoload": {
18+
"psr-4": {
19+
"Frosh\\FlowBuilder\\": "src/"
20+
}
21+
},
1022
"extra": {
11-
"shopware-plugin-class": "Frosh\\FlowBuilder\\FroshFlowBuilder",
23+
"description": {
24+
"de-DE": "Erweitert den Shopware 6 Flow Builder um eine Historie und Fehler-Tracking. Jede Flow-Ausführung wird protokolliert, die Fehler-Details sind in der Flow-Detailseite sichtbar.",
25+
"en-GB": "Extends the Shopware 6 Flow Builder with history and error tracking. Every flow run is logged, failed flows store exception details on the flow detail page."
26+
},
1227
"label": {
1328
"de-DE": "Flow Builder",
1429
"en-GB": "Flow Builder"
30+
},
31+
"manufacturerLink": {
32+
"de-DE": "https://github.com/FriendsOfShopware/FroshFlowBuilder",
33+
"en-GB": "https://github.com/FriendsOfShopware/FroshFlowBuilder"
34+
},
35+
"shopware-plugin-class": "Frosh\\FlowBuilder\\FroshFlowBuilder",
36+
"supportLink": {
37+
"de-DE": "https://github.com/FriendsOfShopware/FroshFlowBuilder/issues",
38+
"en-GB": "https://github.com/FriendsOfShopware/FroshFlowBuilder/issues"
1539
}
1640
},
17-
"autoload": {
18-
"psr-4": {
19-
"Frosh\\FlowBuilder\\": "src/"
20-
}
41+
"scripts": {
42+
"check": [
43+
"docker run --rm -v $(pwd):/ext shopware/shopware-cli:latest extension validate --check-against lowest --full /ext",
44+
"docker run --rm -v $(pwd):/ext shopware/shopware-cli:latest extension validate --check-against highest --full /ext"
45+
],
46+
"format": "docker run --rm -v $(pwd):/ext shopware/shopware-cli:latest extension format /ext"
2147
}
2248
}

phpstan.neon.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
level: 8
3+
paths:
4+
- src
5+
reportUnmatchedIgnoredErrors: false
6+
ignoreErrors:
7+
-
8+
message: "#no value type specified in iterable type array#"
9+
excludePaths:
10+
- src/FroshTools
11+
- vendor (?)

src/Entity/FlowState/FlowStateDefinition.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required;
1313
use Shopware\Core\Framework\DataAbstractionLayer\Field\IdField;
1414
use Shopware\Core\Framework\DataAbstractionLayer\Field\JsonField;
15-
use Shopware\Core\Framework\DataAbstractionLayer\Field\LongTextField;
1615
use Shopware\Core\Framework\DataAbstractionLayer\Field\ManyToOneAssociationField;
1716
use Shopware\Core\Framework\DataAbstractionLayer\Field\StringField;
1817
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;

src/FroshTools/Checker/FlowExecutionErrorChecker.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@
1111

1212
class FlowExecutionErrorChecker implements CheckerInterface, HealthCheckerInterface
1313
{
14-
1514
public function __construct(
1615
private readonly Connection $connection,
17-
)
18-
{
16+
) {
1917
}
2018

2119
public function collect(HealthCollection $collection): void
2220
{
2321
$numberOfFailedFlows = $this->connection->fetchOne('SELECT COUNT(*) FROM frosh_flow_state WHERE state = :errorState LIMIT 1;', [
24-
'errorState' => FlowSubscriber::FLOW_STATE_ERROR
22+
'errorState' => FlowSubscriber::FLOW_STATE_ERROR,
2523
]);
2624

2725
if ($numberOfFailedFlows > 0) {

0 commit comments

Comments
 (0)