311 Commits

Author SHA1 Message Date
Dan
befc299475 Merge branch 'dev' into chore/fix_validation_errors 2022-03-19 09:53:12 -04:00
alicia pritchett
b9b8210f8a rm pi id refs 2022-03-18 12:04:20 -04:00
mike cullerton
d4a1b8ad3b We didn't return the value for do_task_validation_only 2022-03-18 11:32:37 -04:00
Dan Funk
791ab20f8c
Merge pull request #494 from sartography/chore/fix_validation_errors
Chore/fix validation errors
2022-03-14 16:51:27 -04:00
Dan
483d7e858b Improved Errors - Pick up on the new task_trace information in WorkflowException and pass it on through the api.
Also:  All script tasks should raise WorkflowTaskExecExceptions - NOT APIExceptions - this is because our scripts are executed by Spiff (not the other way around)  so the errors need to pass fluidly through spiff, and come back to use THEN we can convert them to APIErrors.  Otherwise we lose all kinds of good information about the error.
2022-03-14 16:00:53 -04:00
mike cullerton
a974b65333 Remove unused code 2022-03-14 12:03:11 -04:00
mike cullerton
3b049e358d Remove unused imports 2022-03-14 12:02:48 -04:00
mike cullerton
b753f06394 Changes to remove pagination for the get_logs scripts.
We only use pagination for the get_logs_for_study API endpoint. (Used on the study page)
2022-03-11 14:03:09 -05:00
mike cullerton
733e596283 rename get_logs to get_logs_for_workflow to better represent what it does 2022-03-11 13:58:25 -05:00
Dan Funk
2d5517bd15
Merge pull request #487 from sartography/chore/update-get-workflow-status-664
Chore/update get workflow status #664
2022-03-10 14:30:32 -05:00
Dan
d90bf1c977 always but always return a valid status. 2022-03-10 14:28:47 -05:00
mike cullerton
bbd12da472 Use workflow_spec_id instead of workflow_id, since workflows can be deleted
I simplified do_task_validation since we get a random string for the workflow_spec_id
2022-03-09 11:14:54 -05:00
Dan
0a906a4b3c Cleaning up Print Statements (it was making it hard to see what was happening)
The Jinja2 service was treating all the task data as a possible template, modified it to only include the referenced templates.
(This turned out not to be the problem, but it seems like a good idea to keep it in place)
There is a terrible bug with the wordwrap pipe that will die without any details if you pass it a value of None.  We now cature the terrible error, and replace it with a sensible one.
Removed an unused Jinja_extensions file.
2022-03-08 15:46:36 -05:00
Dan Funk
3f82cdae48
Merge pull request #485 from sartography/bug/validating-associates-659
Bug/validating associates #659
2022-03-07 14:20:20 -05:00
mike cullerton
eb7548ea0f Use the actual enum values so we don't have to deal with this the next time we make a change to study status 2022-03-07 13:28:29 -05:00
mike cullerton
30f68eb831 If we receive a study_id during validation, return the associates for the study 2022-03-04 16:27:33 -05:00
mike cullerton
027e436546 Cleaned up the description 2022-03-03 11:49:45 -05:00
mike cullerton
c6484f7bdb Remove print statement 2022-03-03 11:28:21 -05:00
mike cullerton
3920444acf *** WIP ***
Need to create a migration and some tests.
2022-03-02 15:26:21 -05:00
Dan
51a14311eb An optimization prevented us from picking up a change to the documents associated with a study. This assures that even if scripts run side by side, the document list will get updated, but only on a change. So it's still performant. Also added a sligthly better error message to the workflow service. 2022-02-28 12:17:21 -05:00
mike cullerton
f2c97f80d5 Merge branch 'dev' into feature/delete-variable-script-584
# Conflicts:
#	Pipfile.lock
2022-02-25 15:54:34 -05:00
Dan Funk
18802d6732
Merge pull request #468 from sartography/chore/performance
Performance Improvements:
2022-02-25 12:10:47 -05:00
Dan Funk
b6af80f6de
Merge pull request #469 from sartography/feature/modify-spreadsheet-624
modify spreadsheet #624
2022-02-25 10:29:37 -05:00
Dan Funk
5ff84d74f1
Merge pull request #464 from sartography/feature/start-workflow-602
Feature/start workflow #602
2022-02-25 10:28:26 -05:00
mike cullerton
9d2436b375 Typo calling script with keywords 2022-02-25 08:18:07 -05:00
Dan
e61ca471db remove all the @timeit from method calls. 2022-02-24 21:06:22 -05:00
Dan
3442655bd1 Performance Improvements:
1. Avoid ever re-generating the list of scripts that can be used in a script task.  Terribly expensive as we call eval constantly, and it never ever changes once the app starts. (see script.py changes, and comments)
2. Cache the DocumentStatus list in the flask session, so we calculate it at most once per API Call.  It's at least .25 seconds per call.  (see study_sevice)
3. We called UserFileService.get_files_for_study (which runs a db query EVERY time) for every possible document type.  Now we run the query once (study service line 321)
4. When returning a workflow, we looped through every single task in that workflow's navigation, and called the expensive spiff_task_to_api_task just to figure out it's proper display name. We run a much faster and more efficient method to calculate the display name naow (see workflow_service on lie 680, and 799)
5. A hellton of @timeit and sincetime() calls, that I want to leave in, to help debug any slowness on production.
2022-02-24 14:25:42 -05:00
mike cullerton
ed0499a573 Make sure we have a workflow.
Raise an ApiError with the workflow_spec_id if we cannot find a workflow
2022-02-24 12:37:25 -05:00
mike cullerton
c1606a20a5 Don't call an api endpoint from a script. 2022-02-24 11:14:24 -05:00
mike cullerton
0b3187889d We now raise an error if the spreadsheet does not exist.
Added test for case where the spreadsheet does not exist
2022-02-24 10:25:34 -05:00
mike cullerton
d378078d6f Change so that we always use the current workflow 2022-02-23 15:18:03 -05:00
mike cullerton
b6a39dfd25 Script to insert data into an existing (irb_document) spreadsheet.
Requires `upload_workflow_id`, `irb_doc_code`, `cell`, and `text` parameters.
The cell parameter should be something like 'B21'
2022-02-23 14:29:50 -05:00
mike cullerton
41d562ca26 Changed code in error message 2022-02-22 14:41:30 -05:00
mike cullerton
1860509c1e Fixed error message 2022-02-22 14:39:49 -05:00
mike cullerton
a9326d29e2 Script to start workflow programmatically.
Requires a workflow_spec_id to restart
2022-02-22 14:37:12 -05:00
mike cullerton
b20ccf02ae Fix test class names 2022-02-21 12:56:04 -05:00
mike cullerton
8c66a35f36 Script to delete variables from task data 2022-02-21 12:55:03 -05:00
mike cullerton
fca6eb1582 Script to get workflow spec information from a workflow spec id 2022-02-16 15:54:30 -05:00
Dan
f12c4aba52 Refactor the workflow_spec_service so it doesn't cache anything, it always reads what it needs from the file system. 2022-02-09 21:06:55 -05:00
Dan
cc915ac25a refactoring the study service. 2022-02-09 08:50:00 -05:00
Dan
dc040f190e got one more test to work. 2022-02-08 11:30:13 -05:00
mike cullerton
265381f48c Delete TODO comment. Done 2022-02-07 16:44:59 -05:00
mike cullerton
2bd833446e get_spec not static 2022-02-07 16:33:42 -05:00
mike cullerton
2a6e8315a1 *** WIP ***
Committing to deal w/ the migration
2022-02-07 11:22:45 -05:00
Dan
4ec6e403f5 1. Created a UserFileService, so it's clear what we use when for File Services, UserFiles, SpecFiles, and ReferenceFiles each function differently.
2. Reference Files and Spec Files are written to disk, they do not exist in the database at all.
2022-02-02 12:59:56 -05:00
Dan Funk
97c29bf77c
Merge pull request #449 from sartography/files-to-filesystem-572
Files to filesystem 572
2022-01-26 10:11:26 -05:00
Dan
8529465322 Removed the method get_spec_data_files completly - using get_spec_files and get_spec_data to get this information instead.
Only load the spec data files if you are creating a new workflow, otherwise just deserialize the json.
Removed the stuff about calculaing the version of the spec, as we don't use it.
2022-01-25 16:10:54 -05:00
mike cullerton
1fe65ff6b7 Script to get a workflow spec from a workflow id. 2022-01-24 12:40:50 -05:00
mike cullerton
68ac056457 Merge branch 'dev' into files-to-filesystem-572 2022-01-18 08:18:14 -05:00
Dan
962d05c875 1. Created a TaskLoggingService to encapsulate what we are doing with Task Logging through BPMN Script calls and API calls from the front end.
2. Added two api endpoints that will allow us to get all the logs for a specific workflow or study.
3. Assured that requests for logs are paginated, sortable, and can be limited to a specific code if needed.
4. Assure that we only use logging levels that match the log levels of Python.
2022-01-10 13:16:54 -05:00