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

use common stackManager interface and fakes across packages #3216

Merged
merged 2 commits into from
Feb 8, 2021

Conversation

aclevername
Copy link
Contributor

@aclevername aclevername commented Feb 5, 2021

Description

First of many small PRs relating to #2931. This introduces a stackManager interface and fake that can be used to mock out the package directly, it should make testing this in the future easier.

This also highlights how INSANELY big the stack collection is, we should try to refactor this out into smaller sub packages in the future

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the userdocs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes
  • (Core team) Added labels for change area (e.g. area/nodegroup) and kind (e.g. kind/improvement)

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@aclevername aclevername added technical debt skip-release-notes Causes PR not to show in release notes labels Feb 5, 2021
@aclevername aclevername force-pushed the refactor-stack-manager branch from 108f80b to aa6ae5e Compare February 5, 2021 12:39
@aclevername aclevername marked this pull request as ready for review February 5, 2021 12:39
@aclevername aclevername requested a review from a team February 5, 2021 12:48
@aclevername aclevername force-pushed the refactor-stack-manager branch from aa6ae5e to 46b8492 Compare February 5, 2021 15:21
clientSet kubeclient.Interface
}

//go:generate counterfeiter -o fakes/fake_stack_manager.go . StackManager
type StackManager interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

These custom interfaces are actually kind of useful for seeing which parts of the StackManager are used around the codebase, could be a guide to splitting it up

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I don't disagree, me and @Callisto13 had a chat about wether to keep these or not in the issue #2931 (comment), I'm quite torn.

Copy link
Contributor

Choose a reason for hiding this comment

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

Mike does have a point that it could make things easier when we come to splitting that beast of a stack manager.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does, but like you pointed out in the issue it means loads of duplication in what is likely every package and if I had to guess would make people writing tests less likely 🤷 I'm leaning towards this at the moment as it enables everyone to very quick start adding tests

@aclevername aclevername force-pushed the refactor-stack-manager branch from 46b8492 to 213cb46 Compare February 8, 2021 10:15
@aclevername aclevername force-pushed the refactor-stack-manager branch from 2b0a176 to ccdd3ab Compare February 8, 2021 16:01
@weaveworksbot weaveworksbot merged commit c73794a into eksctl-io:main Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-release-notes Causes PR not to show in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants