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-849][WOR-850][WOR-852] Create BPM billing profile for GCP billing projects. #2698

Merged
merged 18 commits into from
Feb 23, 2024

Conversation

cahrens
Copy link
Contributor

@cahrens cahrens commented Jan 14, 2024

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

This is the first in a group of tickets that will need to merge together, so keep on a feature branch.

Testing: in addition to the unit tests, I created a GCP billing project using my locally running Rawls. We don't return the billing profile ID when fetching billing project details, but I was able to check in the debugger that we have persisted the ID and thus can fetch the billing profile (which we do to add policies and Azure MRG information).

image


PR checklist

  • Include the JIRA issue number in the PR description and title
  • Make sure Swagger is updated if API changes
    • ...and Orchestration's Swagger too!
  • If you changed anything in model/, then you should publish a new official rawls-model and update rawls-model in Orchestration's dependencies.
  • Get two thumbsworth of PR review
  • Verify all tests go green, including CI tests
  • Squash commits and merge to develop (branches are automatically deleted after merging)
  • Inform other teams of any substantial changes via Slack and/or email

@cahrens
Copy link
Contributor Author

cahrens commented Jan 16, 2024

jenkins retest

@cahrens cahrens changed the title Create profile model for GCP projects. [WOR-849, DO NOT MERGE] Create profile model for GCP projects. Jan 16, 2024
@cahrens cahrens marked this pull request as ready for review January 17, 2024 16:37
@cahrens cahrens requested review from a team, blakery, okotsopoulos and marctalbott and removed request for a team January 17, 2024 16:38
@cahrens cahrens marked this pull request as draft January 17, 2024 16:44
@cahrens
Copy link
Contributor Author

cahrens commented Jan 17, 2024

Oops, test failures appeared with my last change. I will investigate and put back into review when they are passing.

@cahrens cahrens changed the title [WOR-849, DO NOT MERGE] Create profile model for GCP projects. [WOR-849, DO NOT MERGE] Create BPM billing profile for GCP billing projects. Jan 17, 2024
@cahrens
Copy link
Contributor Author

cahrens commented Jan 17, 2024

jenkins retest

@cahrens
Copy link
Contributor Author

cahrens commented Jan 17, 2024

jenkins retest

@cahrens cahrens marked this pull request as ready for review January 17, 2024 20:14
Copy link

@okotsopoulos okotsopoulos left a comment

Choose a reason for hiding this comment

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

Looks good! I had a few questions. Tomorrow I'll check out your feature branch and see about creating profiles locally, I think that would be a good exercise for me.

mock[MultiCloudWorkspaceConfig],
testContext
),
Duration.Inf

Choose a reason for hiding this comment

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

Do we want to allow an infinite wait here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We seem to do this all over the tests. I honestly don't know what the alternative would be.

Choose a reason for hiding this comment

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

(Not a blocker to merge) In places where we have to wait in a test, it's usually preferable to set some kind of timeout, considering our expectations on how long something will take plus a sizable buffer to avoid needlessly flaky tests. That way a test will fail fast(er) if it's stuck, and go onto a retry if those are configured.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marctalbott do you happen to know the best practice for Scala unittests? I think Duration.Inf is what we commonly use.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, everything is mocked out, so I have no problem with using Duration.Inf here. The Await is a means to get the value out of the Future -- the timeout won't have any impact as we're not really waiting for anything in this test since Mockito will return all Futures quickly.

As for other uses of Duration.Inf in Rawls unit tests, I'm sure there are places we're misusing it. Still, I'm not that worried about those places since they're all unit tests and in theory won't be waiting for long. I'd be very concerned if we had infinite waits in our integration tests.

@cahrens cahrens marked this pull request as draft January 23, 2024 14:06
@cahrens
Copy link
Contributor Author

cahrens commented Jan 23, 2024

Converting to draft so we don't get review reminders about this (or accidentally merge it).

@cahrens cahrens removed the request for review from blakery January 23, 2024 14:07
@marctalbott marctalbott marked this pull request as ready for review February 22, 2024 21:05
@marctalbott marctalbott changed the title [WOR-849, DO NOT MERGE] Create BPM billing profile for GCP billing projects. [WOR-849][WOR-850][WOR-852] Create BPM billing profile for GCP billing projects. Feb 22, 2024
@marctalbott marctalbott merged commit 49d4e4c into develop Feb 23, 2024
13 checks passed
@marctalbott marctalbott deleted the WOR-849 branch February 23, 2024 19:44
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