Flex processor overview

Flex Process is a versatile Drupal module designed to empower developers with the ability to attach customizable processor plugins to various data structures. This tool allows developers to define specific processing workflows for their data, enabling dynamic manipulation and transformation.

How it works

This module provides the ability to create data processor plugins in a simple way. Every time a data, form now on data component, is sent to be processed, the corresponding plugin matching that data component type is executed. The processors plugin are defined in a flexible way that any kind of processing task is allowed. How to process to process the data component is up to the developer, and they needs.

Project Link

https://www.drupal.org/project/flex_processor

Comments

ivan.lansky created an issue. See original summary.

vishal.kadam’s picture

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

vishal.kadam’s picture

Status: Needs review » Needs work

Fix phpcs issues.

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml flex_processor/

FILE: flex_processor/flex_processor.services.yml
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------

FILE: flex_processor/README.md
----------------------------------------------------------------------------
FOUND 28 ERRORS AND 6 WARNINGS AFFECTING 28 LINES
----------------------------------------------------------------------------
   3 | WARNING | [ ] Line exceeds 80 characters; contains 292 characters
   8 | WARNING | [ ] Line exceeds 80 characters; contains 407 characters
  12 | WARNING | [ ] Line exceeds 80 characters; contains 145 characters
  16 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
  54 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
  56 | ERROR   | [x] Expected 1 blank line after function; 0 found
  57 | ERROR   | [x] The closing brace for the class must have an empty line before it
  64 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
  65 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
  70 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
  74 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 6
  77 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
  87 | ERROR   | [x] Expected 1 space after "<"; 0 found
  87 | ERROR   | [x] Expected 1 space before "?"; 0 found
  87 | ERROR   | [x] Expected 1 space after "?"; 0 found
 129 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\flex_processor\Component\DataComponent.
 131 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
 132 | ERROR   | [ ] The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
 135 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
 137 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
 142 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
 160 | WARNING | [x] A comma should follow the last multiline array item. Found: }
 176 | ERROR   | [x] Expected 1 space after "<"; 0 found
 176 | ERROR   | [x] Expected 1 space before "?"; 0 found
 176 | ERROR   | [x] Expected 1 space after "?"; 0 found
 183 | ERROR   | [x] Missing class doc comment
 207 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 228 | ERROR   | [x] Expected 1 space after "<"; 0 found
 228 | ERROR   | [x] Expected 1 space before "?"; 0 found
 228 | ERROR   | [x] Expected 1 space after "?"; 0 found
 266 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
 268 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 2
 273 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 4
 276 | ERROR   | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 29 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------

FILE: flex_processor/flex_processor.info.yml
----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------
 7 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------
perecedero.’s picture

Status: Needs work » Needs review

Hi!
Thanks for your time to make the review.

Is it common to analyze MD files with PHPCS? I had to add some exceptions to make it work properly.

vishal.kadam’s picture

Yes, It is common to analyze MD files with PHPCS.

Rest seems fine to me. Let’s wait for other reviewers to take a look and if everything goes fine, you will get the role.

perecedero.’s picture

Priority: Normal » Major

I am changing priority as per Issue priorities.

perecedero.’s picture

Priority: Major » Critical

I am changing priority as per Issue priorities.

perecedero.’s picture

Hi, is there something else I need to do/complete to get a review?

vishal.kadam’s picture

Issue summary: View changes
Priority: Critical » Normal
Status: Needs review » Needs work

1. FILE: README.md

The README file is missing the required sections, including Requirements, Installation, and Configuration.

2. FILE: src/Component/DataComponent.php

  /**
   * DataComponent constructor.
   *
   * @param string $bundle
   *   The bundle of the data component.
   * @param array<string, mixed> $data
   *   The multi-dimensional array data.
   */
  public function __construct(string $bundle, array $data) {

FILE: src/Event/UnknownDataProcessorEvent.php

  /**
   * Pass in connector config by default to all events.
   *
   * @param mixed $dataSource
   *   The unknown data source about to be processed.
   * @param string $variant
   *   The processor variant requested for the data source.
   */
  public function __construct(mixed $dataSource, string $variant) {

FILE: src/Plugin/DataProcessorBase.php

  /**
   * {@inheritdoc}
   */
  public function __construct(

FILE: src/Plugin/DataProcessorManager.php

  /**
   * Constructor for TaskPluginManager objects.
   *
   * @param \Traversable $namespaces
   *   An object that implements \Traversable which contains the root paths
   *   keyed by the corresponding namespace to look for plugin implementations.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
   *   Cache backend instance to use.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler to invoke the alter hook with.
   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
   *   The event dispatcher.
   */
  public function __construct(

The documentation comment for constructors is not mandatory anymore, If it is given, the description must be Constructs a new [class name] object. where [class name] includes the class namespace.

perecedero.’s picture

Status: Needs work » Needs review

All reported issues were fixed.

avpaderno’s picture

Is it common to analyze MD files with PHPCS?

Always check what GitLab CI reports, for example in https://git.drupalcode.org/project/flex_processor/-/jobs/5362640.
For what I recall, GitLab CI does not check .md files with PHP_CodeSniffer.
It checks CSS files, but those sniffs are going to be deprecated, as reported by GitLab CI.

This sniff has been deprecated since v3.9.0 and will be removed in v4.0.0. Support for scanning CSS files will be
removed completely in v4.0.0.

perecedero.’s picture

Hi avpaderno, thanks for your message!. Were you able to take a look at the module? I would love to have your feedback

perecedero.’s picture

Priority: Normal » Major

I am changing priority as per Issue priorities.

bbu23’s picture

Hi! Thanks for your contribution!

Feedback:
1. Since Drupal 10.2 is already EOL and your module is in early stages, you should consider converting your plugins to Attribute-based instead of Annotation. It's up to you if you want to keep backwards compatibility, but I'd just increase the minimum core requirement to 10.2 and permanently remove Annotations. Also, your plugin name should be prefixed with your module name: e.g. SearchApiProcessor for search_api module, MigrateSource for migrate module etc.

2. The module does not have a dev release.

3. It is recommended to prefix your event names with your module name to avoid conflicts with other modules. Example for user module events: 'user.flood_blocked_user' or 'user.flood_blocked_ip'.

4. If you are planning on using semantic versioning for your module, it might be better to start using branches like 1.0.x, 1.1.x, but if the current branch 1.x is as expected, then ignore this.

bbu23’s picture

Status: Needs review » Needs work
avpaderno’s picture

Priority: Major » Normal
avpaderno’s picture

Priority: Normal » Minor

I am changing priority as per Issue priorities.

avpaderno’s picture

This thread has been idle, in the needs work state with no activity for some months.

May you confirm you are still pursuing this application? If this is the case, and you made commits basing on what previously reported, or you can answer the questions previously asked, please change the status to Needs review.

avpaderno’s picture

Status: Needs work » Closed (won't fix)

This thread has been idle, in the Needs work state with no activity for about six months or more; the application has been created about 11 months ago or more. Therefore, I marked it as Closed (won't fix).

If this is incorrect, and you are still pursuing this application, please feel free to re-open it and set the issue status to Needs work or Needs review, depending on the current status of your code.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.