Skip to content
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-850] Delete billing profile during billing project deletion (GCP) #2715

Merged
merged 4 commits into from
Jan 29, 2024

Conversation

cahrens
Copy link
Contributor

@cahrens cahrens commented Jan 26, 2024

Ticket: https://broadworkbench.atlassian.net/browse/WOR-850

This PR adds the code for GCP billing project deletion to also delete the associated billing profile, if it exists. Note that this is against a feature branch (which creates the billing profile during GCP billing project creation).

Tested running Rawls locally to create and delete GCP billing projects.

Future.successful()
case (None, false) =>
logger.info(
s"Deleting billing project $projectName, but no associated billing profile record to delete (could be a legacy project)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we have backfilled billing profiles for existing GCP billing projects, we can get rid of this case.

@@ -184,10 +184,10 @@ class BillingProjectOrchestrator(ctx: RawlsRequestContext,
)
)
}
billingProfileId <- billingRepository.getBillingProfileId(projectName)
projectLifecycle = billingProfileId match {
azureManagedAppCoordinates <- billingRepository.getAzureManagedAppCoordinates(projectName)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to change how we decide if the billing project is an Azure one. Note that we don't store a cloudPlatform.

@cahrens cahrens marked this pull request as ready for review January 29, 2024 15:51
@cahrens cahrens requested review from a team, blakery and okotsopoulos and removed request for a team January 29, 2024 15:51
@cahrens cahrens merged commit 43204e8 into WOR-849 Jan 29, 2024
8 checks passed
@cahrens cahrens deleted the WOR-850 branch January 29, 2024 20:24
marctalbott added a commit that referenced this pull request Feb 23, 2024
…g projects. (#2698)

* Create profile model for GCP projects.

* rename

* Refactoring

* Try removing the prefix

* Test removal of prefix.

* Store the billing profile ID in the billing project.

* Split tests, mock repo.

* Code review feedback.

* [WOR-850] Delete billing profile during billing project deletion (GCP) (#2715)

* [WOR-852] Update billing profile when updating billing account (#2736)

* add missing implicits to pact tests

* add null values to expected createProfile request

* specify GCP as billing project's cloud platform after updating billing account

---------

Co-authored-by: Marcus Talbott <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants