Commit Graph

780 Commits

Author SHA1 Message Date
Aaron Louie cb2613feee Fixes all the paths and routing errors 2020-05-24 23:09:12 -04:00
Aaron Louie d9d1367556 Runs as root (for now) 2020-05-24 21:09:55 -04:00
Aaron Louie 00255ce2a0 Forgot a backslash 2020-05-24 21:01:02 -04:00
Aaron Louie 532e6b8433 Starts gunicorn, passing port and base href path 2020-05-24 20:58:19 -04:00
Aaron Louie b1718078ff Refactors Dockerfile again. Installs gunicorn. Don't run gunicorn until the container starts up. 2020-05-24 20:53:25 -04:00
Aaron Louie 5ec97dc68d Goes back to default install location. Copies files to the right spot 2020-05-24 18:29:45 -04:00
Aaron Louie 0f48d6c81e Installs the app in the right place (maybe?) 2020-05-24 17:18:56 -04:00
Dan Funk 971d9a58e9 As we now have an approval_service.py, I moved all the business logic into this service and out of the request_approval.py script. And moved all tests for these features into a test file for the service. Will make it easier to cross reference what is happening, as everything all happens in one file.
As many of the scripts need to know the workflow, and it's down in a weird parameter, moved this so it is passed in each time.
2020-05-24 16:13:15 -04:00
Aaron Louie 52208d9c8a Adds wait-for-it script 2020-05-24 14:53:48 -04:00
Aaron Louie 28c254a106 Fixes path to static directory 2020-05-24 14:11:53 -04:00
Aaron Louie baaf73b5d9 Bumps Python version to 3.7 2020-05-24 13:43:12 -04:00
Aaron Louie be1d54bbc5 Builds Docker image as WSGI + gunicorn 2020-05-24 12:37:11 -04:00
Carlos Lopez e9bd19b112 Fixing broken test 2020-05-24 01:22:14 -06:00
Carlos Lopez 49eb4b3f98 Making working endpoints for approvals 2020-05-23 23:53:48 -06:00
Aaron Louie 4eaee57076 Apparently, APPLICATION_ROOT does something. 2020-05-24 00:05:13 -04:00
Aaron Louie 68084a84cf Adds base href environment variable. Sets base path for API and all routes from BASE_HREF environment variable. 2020-05-23 22:07:22 -04:00
Carlos Lopez e5e7eb3dd3 Fixing broken tests by making version parameter optional in get file data endpoint 2020-05-23 15:37:03 -06:00
Dan Funk d5c91e575f stuff that might be broken. 2020-05-23 15:21:30 -04:00
Aaron Louie 1d2f074312 Merge branch 'rrt/dev' into rrt/testing 2020-05-23 15:18:35 -04:00
Aaron Louie 4584dda992 Merge branch 'dev' into rrt/dev 2020-05-23 15:13:03 -04:00
Dan Funk d39ef658a2 Made some modifications to the Approval so that it knows exactly what versions of every file are being sent for approval
Added the following columns:
  * date_created - so we know when the file was created
  * renamed workflow_version to just "version", because everything has a version,  this is the version of the request.
  * workflow_hash - this is just a quick way to see what files and versions are associated with the request, it could be factored out.
  * study - a quick relationship link to the study, so that this model is easier to use.
  * workflow - ditto
  * approval_files - these is a list from a new link table that links an approval to specific files and versions.

The RequestApproval is logically sound, but still needs some additional pieces in place to be callable from a BPMN workflow diagram.

Altered the file service to pick up on changes to files vs adding new files, so that versions are picked up correctly as
users modify their submission - adding new files or replacing existing ones.  Deleting files worries me, and I will need to revisit this.

The damn base test keeps giving me a headache, so I made changes there to see if clearing and dropping the database each time won't allow the tests to pass more consistently.

Lots more tests around the file service to make sure it is versioning user uploaded files correctly.

The "Test Request Approval Script" tries to find to assure the correct behavior as this is likely to be called many times repeatedly and with little knowledge of the internal system.  So it should just "do the right thing".
2020-05-23 15:08:17 -04:00
Aaron Louie 6c14248ef9 Adds 'v1.0/' to login route 2020-05-23 14:49:02 -04:00
Aaron Louie 20bf01a888 Adds cascade to study relationship so data loader doesn't freak out. 2020-05-22 22:04:11 -04:00
Aaron Louie 00955723b0 Merge branch 'rrt/dev' into dev 2020-05-22 20:29:21 -04:00
Dan Funk 49c322177b
Merge pull request #76 from sartography/feature/rrp-endpoints
Feature/rrp endpoints
2020-05-22 19:38:26 -04:00
Carlos López 833f65fe8c
Merge pull request #75 from sartography/feature/add_review_model
Feature/add review model
2020-05-22 17:30:01 -06:00
Dan Funk 148e86bb42 Building out the boilerplate code to make pushing forward on this a little friendlier.
There is an approval api file, and approval model file and an approval test file.
2020-05-22 18:25:00 -04:00
Dan Funk 571c1d7d24 Merge branch 'feature/rrp-endpoints' into feature/disable_protocol_builder 2020-05-22 16:18:33 -04:00
Dan Funk d1606ffb1a forgot to include the new empty master workflow, which allows the tests to all pass. 2020-05-22 15:31:38 -04:00
Dan Funk 1017bb1897 On the tools/render_docx api, allow sending the json data in the body, rather than as a ludicrous long get parameter. Silly Dan. 2020-05-22 15:30:22 -04:00
Aaron Louie 2e94ab1584 Only runs upgrade if env variable says to. 2020-05-22 14:55:55 -04:00
Dan Funk 503c1c8f18 Allow disabling the Protocol Builder
PB_ENABLED can be set to false in the configuration (either in a file called instance/config.py, or as an environment variable)

Added a check in the base_test, to assure that we are always running tests with the test configuration, and bail out otherwise.  Setting TESTING=true as an environment variable will get this, but so well the correct ordering of imports. Just be dead certain the first file every test file imports is base_test.py.

Aaron was right, and we call the Protocol Builder in all kinds of awful places.  But we don't do this now.  So Carlos, you should have the ability to reuse a lot of the logic in the study_service now.

I dropped the poorly named "study-update" endpoint completely.  We weren't using it. POST and PUT to Study still work just fine for doing exactly that.

All the tests now run and pass with the Protocol builder disabled. Tests that specifically check PB behavior turn it back on for the test, or mock it out.
2020-05-22 14:37:49 -04:00
Dan Funk 992a85e9a5 Rough idea of what the Approvals model will look like. 2020-05-22 11:56:43 -04:00
Carlos Lopez a0c884499e Merge branch 'feature/rrp-endpoints' of github.com:sartography/cr-connect-workflow into feature/rrp-endpoints 2020-05-22 09:46:25 -06:00
Carlos Lopez 1ed7930aab Endpoint for studies with files 2020-05-22 09:46:03 -06:00
Dan Funk 8b3dc8e0ca Merge branch 'dev' into feature/rrp-endpoints 2020-05-22 11:41:11 -04:00
Aaron Louie dd4455f2ce
Merge pull request #73 from sartography/staging
Staging
2020-05-22 11:25:25 -04:00
Dan Funk b490005af7 dropping the remaining config stuff for flask_sso.
updaing the user 'sso' endpoint to provide additional information for debugging.
Pulling information from ldap to stay super consistent on where we get our information.
2020-05-22 09:50:18 -04:00
Dan Funk 1cc9a60bfe clearing out the remaining references to the flask_sso library. 2020-05-22 08:01:33 -04:00
Dan Funk 4627318818 Dropping flask_sso library in favor of reading from the headers directly. Updating login to read from ldap once it has the user_id. Adding more information to the sso endpoint. 2020-05-22 07:55:58 -04:00
Dan Funk b3ae9ee770 changing the mapping, because 'Uid' not 'uid' 2020-05-21 16:28:34 -04:00
Dan Funk 0265db7146 adding an /sso endpoint for testing. 2020-05-21 16:02:45 -04:00
Dan Funk 4628834106 just a few more logging details. 2020-05-21 12:11:35 -04:00
Aaron Louie 09eed18e88 Merge branch 'dev' into rrt/testing 2020-05-20 20:13:29 -04:00
Aaron Louie d76c18d329 Installs curl 2020-05-20 20:13:09 -04:00
Carlos Lopez abc90cdcb1 Adding serialiazer for study files 2020-05-20 15:10:22 -06:00
Aaron Louie d0f380e224 Uses Python 3.6.9 2020-05-20 16:49:55 -04:00
Aaron Louie 595364b415 Merge branch 'ec2/dev' into dev 2020-05-20 16:34:53 -04:00
Aaron Louie 29b1d43006 Merge branch 'dev' into rrt/testing 2020-05-20 16:34:21 -04:00
Aaron Louie b915794000 Fixes more paths. 2020-05-20 15:57:54 -04:00