Skip to content

Commit 255156b

Browse files
Merge remote-tracking branch 'origin/main'
2 parents 4b9c407 + cdcfc19 commit 255156b

33 files changed

Lines changed: 426 additions & 173 deletions

.docker/php/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.2-fpm-alpine
1+
FROM php:8.4-fpm-alpine
22

33
ARG UID
44
ARG GID

.github/workflows/quality.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install PHP with extensions
2020
uses: shivammathur/setup-php@v2
2121
with:
22-
php-version: '8.2'
22+
php-version: '8.4'
2323
coverage: none
2424
tools: composer:v2
2525
- name: Install Composer dependencies (locked)
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install PHP with extensions
3737
uses: shivammathur/setup-php@v2
3838
with:
39-
php-version: '8.2'
39+
php-version: '8.4'
4040
coverage: none
4141
tools: composer:v2
4242
- name: Install Composer dependencies (locked)
@@ -53,7 +53,7 @@ jobs:
5353
- name: Install PHP with extensions
5454
uses: shivammathur/setup-php@v2
5555
with:
56-
php-version: '8.2'
56+
php-version: '8.4'
5757
coverage: none
5858
tools: composer:v2
5959
- name: Install Composer dependencies (locked)
@@ -70,7 +70,7 @@ jobs:
7070
- name: Install PHP with extensions
7171
uses: shivammathur/setup-php@v2
7272
with:
73-
php-version: '8.2'
73+
php-version: '8.4'
7474
coverage: none
7575
tools: composer:v2
7676
- name: Install Composer dependencies (locked)

.github/workflows/test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ jobs:
2222
php-version:
2323
- '8.2'
2424
- '8.3'
25+
- '8.4'
2526
dependencies: [highest]
2627
allowed-to-fail: [false]
2728
symfony-require: ['']
2829
variant: [normal]
2930
include:
31+
- php-version: '8.1'
32+
dependencies: highest
33+
allowed-to-fail: false
34+
symfony-require: 6.4.*
35+
variant: symfony/symfony:"6.4.*"
3036
- php-version: '8.2'
3137
dependencies: highest
3238
allowed-to-fail: false
@@ -35,8 +41,8 @@ jobs:
3541
- php-version: '8.2'
3642
dependencies: highest
3743
allowed-to-fail: false
38-
symfony-require: 7.1.*
39-
variant: symfony/symfony:"7.1.*"
44+
symfony-require: 7.3.*
45+
variant: symfony/symfony:"7.3.*"
4046
- php-version: '8.3'
4147
dependencies: highest
4248
allowed-to-fail: false
@@ -45,8 +51,18 @@ jobs:
4551
- php-version: '8.3'
4652
dependencies: highest
4753
allowed-to-fail: false
48-
symfony-require: 7.1.*
49-
variant: symfony/symfony:"7.1.*"
54+
symfony-require: 7.3.*
55+
variant: symfony/symfony:"7.3.*"
56+
- php-version: '8.4'
57+
dependencies: highest
58+
allowed-to-fail: false
59+
symfony-require: 6.4.*
60+
variant: symfony/symfony:"6.4.*"
61+
- php-version: '8.4'
62+
dependencies: highest
63+
allowed-to-fail: false
64+
symfony-require: 7.3.*
65+
variant: symfony/symfony:"7.3.*"
5066

5167
steps:
5268
- name: Checkout

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
v2.3
2+
------
3+
4+
## Changes
5+
6+
* [#60](https://github.com/cleverage/ui-process-bundle/issues/60) Upgrade to Symfony 7.3 & PHP 8.4
7+
8+
## Fixes
9+
10+
* [#57](https://github.com/cleverage/ui-process-bundle/issues/57) add arguments to pass username and password to cleverage:ui-process:user-create
11+
* [#60](https://github.com/cleverage/ui-process-bundle/issues/60) Fix php version to >=8.1 according to cleverage/process-bundle
12+
* [#60](https://github.com/cleverage/ui-process-bundle/issues/60) Fix PHP 8.1 restrictions
13+
14+
v2.2
15+
------
16+
17+
## Changes
18+
19+
* [#54](https://github.com/cleverage/ui-process-bundle/issues/54) When Launch process via http request, add queue parameter which define if the process should be queued (default) or directly run
20+
21+
v2.1.1
22+
------
23+
24+
## Fixes
25+
26+
* [#52](https://github.com/cleverage/ui-process-bundle/issues/52) Fix ProcessScheduleRepository definition to be bundled compliant
27+
28+
v2.1
29+
------
30+
31+
## Fixes
32+
33+
* [#42](https://github.com/cleverage/ui-process-bundle/issues/42) composer require dragonmantank/cron-expression because CronExpressionTrigger needs it
34+
* [#40](https://github.com/cleverage/ui-process-bundle/issues/40) Fix localisation issues
35+
* [#45](https://github.com/cleverage/ui-process-bundle/issues/45) Implement store_in_database & [database|file]_level configuration. Update documentation with full configuration.
36+
37+
38+
## Changes
39+
40+
* [#34](https://github.com/cleverage/ui-process-bundle/issues/34) Improve process launch using http call.
41+
* [#33](https://github.com/cleverage/ui-process-bundle/issues/33) Add duration filter on Process Execution Crud.
42+
* [#47](https://github.com/cleverage/ui-process-bundle/issues/47) Add Troubleshooting section on documentation
43+
144
v2.0.2
245
------
346

composer.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737
},
3838
"require": {
39-
"php": ">=8.2",
39+
"php": ">=8.1",
4040
"ext-ctype": "*",
4141
"ext-iconv": "*",
4242
"cleverage/process-bundle": "^4.0",
@@ -47,13 +47,13 @@
4747
"doctrine/orm": "^2.9 || ^3.0",
4848
"dragonmantank/cron-expression": "^3.4",
4949
"easycorp/easyadmin-bundle": "^4.8",
50-
"symfony/doctrine-messenger": "^6.4|^7.1",
51-
"symfony/dotenv": "^6.4|^7.1",
52-
"symfony/messenger": "^6.4|^7.1",
53-
"symfony/runtime": "^6.4|^7.1",
54-
"symfony/scheduler": "^6.4|^7.1",
55-
"symfony/string": "^6.4|^7.1",
56-
"symfony/uid": "^6.4|^7.1"
50+
"symfony/doctrine-messenger": "^6.4|^7.3",
51+
"symfony/dotenv": "^6.4|^7.3",
52+
"symfony/messenger": "^6.4|^7.3",
53+
"symfony/runtime": "^6.4|^7.3",
54+
"symfony/scheduler": "^6.4|^7.3",
55+
"symfony/string": "^6.4|^7.3",
56+
"symfony/uid": "^6.4|^7.3"
5757
},
5858
"require-dev": {
5959
"doctrine/doctrine-fixtures-bundle": "^3.4",
@@ -65,11 +65,11 @@
6565
"phpunit/phpunit": "<10.0",
6666
"rector/rector": "*",
6767
"roave/security-advisories": "dev-latest",
68-
"symfony/browser-kit": "^6.4|^7.1",
69-
"symfony/css-selector": "^6.4|^7.1",
70-
"symfony/debug-bundle": "^6.4|^7.1",
68+
"symfony/browser-kit": "^6.4|^7.3",
69+
"symfony/css-selector": "^6.4|^7.3",
70+
"symfony/debug-bundle": "^6.4|^7.3",
7171
"symfony/maker-bundle": "^1.31",
72-
"symfony/web-profiler-bundle": "^6.4|^7.1",
72+
"symfony/web-profiler-bundle": "^6.4|^7.3",
7373
"vincentlanglet/twig-cs-fixer": "^3.3"
7474
},
7575
"conflict": {

config/services/controller.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ services:
1414
$processExecutionRepository: '@cleverage_ui_process.repository.process_execution'
1515
$intlFormatter: '@EasyCorp\Bundle\EasyAdminBundle\Intl\IntlFormatter'
1616
$translator: '@translator'
17+
$processManager: '@cleverage_process.manager.process'
1718
tags:
1819
- { name: 'controller.service_arguments' }

config/services/http_value_resolver.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ services:
55
public: false
66
arguments:
77
- '%upload_directory%'
8+
- '@serializer'
89

910
cleverage_ui_process.http_value_resolver.process_configuration:
1011
class: CleverAge\UiProcessBundle\Http\ValueResolver\ProcessConfigurationValueResolver

config/services/repository.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ services:
99
class: CleverAge\UiProcessBundle\Repository\ProcessScheduleRepository
1010
public: false
1111
arguments:
12-
- '@doctrine'
13-
12+
- '@doctrine.orm.entity_manager'

docs/index.md

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,40 @@ Remember to add the following line to `config/bundles.php` (not required if Symf
1919
CleverAge\UiProcessBundle\CleverAgeUiProcessBundle::class => ['all' => true],
2020
```
2121

22-
## Import routes
22+
## Configuration
23+
24+
### Import routes
2325

2426
```yaml
2527
ui-process-bundle:
2628
resource: '@CleverAgeUiProcessBundle/src/Controller'
2729
type: attribute
2830
```
31+
32+
### Doctrine ORM Configuration
33+
2934
* Run doctrine migration
3035
* Create a user using `cleverage:ui-process:user-create` console.
3136

3237
Now you can access UI Process via http://your-domain.com/process
3338

39+
## Full configuration
40+
41+
```yaml
42+
# config/packages/clever_age_ui_process.yaml
43+
44+
clever_age_ui_process:
45+
security:
46+
roles: ['ROLE_ADMIN'] # Roles displayed inside user edit form
47+
logs:
48+
store_in_database: true # enable/disable store log in database (log_record table)
49+
database_level: Debug (on dev env) or Info # min log level to store log record in database
50+
file_level: Debug (on dev env) or Info # min log level to store log record in file
51+
report_increment_level: Warning # min log level to increment process execution report
52+
design:
53+
logo_path: 'bundles/cleverageuiprocess/logo.jpg' # logo displayed in UI navigation toolbar
54+
```
55+
3456
## Features
3557

3658
### Launch process via UI
@@ -51,17 +73,36 @@ That's all, now you can launch a process via http post request
5173

5274
***Curl sample***
5375
```bash
54-
make bash
55-
curl --location 'http://apache2/http/process/execute?code=demo.die' \
56-
--header 'Authorization: Bearer 3da8409b5f5b640fb0c43d68e8ac8d23' \
57-
--form 'input=@"/file.csv"' \
58-
--form 'context[context_1]="FOO"' \
59-
--form 'context[context_2]="BAR"'
76+
curl --location 'http://localhost/http/process/execute' \
77+
--header 'Authorization: Bearer myBearerToken' \
78+
--form 'code="demo.upload_and_run"' \
79+
--form 'input="/path/to/your/file.csv"' \
80+
--form 'context="{\"foo\": \"bar\", \"delimiter\": \";\"}"'
6081
```
82+
83+
```bash
84+
curl --location 'http://localhost/http/process/execute' \
85+
--header 'Content-Type: application/json' \
86+
--header 'Authorization: Bearer d641d254aed12733758a3a4247559868' \
87+
--header 'Cookie: PHPSESSID=m8l9s5sniknv1b0jb798f8sri7; main_auth_profile_token=2f3d24' \
88+
--data '{
89+
"code": "demo.die",
90+
"context": {"foo": "bar"}
91+
}'
92+
```
93+
94+
```bash
95+
curl --location 'http://localhost/http/process/execute' \
96+
--header 'Authorization: Bearer myBearerToken' \
97+
--form 'code="demo.dummy"' \
98+
--form 'queue="false"'
99+
```
100+
61101
* Query string code parameter must be a valid process code
62102
* Header Authorization: Bearer is the previously generated token
63103
* input could be string or file representation
64-
* context you can pass multiple context values
104+
* you can pass multiple context values
105+
* queue define if the process should be queued (default) or directly run
65106

66107

67108
### Scheduler
@@ -78,12 +119,12 @@ See more details about ***messenger:consume*** command in consume message sectio
78119
## Consume Messages
79120
Symfony messenger is used in order to run process via UI or schedule process
80121

81-
*To consume process launched via UI make sure the following command is running*
122+
* To consume process launched via UI make sure the following command is running*
82123
```bash
83124
bin/console messenger:consume execute_process
84125
```
85126

86-
*To consume scheduled process make sure the following command is running*
127+
* To consume scheduled process make sure the following command is running*
87128
```bash
88129
bin/console messenger:consume scheduler_cron
89130
```
@@ -131,6 +172,18 @@ killasgroup=true
131172
stopasgroup=true
132173
```
133174
134-
## Reference
175+
## Troubleshooting
176+
177+
### PHP Fatal error: Allowed memory size of xxx bytes exhausted
178+
179+
When `store_in_database` option is set, with lower value of `database_level` option, the process may generate many LogRecord.
180+
On debug environment, profiling too much queries cause memory exhaustion. So, you can :
181+
- Set `doctrine.dbal.profiling_collect_backtrace: false`
182+
- Increase `memory_limit` in php.ini
183+
- Set `clever_age_ui_process.logs.store_in_database: false` or improve value of `clever_age_ui_process.logs.database_level`
184+
- Use `--no-debug` flag for `cleverage:process:execute`
185+
186+
### {"message":"Missing auth token."} Response when launch process via http request
135187
136-
_TODO_
188+
If you use apache2 webserver, `SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1` VirtualHost directive must be
189+
uncomment to "force Apache to pass the Authorization header to PHP: required for "basic_auth" under PHP-FPM and FastCGI"

rector.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,25 @@
33
declare(strict_types=1);
44

55
use Rector\Config\RectorConfig;
6-
use Rector\Doctrine\Set\DoctrineSetList;
76
use Rector\Set\ValueObject\LevelSetList;
87
use Rector\Symfony\Set\SymfonySetList;
98
use Rector\ValueObject\PhpVersion;
109

1110
return RectorConfig::configure()
12-
->withPhpVersion(PhpVersion::PHP_82)
11+
->withPhpVersion(PhpVersion::PHP_84)
1312
->withPaths([
1413
__DIR__.'/src',
1514
__DIR__.'/tests',
1615
])
17-
->withPhpSets(php82: true)
16+
->withPhpSets(php81: true)
1817
// here we can define, what prepared sets of rules will be applied
19-
->withPreparedSets(
20-
deadCode: true,
21-
codeQuality: true
22-
)
18+
->withComposerBased(doctrine: true)
19+
->withPreparedSets(deadCode: true, codeQuality: true, doctrineCodeQuality: true, symfonyCodeQuality: true)
20+
->withAttributesSets(symfony: true, doctrine: true)
2321
->withSets([
24-
LevelSetList::UP_TO_PHP_82,
22+
LevelSetList::UP_TO_PHP_81,
2523
SymfonySetList::SYMFONY_64,
26-
SymfonySetList::SYMFONY_71,
2724
SymfonySetList::SYMFONY_CODE_QUALITY,
2825
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
29-
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
30-
DoctrineSetList::DOCTRINE_CODE_QUALITY,
31-
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
3226
])
3327
;

0 commit comments

Comments
 (0)