Skip to content

Commit fdb6a5c

Browse files
Merge branch 'main' into 208
2 parents ce1fee9 + 9ac6829 commit fdb6a5c

57 files changed

Lines changed: 1883 additions & 86 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/ISSUE_TEMPLATE/bug.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Bug report
3+
about: Report a task, transformer or engine behaving incorrectly
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
<!-- What is wrong, in one or two sentences. List each symptom when there are several (wrong output, exception, silent failure...) -->
12+
13+
### Reproduction
14+
15+
<!-- A minimal process configuration reproducing the bug, ideally a demo.* process from https://github.com/cleverage/process-bundle-demo -->
16+
17+
```yaml
18+
clever_age_process:
19+
configurations:
20+
demo.<name>:
21+
tasks:
22+
<task>:
23+
service: '@CleverAge\ProcessBundle\Task\...'
24+
options: {}
25+
outputs: [debug]
26+
debug:
27+
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
28+
```
29+
30+
<!-- Input data, command and actual output -->
31+
32+
```
33+
$ bin/console cleverage:process:execute demo.<name>
34+
```
35+
36+
Expected: `<expected output>`
37+
38+
Tested on `main` (`<commit>`), PHP x.y, Symfony x.y.
39+
40+
### Cause
41+
42+
<!-- Optional: where the bug comes from, with links to the relevant lines -->
43+
44+
### Proposed fix
45+
46+
<!-- Optional: how to fix it, and which documentation must be updated -->
47+
48+
## Requirements
49+
50+
* Documentation updates
51+
- [ ] Reference
52+
- [ ] Cookbooks
53+
- [ ] Changelog
54+
* [ ] Unit tests
55+
56+
## Breaking changes
57+
58+
<!-- Behaviour changes introduced by the fix, or "None" with the reason (e.g. every configuration of this task currently fails) -->

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
name: Feature request / other
3+
about: Propose an enhancement, a refactoring or any other change
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
19
## Description
210

311
<!-- Please describe the issue here -->

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ Latest
99
* [#192](https://github.com/cleverage/process-bundle/issues/192) Fix CommandRunnerTask: only pass the `options` option to `Process::setOptions()`, support string `commandline` through `Process::fromShellCommandline()`, validate option types. Update documentation, add tests.
1010
* [#194](https://github.com/cleverage/process-bundle/issues/194) Fix ProcessLauncherTask: the `process_options` normalizer returned an array despite its scalar return type, so the task always failed with a `TypeError`. Update documentation, add tests.
1111
* [#189](https://github.com/cleverage/process-bundle/issues/189) Fix EventDispatcherTask: dispatch the event under the `event_name` option (regression since v4.0). `event_name` is now optional: when `null` (default), the event is dispatched under its class name. Update documentation, add tests.
12+
* [#198](https://github.com/cleverage/process-bundle/issues/198) Fix DateParserTransformer: a `\DateTimeImmutable` input is converted to a `\DateTime` instead of throwing a `TypeError`. Update documentation, add tests.
13+
* [#199](https://github.com/cleverage/process-bundle/issues/199) Fix PregFilterTransformer: an array `replacement` is no longer cast to the string `"Array"`, and requires an array `pattern`. Update documentation, add tests.
14+
* [#200](https://github.com/cleverage/process-bundle/issues/200) Fix GenericTransformer: a contextual option declared with `required: false` and no default can now be used; its placeholders are replaced by `null` when omitted. Update documentation, add tests.
15+
* [#202](https://github.com/cleverage/process-bundle/issues/202) Fix XmlReaderTask: throw an explicit `\UnexpectedValueException` on an empty file or invalid XML (with the libxml error messages) instead of a `ValueError` or a silent empty `\DOMDocument`. Update documentation, add tests.
16+
* [#203](https://github.com/cleverage/process-bundle/issues/203) Fix `ProcessState::addErrorContextValue()`: accept any value type, so that iterable tasks on an empty iterable are skipped and PropertySetterTask reports the original exception instead of a `TypeError`. Update documentation, add tests.
17+
* [#204](https://github.com/cleverage/process-bundle/issues/204) Fix CachedTransformer, SlugifyTransformer and TypeSetterTransformer edge cases: accept a non-string input in `cached` (key built after `key_transformers`), reject an invalid `transliterator` in `slugify` with an `InvalidOptionsException`, remove the unreachable error branch of `type_setter`. Update documentation, add tests.
18+
* [#205](https://github.com/cleverage/process-bundle/issues/205) Fix FileSplitterTask: produced files lost the first line, doubled line breaks and ended with an empty file; each file now contains exactly `max_lines` lines of the source. Update documentation, add tests.
19+
* [#206](https://github.com/cleverage/process-bundle/issues/206) Fix AdvancedStatCounterTask, IterableBatchTask, ConditionTrait and ColumnAggregatorTask edge cases: log the first counted execution with correct counts, accept a `null` `batch_count` (only flush at the end), allow scalar inputs in conditions (`''` path on the whole value), aggregate `null` column values. Update documentation, add tests.
20+
* [#207](https://github.com/cleverage/process-bundle/issues/207) Fix JsonStreamReaderTask / JsonStreamWriterTask: throw an explicit `\UnexpectedValueException` when a line decodes to a scalar, create the missing parent directory when writing. Update documentation, add tests.
1221
* [#208](https://github.com/cleverage/process-bundle/issues/208) Fix FolderBrowserTask, InputFolderBrowserTask, CsvReaderTask and LineReaderTask (and their `Input*` variants): reset the state at the end of the iteration, so that a following input is read from its beginning. Update documentation, add tests.
1322

1423
## Deprecated

‎docs/03-custom_tasks.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Sometimes, when you execute a task, you need to change how the process continues
8282
`error_strategy` is then applied (throwing an exception from `execute` has the same effect)
8383
* `ProcessState::setErrorOutput($value)`: send a value to the error branch of your workflow (the tasks listed in
8484
`error_outputs`)
85-
* `ProcessState::addErrorContextValue($key, $value)` / `removeErrorContext($key)`: add information to the log record
86-
written when an error occurs
85+
* `ProcessState::addErrorContextValue($key, $value)` / `removeErrorContext($key)`: add information (any value) to the
86+
log record written when an error occurs
8787

8888
## Options
8989

‎docs/reference/03-generic_transformers_definition.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ For each contextual option, you can define
3333
| `default_is_null` | `bool` | | `false` | If you need `null` to be the default value, use this option |
3434

3535
Note that an option with a default value is still required by default, which has no effect since the default is used:
36-
set `required: false` for an option without default value that may be omitted.
36+
set `required: false` for an option without default value that may be omitted: when omitted, its placeholders are
37+
replaced by `null`.
3738

3839
The `transformers` list uses the same syntax as any other transformer using a sub-list of transformers (see
3940
[TransformerTrait](traits/transformer_trait.md)).

‎docs/reference/tasks/advanced_stat_counter_task.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Input is ignored, only the number of executions matters.
1717
Possible outputs
1818
----------------
1919

20-
`null` when statistics are logged, otherwise the task is skipped (nothing is sent to the outputs). It is meant to be
20+
`null` when statistics are logged (with `show_every: 1`, on every counted execution), otherwise the task is skipped (nothing is sent to the outputs). It is meant to be
2121
used as the last task of a branch.
2222

2323
The logged message has the following format:
@@ -33,7 +33,7 @@ Options
3333
|--------------|-------|:--------:|---------|---------------------------------------------------------------------------------------|
3434
| `num_items` | `int` | | `1` | Number of items represented by one execution (multiplier of the counter) |
3535
| `skip_first` | `int` | | `0` | Number of first executions to ignore (the elapsed time still starts at the first one) |
36-
| `show_every` | `int` | | `1` | Log the statistics every N executions (the first counted execution is never logged) |
36+
| `show_every` | `int` | | `1` | Log the statistics every N counted executions (the N-th, 2N-th, ...) |
3737

3838
Examples
3939
--------

‎docs/reference/tasks/column_aggregator_task.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Task reference
1313
Accepted inputs
1414
---------------
1515

16-
`array`: an associative array that should contain the configured `columns` (a column whose value is `null` is
17-
considered missing)
16+
`array`: an associative array that should contain the configured `columns` (a column is present as soon as its key
17+
exists, even if its value is `null`)
1818

1919
Possible outputs
2020
----------------

‎docs/reference/tasks/file_splitter_task.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ file path as input. Any other input is ignored.
1919
Possible outputs
2020
----------------
2121

22-
`string`: path of a temporary file (created in the system temporary directory, with a `.tmp` extension) containing a
23-
chunk of lines of the source file.
22+
`string`: path of a temporary file (created in the system temporary directory, with a `.tmp` extension) containing the
23+
next `max_lines` lines of the source file (the last file may contain fewer lines).
2424

2525
Options
2626
-------
@@ -49,5 +49,8 @@ Notes
4949
-----
5050
5151
* Values given as input are merged after option resolution, so they are not validated.
52+
* Every line of the source file is kept, in order, including empty lines. Line content is preserved, but each line
53+
break (`\n` or `\r\n`) is written as `PHP_EOL`, and a missing line break on the last line is added.
54+
* An empty source file produces no output (the task is skipped).
5255
* Temporary files are not deleted by the task, use [FileRemoverTask](file_remover_task.md) if needed.
5356
* For CSV files, prefer [CsvSplitterTask](csv_splitter_task.md) which keeps the headers in each produced file.

‎docs/reference/tasks/filter_task.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Task reference
1212
Accepted inputs
1313
---------------
1414

15-
`array` or `object`: values are read with the Symfony PropertyAccessor. A non-readable property is considered `null`.
15+
`any`: on an `array` or an `object`, values are read with the Symfony PropertyAccessor; a non-readable property is
16+
considered `null`. On a scalar input, use the empty path `''` to test the whole value (any other path gives `null`).
1617

1718
Possible outputs
1819
----------------

0 commit comments

Comments
 (0)