Conversation
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
|
||
if i != j { | ||
if strings.HasPrefix(cn, customerName+"-") { | ||
return false |
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.
i think it should also return a error msg specifying which username(s) caused this validation to fail and if possible, we should expose that in the PR automatically.
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.
That's a good point. Perhaps we can change this to return the names which conflict @viveksyngh for debugging and better diagnostics?
@@ -11,3 +14,19 @@ func ValidateCustomers() bool { | |||
} | |||
return true | |||
} | |||
|
|||
//ValidateCustomerList validate customer names list |
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.
where are we calling this function?
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 will be called inside function once we release new version of sdk and the vendor it inside the function.
for j, cn := range customers { | ||
|
||
if i != j { | ||
if strings.HasPrefix(cn, customerName+"-") { |
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.
while we are at it, do we want to add validation for duplicate check?
I'll merge this as the initial implementation. A list of conflicting users would be ideal for a follow-up PR. |
@martindekov @viveksyngh @s8sg please advise on which functions you believe we need to add this to? I'm guessing system-github-event and system-gitlab-event? |
Yes, for GitLab the |
But isn't the |
Signed-off-by: Vivek Singh vivekkmr45@yahoo.in
Description
#391
How Has This Been Tested?
How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have:
git commit -s