-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add feature toggle annotations to Space & NSTemplateSet #1048
Add feature toggle annotations to Space & NSTemplateSet #1048
Conversation
Skipping CI for Draft Pull Request. |
@@ -42,228 +42,259 @@ func TestCreateSpace(t *testing.T) { | |||
require.NoError(t, err) | |||
base1nsTier := tiertest.Base1nsTier(t, tiertest.CurrentBase1nsTemplates) | |||
t.Run("success", func(t *testing.T) { | |||
// given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that there are a lot of changes in this test but it's actually almost the same test but wrapped with a table for two usecases:
- with a feature toggle annotation in the Space
- without any
spaceOptions := []spacetest.Option{spacetest.WithSpecTargetCluster("member-1")} | ||
if testRun.featureToggles != "" { | ||
spaceOptions = append(spaceOptions, spacetest.WithAnnotation(toolchainv1alpha1.FeatureToggleNameAnnotationKey, testRun.featureToggles)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first change in this test: Adding the feature annotation to the Space depending on the specific test from the table.
if testRun.featureToggles != "" { | ||
nsTmplSetAssertion = nsTmplSetAssertion. | ||
HasAnnotationWithValue(toolchainv1alpha1.FeatureToggleNameAnnotationKey, testRun.featureToggles) | ||
} else { | ||
nsTmplSetAssertion = nsTmplSetAssertion. | ||
DoesNotHaveAnnotation(toolchainv1alpha1.FeatureToggleNameAnnotationKey) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the second change. Check the NsTemplateSet feature annotation if it's present in the Space.
The rest of this test is not changed and just formatted to be moved to the table test wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall, just comments about the var names (naming is hard! 😅)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
largely LGTM. Just some ideas for enhancing tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job 👏
I have only few minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job 🚀
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment regarding the unit test; otherwise, it looks good 🚀
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, MatousJobanek, mfrancisc, rajivnathan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Co-authored-by: Matous Jobanek <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1048 +/- ##
==========================================
+ Coverage 84.83% 84.91% +0.08%
==========================================
Files 55 55
Lines 4972 5012 +40
==========================================
+ Hits 4218 4256 +38
- Misses 581 583 +2
Partials 173 173
|
a5e0448
into
codeready-toolchain:master
Part of https://issues.redhat.com/browse/SANDBOX-653
This PR introduces feature lottery drawing for Spaces. If there is features defined in the Tier section of the Configuration then the corresponding annotation added for all winning features to the Space during its creation. This annotation is also propagated to NSTemplateSet.
See more details here: https://docs.google.com/document/d/1YWaR94JTrVBBVoMSjgIb8jb2FkqKiT1myVib9Qv0BzU/edit#bookmark=id.k3fvz630dsa6
Requires codeready-toolchain/toolchain-common#409
The member operator part is here: codeready-toolchain/member-operator#580
This PR and member operator PR are related but independent.
There is no e2e tests yet. We will think about adding some later when other pieces of the entire flow are addressed in following PRs.