Commit Graph

322 Commits

Author SHA1 Message Date
mike cullerton b304b4725b Merge branch 'dev' into file-refactor-705 2022-04-14 11:40:08 -04:00
mike cullerton 72f9ac33d0 Consolidate data_store scripts 2022-04-13 17:57:22 -04:00
mike cullerton 216c15ed1c FileModel => DocumentModel 2022-04-13 08:15:23 -04:00
mike cullerton b732fee675 Merge branch 'dev' into file-refactor-705 2022-04-12 14:01:49 -04:00
mike cullerton 3be67a8bd9 FileModel => DocumentModel
Also, type is no longer an Enum field, no need to grab type.value
2022-04-12 13:44:58 -04:00
mike cullerton 0c313f44b2 FileModel => DocumentModel
Don't need separate call for data
2022-04-12 13:43:00 -04:00
mike cullerton e9ea95d1d7 The IRB Info API endpoint can return a dictionary--if the study is **not** yet uploaded, or a list with 1 dictionary if the study **is** uploaded 2022-04-07 14:38:32 -04:00
Dan Funk 095105e3e6
Merge pull request #508 from sartography/validation-with-data-store-396
Validation with data store #396
2022-04-04 16:51:57 -04:00
mike cullerton f92f9d64ea Allow users to pass a `doc_code` to get_zipped_files script 2022-03-28 11:59:10 -04:00
mike cullerton 5229cf457e Modify scripts to use the changes in data_store_service validate methods
Make sure we return values in the validate methods
Minor cleanup
2022-03-25 10:03:12 -04:00
mike cullerton 94abd7eebf *** WIP ***
Add a temporary data store for validation
2022-03-23 15:15:01 -04:00
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