1465 Commits

Author SHA1 Message Date
graham-dds
108f65f928 Use pendulum for datetime operations when possible
Currently, we use both Python's built-in datetime library and Pendulum
to do datetime operations. For the sake of consistency, we should try to
stick to one library for datetimes. We could have used either, but
Pendulum has a more ergonomic API, so I decided to go with it when
possible.

The places where were we didn't / couldn't replace datetime are:
- checking instances of datetimes. Pendulum's objects are subclasses of
  python native datetime objects, so it's still useful to import
  datetime in those cases of using is_instance()
- WTForms date validators expect datetime style string formats --
  Pendulum has its own format for formatting/ parsing strings. As such,
  our custom validator DateRange needs to use datetime.stptime() to
  account for this format.
2020-02-17 10:38:52 -05:00
graham-dds
9b25a4b907 Move 'onmicrosoft.com' to an app constant 2020-02-13 10:56:01 -05:00
graham-dds
8f52443b5d Send email to PPOC when portfolio is provisioned
When a portfolio state machine transitions to the COMPLETED state, an
email is sent to the PPOC letting them know it's ready, and provides
them with their username needed to create a password.
2020-02-13 10:55:47 -05:00
4569066024 state machine last CREATED state transition to COMPLETED 2020-02-12 09:31:52 -05:00
dandds
285021de7c
Merge branch 'staging' into billing-owner 2020-02-11 16:01:27 -05:00
dandds
ceb8cdc198 update state machine enum 2020-02-11 15:18:45 -05:00
dandds
facaae5cb1 Merge branch 'staging' into billing-owner 2020-02-11 14:50:11 -05:00
graham-dds
e553a673b1 Tests for total_obligated_funds portfolio prop 2020-02-11 14:27:29 -05:00
graham-dds
52489b6bca Add upcoming_obligated_funds property to portfolio 2020-02-11 14:27:29 -05:00
dandds
10014e696d Merge branch 'staging' into environment-role-creation 2020-02-11 12:12:45 -05:00
tomdds
92bc848da5 Remove placeholder data in portfolio state machine test 2020-02-11 11:20:26 -05:00
tomdds
17b281b11a
Merge branch 'staging' into azure-initial-mgmt-grp 2020-02-11 11:06:28 -05:00
leigh-mil
7d867457fc
Merge branch 'staging' into to-index-fixes 2020-02-11 09:40:50 -05:00
tomdds
ccbc61f34f
Merge branch 'staging' into azure-initial-mgmt-grp 2020-02-10 17:44:19 -05:00
tomdds
6c0bc0dc47
Merge branch 'staging' into fix-kv-secret-update 2020-02-10 17:19:10 -05:00
tomdds
0705b47e4d
Merge branch 'staging' into fix-kv-secret-update 2020-02-10 17:04:11 -05:00
dandds
f0ddc9b2aa
Merge branch 'staging' into redis-ssl-verify 2020-02-10 17:02:26 -05:00
dandds
f975249f07 Set Redis verification mode for TLS connections.
If the app is making a TLS connection to Redis, the new config setting
REDIS_SSLMODE determines whether CA verification should be performed.
Acceptable values are Python `None` or strings "none", "optional", and
"required".
2020-02-10 16:58:07 -05:00
tomdds
e6d5369cb0 Ensure credential updates properly merge values.
Previously updating the credentials would delete values from the existing crednetials if they weren't also present in the update. This adds a method for merging credentials to the KeyVaultCredentials model and adds tests to both the cloud provider and model.
2020-02-10 16:14:42 -05:00
graham-dds
5b60a54dbc Remove fixture-based reporting methods
These methods probably can be reused to handle real Azure reporting data
2020-02-10 14:49:04 -05:00
graham-dds
63cb05249f Add Reports domain method to get portfolio spend 2020-02-10 14:49:04 -05:00
graham-dds
2f1c57aef4 Add fn to prepare Azure reporting data for views 2020-02-10 14:49:04 -05:00
leigh-mil
ff82e39626 Remove unsigned from the display statuses, show unsigned TOs display status as DRAFT 2020-02-10 11:48:15 -05:00
dandds
80894a5fb9 add to mock and FSMstates 2020-02-09 16:52:29 -05:00
dandds
23aeb77821 create billing owner 2020-02-09 16:46:29 -05:00
dandds
45dbf9454e models for creating billing owner 2020-02-09 14:52:29 -05:00
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
93840ac7b8 revert local changes 2020-02-06 12:29:54 -05:00
86c01f6987 provision initial mgmt group migration script 2020-02-06 12:11:04 -05:00
leigh-mil
6ec9fb34f9 Add query for finding Task Orders that have not been sent to MS or that have been updated. 2020-02-06 12:04:13 -05:00
eb4201d6e3 correct data class name 2020-02-06 11:26:08 -05:00
7559875d64 resolve conflict with staging 2020-02-06 10:19:47 -05:00
6420cce4fc initial mgmt group stage data classes extend the management group data class 2020-02-06 10:13:27 -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
13aca270ca Remove unused code in both the cloud interfaces and environment models. Also add tests for some untested code in the cloud interface. 2020-02-05 14:48:54 -05:00
dandds
7c7dd08827 Add environment_roles.cloud_id and update query for finding pending
roles.
2020-02-05 13:48:59 -05:00
38e92e427b resolve conflict with staging 2020-02-05 12:21:00 -05:00
tomdds
aaa4b401b5 Fix LGTM issues 2020-02-04 17:42:08 -05:00
tomdds
350e648beb Added tests for get and set secret 2020-02-04 17:39:31 -05:00
tomdds
e702c42fa5 Merge branch 'staging' into environment-mgmt-grp-provisioning 2020-02-04 17:05:24 -05:00
tomdds
4d11f7217e Add missing test for create_principal_admin_role 2020-02-04 16:43:06 -05:00
dandds
b754f1384f Include all Azure config in the INI file.
Adds all the new config items to the INI file and adjusts some naming
conventions so that these values sort together. Also adds defaults for
some values where they're known.
2020-02-04 16:12:45 -05:00
graham-dds
ff842f5051 Add cloud method to get reporting data
Adds a method to `azure_cloud_provider` to query the Cost Management API
for usage data per invoice.  For now, this query is relatively static.
We're always calling the API at the billing invoice section scope,
with the widest timeframe possible (one year), and with the same
requested dataset. As the scope of the application's reporting needs
changes, this function may change to be more general and/or revert back
to the SDK.
2020-02-04 16:07:06 -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