Commit Graph

36 Commits

Author SHA1 Message Date
Dan e44ea6e13c merging in from dev. 2022-03-18 16:22:33 -04:00
mike cullerton 81e3da043c Fix tests 2022-03-18 16:05:16 -04:00
Dan a401c41b23 Setting a minimum date for which to import studies.
Merging in code to improve performance of calculating percent complete for a study.
Assureing we have a primary investigator for the front page (another merge)
2022-03-18 15:27:45 -04:00
Dan b7489aea43 merging in PI Name changes from Alicia's #499 PR. 2022-03-18 12:30:20 -04:00
Dan ef5aca4fe4 ReviewType now comes back with the user studies, so we don't need to make an additional query to get it. 2022-03-18 09:59:10 -04:00
alicia pritchett 5b7e71d42d meta field for categories 2022-03-16 12:49:35 -04: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
Dan 788e40a998 death to load_example_data() !!!!! 2022-02-09 22:13:02 -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
alicia pritchett a4fb00b0ed remove bad imports 2022-02-07 15:28:52 -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
mike cullerton 68820c67cb Removed (almost) all references to WorkflowSpecDependencyFile
(There is still a call in the lookup service, but we need to decide how to fix that)
2022-01-19 16:12:54 -05:00
Dan 5429e7da7d All enumerated lists used in web forms should contain a single value, not a dictionary of value/labels.
Removing the spreadsheet.value.column and data.value.column so we just have value.column for both.
Improving the __str__ function in the ApiError class, to make debugging a little easier.
Adding a "validate_all" flask command, to help us track down any issues with current workflows in production (use this in concert with sync_with_testing)
Fixed logs of tests.
removed fact_runner.py, a very early and crufty bit of code.
2021-10-19 10:13:43 -04:00
alicia pritchett ea4e382f06 Fixing some tests 2021-10-06 15:24:58 -04:00
mike cullerton da894219c5 Changes to tests after removing `name` column from `workflow_spec` and `workflow_spec_category` tables. 2021-10-05 14:20:03 -04:00
Dan 19104303de Refactor of the way we store and return details about users - All the details about a user, or individual associated with a study is returned within in an Ldap model. I've removed duplication between these models. This required some cleanup of the tests, and a migration that will drop the user details. 2021-09-22 13:16:25 -04:00
Dan 4b591a076f Adding importlib-resournces as a dependency, which is suddenly failing on Travis, likely due to different versions of Python as I try to upgrade to 3.9 2021-09-21 14:36:57 -04:00
mike cullerton 444e3fa76d Merge branch 'dev' into zip-documents-379 2021-09-14 09:39:19 -04:00
mike cullerton cd3d17862a Add task_spec_name to a bunch of tests 2021-08-26 10:43:28 -04:00
mike cullerton 35285a0b60 Fixed tests that broke from the new irb_documents spreadsheet 2021-08-26 08:51:52 -04:00
mike cullerton 69974e89fd Added 2 simple tests for filtering by REVIEW_TYPE 2021-07-09 11:39:30 -04:00
mike cullerton 445d3e5f0b Added mocked pb study_details since we now check whether a study has valid REVIEW_TYPEs 2021-07-09 10:41:46 -04:00
Dan fb54edac1c Adding additional details to error messages, and cleaning up the cruft around these messages to keep them clear and succinct.
Most noteable is the addition of the line on which the error occurs for script tasks.  It will report the line number and pass back the content of
the line that failed.
The validator only returns the first error it encounters, as it's clear that all we ever get right now is two of the same error.
Did a lot of work between this and spiffworkflow to remove all the places where we obfuscate or drop details as we converted between workflowExceptions and APIExceptions.
Dropped the python levenshtein dependency, in favor of just rolling a simple one ourselves in Spiffworkflow.
2021-07-07 00:53:49 -04:00
Dan 1b1a994360 Refactoring Reference files to use the lookup table, rather than parsing the results directly out of the spreadsheet, or attempting to cache them.
Adding a DocumentService to clean up the FileService, and get Documents well seperated, as it seems likely be pulled out or seperated in the future, there is now a Documents api file as well, for the same reason.
Some other minor changes are just fixing white space to assure our code is linting correctly.
I removed _create_study_workflow_approvals from the base test, as we don't use approvals like this anymore.
2021-07-06 13:10:20 -04:00
Kelly McDonald 2b9cee6b89 Update database to include timezone and change all points where we set the time on an event to be utc time. If we get something in the database with a timezone, it will display properly on the front end, but by default everything will be put in the database in UTC 2021-04-29 10:25:28 -04:00
Kelly McDonald 003bf2f9b9 Remove Approvals per ticket 183 2021-02-16 09:05:29 -05:00
Carlos Lopez cef7c48be2 Adding tests 2020-08-10 21:18:41 -06:00
Carlos Lopez 5d23223e51 New study status update 2020-07-30 21:03:11 -06:00
Dan Funk 0ea4c13d09 Convert protocol builder status to always be in lower case in order to better match the front end. And also fixing an issue with the multi_instance that is oddly broken suddenly, and I don't know why. 2020-07-28 17:16:48 -04:00
Dan Funk f15626033d Allow the workflow to be requested without making changes to the workflow - requires that you specify a read_only flag of true, otherwise it assumes that you want a fully prepared workflow with the next ready task set to run. 2020-07-28 13:33:38 -04:00
Dan Funk 3d9eeab502 Add a few more details to the workflow metadata model. 2020-07-21 15:18:08 -04:00
Dan Funk 6a79fb3581 There may be multiple investigators of the same type that come back from the protocol builder, adding some tests and additional code to handle this, but still keep the list flat, currently appends a number to the investigator type when there is more than one. 2020-07-07 17:16:33 -04:00
Dan Funk a5cef8775e * Modifying the StudyInfo script to return both "investigators" and "roles", the investigators argument will return only the current active investigators according to the protocol builder. The "roles" argument returns all possible roles - it is what "investigators" use to be.
* The Task.title returned to the front end will now attempt to process the "display_name" property for dot-notation syntax, making it possible to use this for multi-instance tasks,
  but will work in all cases where we want he title to change based on values in the data model.
* Fixing a bug the test_study_api where it wasn't updated when we made recent changes to the different states of a study.
*
2020-07-06 12:09:21 -04:00
Carlos Lopez e947f40ec7 Merge branch 'rrt/dev' into feature/emails-enhancement 2020-06-17 20:10:11 -06:00
Carlos Lopez ddf1f4640c Re-organizing tests file structure 2020-06-17 16:10:06 -06:00