Unravel implicit dependency inside providers between SetupAndValidateCreateCluster and GenerateCAPISpecForCreate
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 328
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 9
Description
**What would you like to be added**:
As discussed in https://github.com/aws/eks-anywhere/pull/1675#discussion_r837718690, there is an implicit dependency between the GenerateCAPISpecForCreate and SetupAndValidateCreateCluster methods in that SetupAndValidateCreateCluster needs to be called beforehand to modify some parameters in the cluster spec before the capi spec can be generated properly. This makes testing difficult because tests must call both methods to have properly formatted test data to assert on, and they cannot be tested well in isolation
**Why is this needed**:
The dependent nature between these methods may lead to false positives in the tests, or false negatives where some behavior is broken but not detected because the methods are not tested in isolation.
Contributor guide
Research direction
Locate the provider implementations of SetupAndValidateCreateCluster and GenerateCAPISpecForCreate, then read the tests that call them together. Trace which cluster-spec parameters are changed before CAPI generation and define how each method can be tested in isolation. Done means the implicit ordering dependency is removed and the relevant tests no longer require both methods for valid input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- infrastructure
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100