Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BuildScriptExecutor Failure on Importing Script Executors #6132

Merged
merged 3 commits into from Feb 1, 2024

Conversation

sanjacornelius
Copy link
Contributor

@sanjacornelius sanjacornelius commented Jan 31, 2024

Issue & Reproduction Steps

This PR resolves a failure in the BuildScriptExecutor when importing a script executor. The issue was caused by a ModelNotFoundException occurring when the job was triggered during a database transaction.

To fix this, the queue connection configuration option afterCommit was added to the dispatch method. This ensures that the job is triggered after the database transaction is completed, preventing the ModelNotFoundException.

ci:next
ci:deploy

How to Test

Setup

  1. Ensure you have Guided Templates synced in your environment using php artisan processmaker:sync-guided-templates.
  2. Ensure that the 'Guided Python Executor' is not present in your database.
  3. Under 'Processes -> Guided Templates', select a template.
  4. Run the guided template ('Get Started') and skip the tasks ('Skip').
  5. When redirected to the existing assets page, select 'Continue'.
  6. The BuildScriptExecutor job should be triggered without any failures.

Testing:

  1. Create a script using the newly imported Guided Python Executor.
    Example Script:
output = {
    'uploadError': 'error',
    'raw': 'raw data'
}
  1. Create a process with a script task using the above script.
    3.Run the process.
  2. Ensure there are no errors when running the script task.

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.

@tokensPM
Copy link

QA server K8S was successfully deployed https://ci-41896da9de.engk8s.processmaker.net

Copy link

@sanjacornelius sanjacornelius changed the title Observation/four 13332 b TESTING Fix BuildScriptExecutor Failure on Importing Script Executors Feb 1, 2024
@ryancooley ryancooley merged commit bba4739 into next Feb 1, 2024
8 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants