-
Notifications
You must be signed in to change notification settings - Fork 21
[RW-11461] UpdateAppConfig to change autodelete settings #4575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4575 +/- ##
========================================
Coverage 73.68% 73.68%
========================================
Files 159 159
Lines 14724 14764 +40
Branches 1166 1133 -33
========================================
+ Hits 10849 10879 +30
- Misses 3875 3885 +10
Continue to review full report in Codecov by Sentry.
|
5f2fabb to
9f97d25
Compare
| } | ||
|
|
||
| "checkIfAppCreationIsAllowedAndIsAoU" should "enable IntraNodeVisibility if customApp check is disabled" in { | ||
| "checkIfAppCreationIsAllowed" should "enable IntraNodeVisibility if customApp check is disabled" in { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR, but I happened to notice that this did not match the method name
| ) | ||
|
|
||
| tags = Map("appType" -> appResult.app.appType.toString) | ||
| _ <- metrics.incrementCounter("updateAppConfig", 1, tags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the counter is sometimes incremented at the Service level and sometimes at the Routes level. Unclear which to choose.
core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/appRoutesModels.scala
Outdated
Show resolved
Hide resolved
|
Moving back to Draft while I have a think about logic/semantics |
e2acd3a to
5c60e15
Compare
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/api/AppRoutes.scala
Outdated
Show resolved
Hide resolved
http/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/api/AppRoutes.scala
Outdated
Show resolved
Hide resolved
...main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala
Outdated
Show resolved
Hide resolved
...main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala
Show resolved
Hide resolved
...main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala
Outdated
Show resolved
Hide resolved
...main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala
Outdated
Show resolved
Hide resolved
core/src/main/scala/org/broadinstitute/dsde/workbench/leonardo/http/appRoutesModels.scala
Outdated
Show resolved
Hide resolved
...main/scala/org/broadinstitute/dsde/workbench/leonardo/http/service/LeoAppServiceInterp.scala
Outdated
Show resolved
Hide resolved
dbe77ac to
30b3b72
Compare
| ) | ||
| } | ||
|
|
||
| private[service] def validateAutodelete(autodeleteEnabled: Boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure where this should be placed. thoughts?
| BadRequestException("autodeleteThreshold should be a positive value", Some(ctx.traceId)) | ||
| ) | ||
| autodeleteEnabled = req.autodeleteEnabled.getOrElse(false) | ||
| _ <- validateAutodelete(autodeleteEnabled, req.autodeleteThreshold, ctx.traceId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that this makes the Create App validation more strict, to match
| appQuery | ||
| .updateAutodeleteThreshold(appId, Some(threshold)) | ||
| ) | ||
| } yield ()).transaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want to commit one without the other!
Example: the app had a 1-hour threshold, but it was disabled. Now the user wants to enable with a 10-hour threshold. If only the first change goes through, the app has a surprise active 1-hour threshold.
4d21ab8 to
b1cd3ad
Compare
510a802 to
caaee02
Compare
fe3810e to
b995b35
Compare
Jira ticket: https://precisionmedicineinitiative.atlassian.net/browse/RW-11461 (requires PMI-OPS Jira access)
Includes the work from the previous draft #4232
Summary of changes
Adds a new endpoint "Update App Config"
PATCH /api/google/v1/apps/{googleProject}/{appName}which allows users to modify the two autodelete app config fields:autodeleteEnabledandautodeleteThreshold. Requests can contain changes to one field or both (or neither) as long as (a) any specified threshold is a positive integer and (b) any requests which enable autodelete without specifying the threshold correspond to apps with pre-existing valid thresholds in the DB.More details here: https://docs.google.com/document/d/1eWfY8PQoDKVOdIeREuEC9ObLhXlsTtG2ugLwuqov81k/edit#bookmark=id.n9sphs8lpm4l
What
Why
Testing these changes
I deployed this change to a BEE and created a Galaxy app in the BEE's Terra UI. I then observed that the app state (as seen via GET app) responded to my PATCH changes as expected.
What to test
Who tested and where
jenkins retestorjenkins multi-test.