-
Notifications
You must be signed in to change notification settings - Fork 4
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
[WOR-1226] For Azure billing projects, return the region of the landing zone #2734
Conversation
jenkins retest |
1 similar comment
jenkins retest |
Await.result(userService.listBillingProjectsV2(), Duration.Inf) should contain theSameElementsAs expected | ||
} | ||
|
||
it should "map handle the landing zone being missing in BPM project" 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.
Nit: I understand what this means since I know the scope of changes in this PR , but the wording is kind of confusing otherwise.
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.
Thanks, it was a copy/paste error.
val landingZoneRegion = project.landingZoneId match { | ||
case Some(landingZoneId) => | ||
Try(workspaceManagerDao.getLandingZone(UUID.fromString(landingZoneId), ctx)) match { | ||
case Success(landingZone) => Some(landingZone.getRegion) |
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.
If you use Option(landingZone.getRegion)
, you'll get the result of None
if it's absent/null, and Some(region) if present. That's probably preferable to the behavior as written here, which will give
Some(null)` if the region is not present, since nulls should generally be avoided in scala (avoiding null anywhere is ideal IMO, but scala has explicit conventions around discouraging null values).
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.
Ah, definitely better. Thank you!
jenkins retest |
core/src/main/scala/org/broadinstitute/dsde/rawls/user/UserService.scala
Show resolved
Hide resolved
@blakery I addressed your feedback (and got a passing swatomation run!) |
Ticket: https://broadworkbench.atlassian.net/browse/WOR-1226
This passes through the region for Azure landing zones in the billing projects response (both list and single billing project signatures). Note that regions have been backfilled yet for existing landing zones, so old landing zones will temporarily return an empty string for region.
Response when running this branch locally against dev databases: