Skip to content

FOUR-32353: automatic Laravel Octane detection - #8948

Open
rodriquelca wants to merge 6 commits into
feature/FOUR-30918from
feature/FOUR-32353
Open

FOUR-32353: automatic Laravel Octane detection#8948
rodriquelca wants to merge 6 commits into
feature/FOUR-30918from
feature/FOUR-32353

Conversation

@rodriquelca

@rodriquelca rodriquelca commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Issue & Reproduction Steps

At boot, ProcessMaker auto-registers ResetRequestState on Octane’s RequestTerminated event. After every request, static request state is cleared so the next user never inherits the previous one.

Solution

  • Added automatic Laravel Octane detection; no environment flag is required.
  • Registered a RequestTerminated listener to clean request-specific state after every request.
  • Added ResetRequestState to reset query timing and redirect state, preventing data from leaking between users.
  • Added tests covering state cleanup and automatic listener registration.
image

How to Test

  1. Run the Octane unit tests:
    ./vendor/bin/phpunit tests/unit/ProcessMaker/Octane/ResetRequestStateTest.php
    Confirm all 3 tests pass.
  2. Start Octane and open the app (processmaker-octane.test or http://127.0.0.1:8001).
  3. Confirm response headers include Server: FrankenPHP Caddy (or the Octane server in use).
  4. Complete a request that would set redirect state, then make a second request as another user/session and confirm no leftover redirect/data from the previous request.
  5. Stop Octane and run the app under normal PHP-FPM/Herd; confirm it still works (the listener registers but only fires under Octane).

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

ci:deploy

@rodriquelca
rodriquelca requested a review from caleeli July 29, 2026 15:49
@rodriquelca rodriquelca changed the title Feature/four 32353 FOUR-32353: automatic Laravel Octane detection Jul 29, 2026
@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-9afff01859.engk8s.processmaker.net

@gitguardian

gitguardian Bot commented Jul 30, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
34069781 Triggered Generic Password 2ec84b1 resources/views/auth/newLogin.blade.php View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@processmaker-sonarqube

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube

@vladyrichter

Copy link
Copy Markdown

QA server K8S was successfully deployed https://ci-9afff01859.engk8s.processmaker.net

@pmPaulis

Copy link
Copy Markdown
Contributor

@rodriquelca
please check those unit test issues
Transition Executors (Tests\Feature\Console\TransitionExecutors)

✘ Invalid uuid fails
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:34
  │
✘ Numeric id is rejected
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:45
  │
✘ Missing executor fails
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:58
  │
✘ Default executor fails
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:75
  │
✘ All skips defaults and includes custom and non default null type
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:130
  │
✘ Single custom executor success by uuid
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:160
  │
✘ Single non default null type succeeds
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:187
  │
✘ All stops on status error
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:239
  │
✘ All stops on request exception
  │
  │ Symfony\Component\Console\Exception\InvalidArgumentException: The "uuid" argument does not exist.
  │
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:186
  │ /opt/processmaker/vendor/symfony/console/Input/ArrayInput.php:125
  │ /opt/processmaker/vendor/symfony/console/Input/Input.php:53
  │ /opt/processmaker/vendor/symfony/console/Command/Command.php:238
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Command.php:249
  │ /opt/processmaker/vendor/symfony/console/Application.php:1121
  │ /opt/processmaker/vendor/symfony/console/Application.php:379
  │ /opt/processmaker/vendor/symfony/console/Application.php:218
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Console/Application.php:165
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:447
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:451
  │ /opt/processmaker/vendor/laravel/framework/src/Illuminate/Testing/PendingCommand.php:675
  │ /opt/processmaker/tests/Feature/Console/TransitionExecutorsTest.php:289
  │

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants