52 Commits

Author SHA1 Message Date
dandds
3f60d3494e Merge branch 'staging' into environment-role-creation 2020-02-09 14:29:03 -05:00
leigh-mil
903f5ca33b Add todo about fixing tests 2020-02-06 13:07:46 -05:00
leigh-mil
b2da9de040 Log error when sending email fails. Wrap recipients in a list instead of putting the logic inside Mailer _build_message(). 2020-02-06 13:07:46 -05:00
leigh-mil
0f69a48bbe Refactor to catch errors and not update TaskOrder.pdf_last_sent_at unless the email has been sent. Add tests for failure cases 2020-02-06 13:07:46 -05:00
leigh-mil
0af29f485e Add celery task for finding unsent TO and sending them to Microsoft 2020-02-06 13:07:46 -05:00
dandds
872500099e Merge branch 'staging' into environment-role-creation 2020-02-06 05:57:06 -05:00
dandds
4da68a1fab WIP: orchestration for env role creation 2020-02-05 15:56:53 -05:00
tomdds
e702c42fa5 Merge branch 'staging' into environment-mgmt-grp-provisioning 2020-02-04 17:05:24 -05:00
tomdds
ca4feaa403 post-rebase fixes 2020-02-04 15:39:03 -05:00
tomdds
1a7db62dac Remove Environment level user provisioning 2020-02-04 15:22:34 -05:00
tomdds
bcb552134b Update tests for environment management group provisioning 2020-02-04 15:21:41 -05:00
dandds
05f6b36ece Update SQL query to find pending portfolios.
The query to find portfolios that are pending provisioning is updated to
check for:

- a period of performance that has started
- a portfolio state machine that has an UNSTARTED or one of the CREATED
  states

I left several TODOs to ensure that the orchestration functions
correctly for portfolio.
2020-02-04 10:16:02 -05:00
dandds
6b8d9d1d65 Celery wrapper for creating a user. 2020-02-02 14:42:44 -05:00
dandds
cc28f53999 Function for claiming multiple resources at once.
Like claim_for_update, the claim_many_for_update claims resources with
an expiring lock. This was written to allow the updating of multiple
application roles with a single cloud_id, since multiple application
roles will map to a single Azure Active Directory user.
2020-02-02 14:19:13 -05:00
dandds
8810a59e0a Orchestration for creating app management groups.
This adds:
- A Celery beat task for enqueuing application creation tasks
- A Celery task for creating the application
- Payload and Response dataclasses for creating management groups

It also does some incidental cleanup.
2020-01-26 12:23:33 -05:00
dandds
bfc0692063 Remove multiple job failure tables in favor of one.
We don't know yet how useful the job failue tables will be, and
maintaining multiple failure tables--one for every entity involved in
CSP provisioning--is burdensome. This collapses them all into a single
table that track the entity type (environment, portfolio, etc.) and the
entity ID. That way we can construct queries when needed to find task
results.
2020-01-25 15:50:01 -05:00
tomdds
d81d953c31 Fix formatting and some typos 2020-01-14 16:36:16 -05:00
Philip Kalinsky
69bd2f43a5 provision portfolio state machine 2020-01-14 16:36:16 -05:00
leigh-mil
17864cc060 Add migration to change environment_roles role column from string to
enum type.
Fix tests and functions affected by the column type change.
2020-01-14 13:12:29 -05:00
leigh-mil
e64900245d Remove baseline_info column from environments table 2019-10-30 14:46:33 -04:00
richard-dds
184b58d5d2 Remove AWSCloudProvider 2019-10-28 13:55:34 -04:00
richard-dds
6ea17bb4f8 Merge create_environment and create_environment_baseline 2019-10-28 13:39:40 -04:00
richard-dds
1bce0a1f01 Revert user deletion job 2019-10-14 16:51:19 -04:00
leigh-mil
10c16cc4ef Send email after environment is provisioned 2019-10-10 09:45:01 -04:00
richard-dds
ed7bc33e44 Set deleted flag in do_delete_user 2019-10-08 16:42:25 -04:00
richard-dds
343e989de8 Update comments 2019-10-08 16:42:25 -04:00
richard-dds
2ad30b5fa4 Implement dispatch_delete_user job 2019-10-08 16:42:25 -04:00
richard-dds
00f76ae5af Add delete user job 2019-10-08 16:42:25 -04:00
richard-dds
d60cc58dee
Merge pull request #1083 from dod-ccpo/user-provisioning-task
Add create_user task
2019-09-24 13:50:17 -04:00
dandds
0d45be68d5 Adjust environment claim test to avoid race condition 2019-09-23 14:53:18 -04:00
richard-dds
399cf74ed6 Only provision EnvironmentRoles with active ApplicationRoles 2019-09-23 11:30:06 -04:00
richard-dds
4eee06ba44 Add test for do_provision_user 2019-09-20 11:43:19 -04:00
richard-dds
2fca542100 Implement dispatch query for provision_user 2019-09-20 11:37:18 -04:00
richard-dds
d1e146f577 Add create_user task 2019-09-19 16:56:36 -04:00
richard-dds
6c7667b7fc Filter out deleted envs in dispatch_create_environment 2019-09-19 14:24:39 -04:00
richard-dds
2fc7a0d460 Add small sleep to claims test to avoid random failures 2019-09-18 16:34:56 -04:00
richard-dds
343e5a52ac Use session.refresh in tests 2019-09-17 15:29:33 -04:00
richard-dds
3f072bac3c Remove unused users 2019-09-17 15:28:07 -04:00
richard-dds
ade7dc08fd Only fetch environment_id in provisioning queries 2019-09-17 15:27:03 -04:00
richard-dds
68ac7aecdf More test cleanup 2019-09-17 11:47:06 -04:00
richard-dds
23261da3af Use None isntead of sql.null 2019-09-17 11:15:25 -04:00
richard-dds
abeadee3f3 Claim resource only temporarily 2019-09-17 11:03:33 -04:00
richard-dds
945debe6ee Move claim_for_update to models.utils 2019-09-17 10:39:59 -04:00
richard-dds
67a2905d51 Make claim_for_update easier to follow 2019-09-16 17:03:57 -04:00
richard-dds
4624acd1c5 Remove unused import 2019-09-16 17:00:05 -04:00
richard-dds
2bbe974755 Implement simple locking system for environments 2019-09-16 16:39:37 -04:00
richard-dds
1a9c34d856 Fix and test environment dispatch tasks 2019-09-11 11:43:06 -04:00
richard-dds
4405ed91d5 Fix migration path 2019-09-11 11:42:36 -04:00
richard-dds
e3ea2d2fe5 Move "envs pending creation" query to Environments domain 2019-09-11 11:41:10 -04:00
richard-dds
4a5ca1cd27 Add query for environments pending creation 2019-09-11 11:41:10 -04:00