-
Notifications
You must be signed in to change notification settings - Fork 33
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 helper function for UserSignup creation in verification tests #492
base: master
Are you sure you want to change the base?
use helper function for UserSignup creation in verification tests #492
Conversation
Quality Gate failedFailed conditions |
@MatousJobanek: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
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!
Thanks for cleaning it up.
I have only one minor comment/question.
userSignup := testusersignup.NewUserSignup( | ||
testusersignup.WithName("johny"), | ||
testusersignup.WithLabel(toolchainv1alpha1.UserSignupUserPhoneHashLabelKey, "+1NUMBER"), | ||
testusersignup.VerificationRequired(0)) |
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.
does this have the same effect as :
states.SetVerificationRequired(userSignup, true)
?
It looks like the latter sets the UserSignupStateVerificationRequired
in the UserSignup.Spec.States
and it doesn't update the conditions .
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.
minor and not related to this PR - also I found it a bit confusing at first to see the 0
value as parameter testusersignup.VerificationRequired(0)
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.
Yeah, it's weird - I've created a PR to align the names a bit codeready-toolchain/toolchain-common#445
It looks like the latter sets the UserSignupStateVerificationRequired in the UserSignup.Spec.States and it doesn't update the conditions
you are right, the testusersignup.VerificationRequired
updates also the conditions which wasn't done before, technically speaking, the UserSignup should look like that, so it's closer to the real scenario now.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexeykazakov, MatousJobanek, mfrancisc 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 |
This PR replaces manual creation of UserSignups with helper functions from toolchain common.
Why?
My ultimate goal is to clean up the leftovers that stayed there after the migration of the naming format of UserSignups that happened a few years ago.
registration-service/pkg/signup/service/signup_service.go
Lines 557 to 575 in 690bb9c
We don't use the
sub
claim (userID) for UserSignups for a few years, but most of the unit tests still do that. This change is to minimize the final PR(s) that will drop the usage & support of the UserSignups with names equal to thesub
claim (userID).