Commit Graph

1751 Commits

Author SHA1 Message Date
mike cullerton bf31364b1f *** WIP ***
Committing to fix logging so we can use a level of 'metrics'
2022-03-09 13:07:56 -05:00
mike cullerton 6ec01a0a85 Merge branch 'dev' into chore/log-changes-661 2022-03-09 11:27:13 -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 1e9c9919c2 hot fix, missed a critical part of the jinja include syntax when identifying included templates 2022-03-09 11:03:42 -05:00
Dan ce57a3753a fixing some comments and error messages for clarity 2022-03-09 10:28:22 -05:00
Dan e3c1a908fe A better comment around a tricky part of the code. 2022-03-09 09:43:08 -05:00
Dan 41b5106a28 patching up the tests.
Looks like we want to use default values, if they are provided, for validation. So good test, and I didn't have to create a new bug.  Also added skipping the test about requiring a default for hidden+required fields.  Maybe we don't need to after all.
2022-03-08 18:38:05 -05:00
Dan 26eeb2912a Only run the form validation stuff if we have a form.
If there is a default value, use it, regardless of whether the form is hidden (this is how the front end works)
  (accomplished by moving the hide_epxression check -> continue stuff below the set default_value code)
2022-03-08 18:13:54 -05:00
Dan b03e24bbf4 Properly handle forms where a field is required, based on a later field.
Do an aboutface on saying that if a field is required but hidden, it has to have a default value.  I'm just commenting this out for now, as it made getting these workflows to validate bloody impossible.
Clean up the replication of code for identifying required fields (as it wasn't consistently applied)
Removing some very broken and apparently unused methods.
2022-03-08 17:36:13 -05:00
mike cullerton 8cab382926 The task log model expected has_prev instead of has_previous 2022-03-08 16:52:37 -05:00
mike cullerton c2035b7b40 Add workflow_spec_id to task_log model. This is because workflows can be deleted, so workflow_id is not dependable.
Add workflow (display_name) and category (display_name) to TaskLogModelSchema. We display these to the user on study home page in the logs.
2022-03-08 16:45:19 -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
Dan Funk eae0b5286e
Merge pull request #483 from sartography/chore/study-status-changes-653
Chore/study status changes #653
2022-03-07 14:20:05 -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
Dan Funk 0b3fa781c5
Merge pull request #484 from sartography/bug/bleeding_data
Loading latest chages from Spiff whic refactored the way the PythonEx…
2022-03-07 10:22:36 -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
Dan 0455506e2b Loading latest chages from Spiff whic refactored the way the PythonExpressionEngine works.
This cleans up the _evaluate method which previously accepted arbitrary args and kwargs, and now requires an expression, a context to which exectute it, and, optionally, the current task being executed if the DMN is being executed as a part of a BusinessRuleTask in a BPMN diagram.

This also cleans up several bits of duplicated code.

There is also a bit of code here to assure that the current user is included when running the master workflow.
2022-03-04 15:34:36 -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 2cfe1b331c Merge branch 'dev' into git-integration-596 2022-03-02 15:29:27 -05:00
mike cullerton 3920444acf *** WIP ***
Need to create a migration and some tests.
2022-03-02 15:26:21 -05:00
mike cullerton 83e2370778 The frontend passes '' instead of None
Also, tests for the new button display variables
2022-03-02 13:33:22 -05:00
Dan Funk 84c420346d
Merge pull request #481 from sartography/feature/add-jinja-to-help-576
Feature/add jinja to help #576
2022-03-02 12:33:21 -05:00
Dan a74ae647d6 Do not send cancel events if you are navigating to the current task. 2022-03-02 12:24:03 -05:00
mike cullerton cb65a7dc41 Add booleans for displaying push/merge buttons
*** WIP ***
Still need to add some tests for this.
Committing so we can work on the frontend
2022-03-02 12:03:08 -05:00
Dan Funk 07e13584e7
Merge pull request #479 from sartography/nonetype-displayname-error-632
Clean up error message in test_spec
2022-03-01 16:20:20 -05:00
Dan Funk cf77480803
Merge pull request #480 from sartography/bug/no-assignment-tasks-639
Fixes #650 - Approvals not Clearing When Completed
2022-03-01 16:19:51 -05:00
mike cullerton 5ef2905d3c Add Jinja templating to form field help 2022-03-01 16:17:02 -05:00
mike cullerton 6da23dc854 Clean up error message in else clause in test_spec 2022-03-01 14:58:53 -05:00
alicia pritchett e416873916 Fixes #650 - Approvals not Clearing When Completed 2022-03-01 14:45:18 -05:00
Dan Funk 896ce8934b
Merge pull request #477 from sartography/bug/645_document_updated
An optimization prevented us from picking up a change to the document…
2022-02-28 15:57:13 -05:00
Dan 91ed50e45e Be sure we update the document list when new workflow documents are added. 2022-02-28 15:49:21 -05:00
mike cullerton ef4334b1c8 Added a catch for generic exceptions, so the `finally` clause always executes.
Also, raise if there is an ApiError, because some tests depend on it.
2022-02-28 14:01:19 -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
Dan Funk 1dfebf9f1f
Merge pull request #476 from sartography/bug/no-assignment-tasks-639
Fixes #639 - Pending Approvals Panel No longer displaying
2022-02-27 19:37:00 -05:00
Dan ad17db067d mild little performance improvement. 2022-02-27 19:32:45 -05:00
alicia pritchett 5dfb3153d1 Fixes #639 - Pending Approvals Panel No longer displaying 2022-02-27 12:21:38 -05:00
Dan ebbb04a1af Fixing failing validation. 2022-02-27 10:00:44 -05:00
Dan Funk 9b004d0dc6
Merge pull request #462 from sartography/feature/delete-variable-script-584
Feature/delete variable script #584
2022-02-25 16:19:51 -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 140de7ed03
Merge pull request #473 from sartography/nonetype-displayname-error-632
Nonetype displayname error #632
2022-02-25 15:41:14 -05:00
mike cullerton 531802f927 Make sure we don't try to get WorkflowMetadata if the spec does not exist
This was raising a 500 error
2022-02-25 14:41:58 -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
Dan 3944d00e88 Removing an unused / rogue variable.
Adding a logger warning for very large workflow json data.
2022-02-25 09:59:41 -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 dde8873c9e 1. defer the loading of the bpmn_json when loading the workflow model. It can be stupidly larger. (see models/workflow.py)
2. Shave a little more time off the reset by not re-creating the whole WorkflowProcessor

cleaning up all the firsttime/sincetime statements.
2022-02-24 20:56:57 -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 e1bd301e41 Merge branch 'dev' into feature/start-workflow-602 2022-02-24 10:36:38 -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 1fe1ce2e22 Merge branch 'dev' into feature/modify-spreadsheet-624 2022-02-24 09:42:53 -05:00
Dan Funk 33dc1f0868
Merge pull request #465 from sartography/bug/628_jinja_template_errors
fix to assure we produce a usable error message
2022-02-24 08:50:41 -05:00
Dan Funk e8617038ab
Merge pull request #461 from sartography/bug/missing-executabe-option-601
Bug/missing executabe option #601
2022-02-24 08:46:46 -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
Dan 23a43c0472 fix to assure we produce a usable error message 2022-02-23 11:53:24 -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
alicia pritchett 095856d3c7 Fixes a bug so that you can reference later fields (and they'll validate 2022-02-22 10:18:09 -05:00
Dan 65ffc37787 fixing a bug in Spiff that was preventing our tests from passing. 2022-02-21 14:30:36 -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 a830657ebd raise ApiError when isExecutable tag is missing.
Unsure how this would actually happen, since it should get set to False if box is unchecked.
2022-02-21 10:17:01 -05:00
Dan 24f33ec9c9 Merge branch 'chore/variables-in-forms-550' of github.com:sartography/cr-connect-workflow into chore/variables-in-forms-550 2022-02-21 09:57:19 -05:00
alicia pritchett bb3d3a5907 Merge remote-tracking branch 'origin/chore/variables-in-forms-550' into chore/variables-in-forms-550 2022-02-21 08:56:11 -05:00
Dan 06b9b653b2 don't overwrite the field.label during an eval. It should remain as it is, just assure that it /can/ be evaluated. 2022-02-19 17:43:12 -05:00
Dan 4f32cf753c Merge branch 'chore/variables-in-forms-550' of github.com:sartography/cr-connect-workflow into chore/variables-in-forms-550 2022-02-18 17:20:10 -05:00
Dan c3e52f960b Minor stuff to help digging into validation of current workflows. 2022-02-18 17:20:04 -05:00
Dan a7f591d2ac Merge branch 'dev' into chore/variables-in-forms-550 2022-02-18 17:19:01 -05:00
alicia pritchett 3b48435411 Merge branch 'master' into chore/variables-in-forms-550 2022-02-18 13:23:33 -05:00
alicia pritchett 4b92b0ee71 oops 2022-02-18 11:57:13 -05:00
alicia pritchett e7c0e66f86 Merge remote-tracking branch 'origin/chore/variables-in-forms-550' into chore/variables-in-forms-550 2022-02-18 11:41:15 -05:00
alicia pritchett a912e8ef49 validate checks/catches default value and label value 2022-02-18 11:41:07 -05:00
Dan 779ac38513 Fix validate-all 2022-02-18 11:40:58 -05:00
Dan b90be07bca Remove these bloodly log files from the repo. 2022-02-18 11:40:10 -05:00
Dan e91be2a54d Merge branch 'dev' into chore/variables-in-forms-550 2022-02-18 11:27:58 -05:00
Dan 635a112796 still trying to fix a rogue test. 2022-02-18 10:41:24 -05:00
Dan 6adf1107fe Trying to figure out why these files are not the same on testing. 2022-02-18 10:12:36 -05:00
alicia pritchett 06dc20657b Fixing various BPMN's for tests 2022-02-17 17:29:44 -05:00
alicia pritchett a5acd9b07e Merge branch 'dev' into chore/variables-in-forms-550 2022-02-17 15:04:41 -05:00
Dan c2c6410bbb Assure we update the workflow model, so we don't keep reporting the error over and over again. 2022-02-17 14:12:31 -05:00
Dan 3704279f20 Quick fix, assure we can reset studies. 2022-02-17 14:07:33 -05:00
Dan Funk be48f86440
Merge pull request #459 from sartography/bug/619_lookup_tables
Another re-work to fix 619 - and to assure that we aren't rebuilding …
2022-02-17 13:15:37 -05:00
Dan c2dbec1e3f Merge remote-tracking branch 'origin/dev' into bug/619_lookup_tables 2022-02-17 12:51:24 -05:00
Dan 9a26e56cc6 fixing some failing tests, due to previously lazy conflict merge. 2022-02-17 12:39:52 -05:00
Dan e0a8e7300c Merge remote-tracking branch 'origin/dev' into get-erroring-workflows-574 2022-02-17 12:37:34 -05:00
Dan Funk 9d74ee5790
Merge pull request #458 from sartography/bug/date-field-validation-622
Bug/date field validation #622
2022-02-17 12:18:39 -05:00
Dan Funk 484b9a9c7c
Merge pull request #457 from sartography/feature/get-spec-script-613
Feature/get spec script #613
2022-02-17 12:17:12 -05:00
alicia pritchett 08c1571803 Remove value_expression 2022-02-17 12:16:15 -05:00
Dan Funk b91372171c
Merge pull request #454 from sartography/git-integration-fixes-596
Git integration fixes #596
2022-02-17 12:15:13 -05:00
Dan Funk 5def436602
Merge branch 'dev' into get-erroring-workflows-574 2022-02-17 12:12:42 -05:00
Dan b72ecb8375 Another re-work to fix 619 - and to assure that we aren't rebuilding the lookup tables too frequently. 2022-02-17 11:59:48 -05:00
mike cullerton 31f724b0c3 Seed date fields correctly during validation.
We were seeding them with random strings.
2022-02-17 11:48:08 -05:00
Dan f2b6008e5f Fixes 619 - look up models were being built incorrectly, and repeatedly, and sometimes bombed out all together.
bonus: resond with a valid error message when an invalid task_id is requested (don't just 500)
2022-02-17 11:04:50 -05:00
alicia pritchett b0c723f021 Merge remote-tracking branch 'origin/feature/get-spec-script-613' into chore/variables-in-forms-550 2022-02-17 10:35:06 -05:00
alicia pritchett 8d49e2bfbb Merge branch 'dev' into chore/variables-in-forms-550 2022-02-17 10:32:40 -05:00
mike cullerton 7885481b84 Ignore hidden files 2022-02-16 15:55:42 -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 0ad9843569 Dealing with some changes in SpiffWorkflow's latest release. I think this gets all tests passing again, and behaving as expected. 2022-02-16 10:46:46 -05:00
Dan cc6f80bea9 fixing some paths. 2022-02-15 16:25:52 -05:00
Dan c0af75a010 Merge branch 'dev' into feature/upgrade_spiff 2022-02-15 16:25:13 -05:00
Dan 093741fa90 By default the system will start up the scheduled tasks, which is usually what you want, but in development
it can be kind of irritating for this stuff to be spinning up when you are trying to debug something, so just set
PROCESS_WAITING_TASKS to false in instance/config.py and voila!!
2022-02-15 14:07:09 -05:00
Dan 7a91363db1 By default the system will start up the scheduled tasks, which is usually what you want, but in development
it can be kind of irritating for this stuff to be spinning up when you are trying to debug something, so just set
PROCESS_WAITING_TASKS to false in instance/config.py and voila!!
2022-02-15 11:06:11 -05:00
mike cullerton 63de48ccb6 Merge branch 'feature/spec_files_wthout_db' into git-integration-fixes-596 2022-02-11 12:57:57 -05:00
mike cullerton de797c4f32 Added examples for changes and untracked 2022-02-11 12:45:29 -05:00
mike cullerton 0e51def09f Cleanup - removed old unused methods 2022-02-11 12:18:20 -05:00
mike cullerton 88b662ea38 modified get_remote_url to use configuration, instead of hard-coding the remote host 2022-02-11 12:17:32 -05:00
Dan 648383f2ea for some reason jenkins doesn't like the spec_category_reorder test, so just doing it a different way. 2022-02-11 11:37:25 -05:00
Dan bf4f6909b9 Don't show the .git directory. 2022-02-11 11:06:26 -05:00
Dan 7a99859108 fixing some failing test 2022-02-11 11:00:42 -05:00
Dan 1b993ea227 updating readme 2022-02-11 09:47:49 -05:00
Dan 3993297360 minor fixes to the study api to get things working locally when we pull down a database from testing. 2022-02-10 18:19:57 -05:00
Dan 1858cd314f Assure we can call get_spec and it can return the master spec correctly. 2022-02-10 18:04:32 -05:00
Dan a047c63c32 Merge branch 'feature/spec_files_wthout_db' of github.com:sartography/cr-connect-workflow into feature/spec_files_wthout_db 2022-02-10 16:53:22 -05:00
Dan 1e4ec6f395 fixes to the workflow spec schema, so we can load null things without stuff blowing up. 2022-02-10 16:53:15 -05:00
alicia pritchett b7893688ae tweak 2022-02-10 16:21:59 -05:00
Dan edaf6e205e Not certain if this works, but this should help finding data maybe. 2022-02-10 16:10:35 -05:00
Dan eb7760fa55 Adding the migration - very destructive, but required for running the app.
minor fixes - there is still some weird problems with study id and user id being null that I need to track down, but the issue is sporadic, and hard to track down.
2022-02-10 11:50:31 -05:00
Dan 3ebffeed33 Merge branch 'feature/spec_files_wthout_db' of github.com:sartography/cr-connect-workflow into feature/spec_files_wthout_db 2022-02-10 11:34:56 -05:00
Dan 4280fa6610 Assure the spec has the corect category id on it. 2022-02-10 11:34:50 -05:00
alicia pritchett 3ee95b3c39 gets master spec 2022-02-10 11:29:38 -05:00
Dan f73b29cda2 Removing all the old unused outdated specs in the static directory. 2022-02-10 10:47:05 -05:00
Dan df3f67601c performance improvements. and last rements of load_example_data() 2022-02-09 23:29:39 -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 cf71f68ad9 all tests passing!!!!!!!!!!!!! 2022-02-09 15:30:07 -05:00
Dan 2cc20d4b9d really need to avoid any kind of caching in the WorkflowSpecService 2022-02-09 14:43:32 -05:00
mike cullerton 77b1692e2f typo 2022-02-09 13:52:48 -05:00
alicia pritchett c830c468b6 Merge remote-tracking branch 'origin/feature/spec_files_wthout_db' into feature/spec_files_wthout_db 2022-02-09 13:41:53 -05:00
alicia pritchett b788bbf4f4 revert this back 2022-02-09 13:41:50 -05:00
Dan 89e02c6207 really need to avoid any kind of caching in the WorkflowSpecService 2022-02-09 13:37:57 -05:00
alicia pritchett b5099cf5a2 Merge remote-tracking branch 'origin/feature/spec_files_wthout_db' into feature/spec_files_wthout_db 2022-02-09 13:09:49 -05:00
alicia pritchett 595b866f41 return empty list if you dont find standalones or libraries 2022-02-09 13:09:46 -05:00
Dan 7e7821a5e7 more test passing 2022-02-09 13:01:26 -05:00
Dan db93f9be4e fixing the test_spec_files 2022-02-09 12:44:54 -05:00
Dan e9fd76ed99 lookup service tests passing, but I need to revist this. 2022-02-09 12:11:51 -05:00
Dan de6d7eee84 nearly all study tests work. 2022-02-09 12:03:45 -05:00
Dan f72b25d9be Merge branch 'feature/spec_files_wthout_db' of github.com:sartography/cr-connect-workflow into feature/spec_files_wthout_db 2022-02-09 11:37:58 -05:00
Dan 8e7c8c87c3 down to just 38 failed tests 2022-02-09 11:37:54 -05:00
alicia pritchett 5bd25b9f60 get all specs change 2022-02-09 11:34:17 -05:00
alicia pritchett 148796d311 fixes add_category 2022-02-09 11:24:41 -05:00
alicia pritchett 38d64b1ffd fixes a workflow model related test
yes i call a service from a service whoops
2022-02-09 11:07:09 -05:00
mike cullerton 1c033ce7f2 Merge branch 'feature/spec_files_wthout_db' of https://github.com/sartography/cr-connect-workflow into feature/spec_files_wthout_db 2022-02-09 10:55:19 -05:00
mike cullerton 9576089e84 Reorder categories 2022-02-09 10:55:02 -05:00
alicia pritchett 8c5f3a8cfb slight model change thing for categories 2022-02-09 10:27:46 -05:00