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

refactor(gce): Refactor BasicGoogleDeployHandler to be more readable and testable #6290

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

edgarulg
Copy link
Contributor

@edgarulg edgarulg commented Oct 10, 2024

Key point about the refactor.

  1. I translated the whole class BasicGoogleDeployHandler into java.
  2. I split up the handle method into small single responsibility methods.
  3. I defined unit testing for most of the new methods I created to prove functionality.
  4. I do not include any new feature or change that was not defined by the BasicGoogleDeployHandler before.

Related to: spinnaker/spinnaker#6985

@edgarulg
Copy link
Contributor Author

I published and deployed a snapshot version with my refactor and I validated a GCE deploy worked as expected. I didn't tests all possible configurations as part of my e2e validation.

@edgarulg
Copy link
Contributor Author

@Mergifyio refresh

Copy link
Contributor

mergify bot commented Oct 23, 2024

refresh

✅ Pull request refreshed

@edgarulg
Copy link
Contributor Author

@Mergifyio rebase

Copy link
Contributor

mergify bot commented Oct 23, 2024

rebase

☑️ Nothing to do

  • -conflict [📌 rebase requirement]
  • -closed [📌 rebase requirement]
  • queue-position = -1 [📌 rebase requirement]
  • any of:
    • #commits > 1 [📌 rebase requirement]
    • #commits-behind > 0 [📌 rebase requirement]
    • -linear-history [📌 rebase requirement]

@@ -920,7 +920,7 @@ class GCEUtil {
: []
}

static ServiceAccount buildScheduling(BaseGoogleInstanceDescription description) {
static Scheduling buildScheduling(BaseGoogleInstanceDescription description) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How did this ever work before?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

OK. I suppose in some future we'll change GCEUtil to java too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that is the plan

log.info(
String.format(
"Configuring explicit zones selected for regional server group: %s",
description.getDistributionPolicy().getZones().get(0)));
Copy link
Member

Choose a reason for hiding this comment

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

get 0 - just the one? NOT checked old code... but we're streaming below which may mean multiple zones...

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