Skip to content

v5.5

Latest

Choose a tag to compare

@njoubert-cleverage njoubert-cleverage released this 23 Oct 09:45
· 19 commits to main since this release

Changes

  • #365 ArrayElementTransformer (array_element) and ArrayLastTransformer (array_last) return null when the position is outside the array (or the array is empty), without the "Undefined array key" PHP warning (it was an exception in debug mode, null in production); a negative index before the start of the array no longer returns its first element. InputCsvReaderTask (input_csv_reader): an input that is not a path (e.g. null) throws an explicit UnexpectedValueException instead of an "Undefined array key" PHP warning followed by a TypeError. Documentation: rate n/a of advanced_stat_counter, headers: [] of csv_reader / input_csv_reader, optional $accessor of ConditionTrait, ParsedExpression accepted by the condition of rules. Add tests.
  • #337 StopTask (stop): a process stopped on purpose is identified as stopped, not as failed. Its history is flagged as stopped (new ProcessHistory::STATE_STOPPED, setStopped(), isStopped()) instead of failed, the Process <code> stopped log is written at the success_level (instead of Process <code> failed at the failed_level), and the cleverage_process.end event tells it with the new ProcessEvent::isProcessStopped(). The process still ends normally (tasks finalized, exit code 0, parent process going on). Update documentation, add tests.
  • #339 A shared service referenced by several tasks of the same process is rejected when the container is compiled (InvalidArgumentException naming the service, the tasks and the process): all these tasks ran with the same instance, initialized with the options of each task in turn, without error. Declare the task services with shared: false (applied by the autoconfiguration of TaskInterface since 5.4). Update documentation, add tests.
  • #351 ProcessManager and ProcessHelpCommand are typed on TaskRegistryInterface instead of the final TaskRegistry class: the task registry can be decorated or replaced. Add tests.
  • #357 Documentation: input of file_splitter, log_empty_lines of the CSV readers, empty lines of the line readers, invalid regular expressions of the conditions, cache pool of the cached transformer, missing serializer / validator, exceptions of the bundle in the reference pages, failure of a sub-process of process_executor, sleep_on_finalize_interval of process_launcher, initialization failures, process_options of process_launcher in UPGRADE.md.

Fixes

  • #343 The temporary files of FileSplitterTask (file_splitter), CsvSplitterTask (csv_splitter) and of the JSON buffer of ProcessLauncherTask (json_buffering) are created with a random name, exclusively (an existing path, symbolic links included, is never reused) and readable by their owner only, instead of a name derived from the time (uniqid()), opened in w mode with the permissions of the umask. Update documentation, add tests.
  • #331 ProcessManager: the iterable tasks that produced items and the blocking tasks waiting for proceed() are tracked by task configuration instead of task code, and forgotten when their process ends. A task of a sub-process (process_executor) with the same code as a task of the parent no longer makes the parent lose the output of its blocking task (without error) or skip the flush at the end of its iteration (merged batches), and a failed sub-process no longer leaves its tasks to its next execution. Add tests.
  • #333 ProcessManager: restore the previous task configuration (getTaskConfiguration(), read by the log processors for task_code and task_service) when a task, an initialization, a finalization or a sub-process ends. The logs of an iterable task no longer lose their task after its first item, and the logs of a parent process are no longer attributed to a task of its sub-process; the failing task is kept for the logs of the process failure. Add tests.
  • #335 LineReaderTask (line_reader) and InputLineReaderTask (input_line_reader): the last line of a file that does not end with a line break is no longer lost. Add tests.
  • #345 YamlWriterTask (yaml_writer): a write failure throws a RuntimeException instead of a PHP warning (an exception in debug mode only: in production, the path was output as if the file had been written), and the parent directory is created if needed, as for the other writers. Update documentation, add tests.
  • #353 cleverage:process:execute: the process codes and the output format are checked before any process is executed (explicit message for dump without symfony/var-dumper); the output is printed to STDOUT whatever the verbosity when --output-format is given (it required -vv); a non-array output that cannot be stored as JSON stream is reported on the error output instead of being silently lost. Update documentation, add tests.
  • #355 ProcessConfigurationRegistry::reset(), tagged kernel.reset: a long-running worker (Messenger, UI bundle) releases the resolved process configurations, with the task instances and states (inputs, outputs, aggregated data) of their last execution, between two messages. Add tests.