Skip to content

FOUR-32268: [SPIKE] Add runtime Smart Extract configuration#8908

Draft
eiresendez wants to merge 1 commit into
developfrom
spike/FOUR-32268
Draft

FOUR-32268: [SPIKE] Add runtime Smart Extract configuration#8908
eiresendez wants to merge 1 commit into
developfrom
spike/FOUR-32268

Conversation

@eiresendez

@eiresendez eiresendez commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Issue

Smart Extract currently resolves its dashboard URL, API host, OAuth credentials, and HITL flag from deployment-time configuration. FOUR-32268 is a Spike/PoC to validate whether authorized administrators can manage these settings through ProcessMaker Environment Variables and have updates applied on the next request or queue job without a deployment, configuration-cache clear, or worker restart.

Solution

  • Add a scoped SmartExtractConfiguration service that lazily loads and decrypts the five Smart Extract settings in one query per request or job lifecycle.
  • Use the runtime database values in core task and HITL flows, with missing or invalid HITL configuration failing closed.
  • Preserve SMART_EXTRACT_API_HOST loaded from Environment Variables in both local Docker and script microservice runners instead of overwriting it from Laravel configuration.
  • Add coverage for configuration loading, lifecycle refreshes, HITL task behavior, and both script-runner paths.
  • Keep the PoC free of schema and API response-shape changes.

How to Test

Run:

vendor/bin/phpunit \
  tests/unit/ProcessMaker/Services/SmartExtractConfigurationTest.php \
  tests/unit/ProcessMaker/ScriptRunners/SmartExtractEnvironmentVariablesTest.php \
  tests/unit/ProcessMaker/Http/Controllers/TaskControllerSmartExtractTest.php \
  tests/Feature/TaskControllerTest.php \
  tests/Feature/Api/TaskControllerTest.php \
  tests/Feature/Api/TasksTest.php \
  --no-coverage

Expected result: 53 tests, 504 assertions.

Manual end-to-end validation was completed successfully by updating the Smart Extract Environment Variables, verifying the next web request, and verifying a subsequent job on an already-running worker. The local Docker executor also completed the Smart Extract flow successfully.

Related Tickets & Packages

ci:package-smart-extract:spike/FOUR-32268

@processmaker-sonarqube

Copy link
Copy Markdown

@eiresendez
eiresendez marked this pull request as draft July 17, 2026 15:00
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.

1 participant