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: split Reconciler from Reconcile in a few methods #926

Merged
merged 3 commits into from
Dec 12, 2021

Conversation

fgalind1
Copy link
Contributor

Reduce a bit the size of Reconcile() method from ~400 to ~300 to be easier to understand

Functionality kept the same, just some logic from Reconcile was abstracted into 3 additional methods

@stale
Copy link

stale bot commented Nov 28, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 28, 2021
@mumoshu mumoshu added enhancement New feature or request and removed stale labels Nov 29, 2021
@mumoshu
Copy link
Collaborator

mumoshu commented Nov 29, 2021

@fgalind1 Thanks for your contribution and sorry for the delay! We're planning to review and merge this BEFORE our next minor release(=a feature release).

The rationale is that, although I believe you've done it perfectly, I'm not sure if this doesn't actually break anything, as our unit test and integration test suite are far from 100% coverage. So I'd like to make it as a part of a feature release rather than a patch release, so that we can better communicate via the semver that it may break something(unexpectedly) due to new features) than nothing.

@mumoshu mumoshu added this to the v0.21.0 milestone Nov 29, 2021
@mumoshu
Copy link
Collaborator

mumoshu commented Dec 12, 2021

Maybe you introduced some compile errors when you kindly tried to rebase your work on our latest main branch! I'll try to fix it myself. Wish I'll be able to manage it!

fgalind1 and others added 2 commits December 12, 2021 04:30
Reduce a bit the size of Reconcile() method from ~400 to ~300 to be
easier to understand
Comment on lines +318 to +326
} else if offline {
if registrationOnly {
log.Info(
"Observed that registration-only runner for scaling-from-zero has successfully been registered.",
"podCreationTimestamp", pod.CreationTimestamp,
"currentTime", currentTime,
"configuredRegistrationTimeout", registrationTimeout,
)
} else if registrationDidTimeout {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems this is duplicate of L327-L334

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fixed in 21a2ba9

Copy link
Collaborator

@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

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

Hey! I was able to fix the build error and I manually took diffs around these changes:

  • Extraction of processRunnerDeletion
  • Extraction of processRunnerCreation
  • Return on r.processRunnerCreation so that you can decrease the indent-level of all the lines bellow that return (formerly it was intended within a else block)

Everything looks good now.

If there's next chance you kindly contribute to this project, if I could ask, it would be super helpful if you could split it into 3 commits like the above so that it is immediately clear for maintainers where to look for review!

Thank you for your contribution. This LGTM now. Merging.

@mumoshu mumoshu merged commit f0fccc0 into actions:master Dec 12, 2021
@fgalind1
Copy link
Contributor Author

If there's next chance you kindly contribute to this project, if I could ask, it would be super helpful if you could split it into 3 commits like the above so that it is immediately clear for maintainers where to look for review!

Will do, thanks on this.

Thank you for your contribution. This LGTM now. Merging.

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants