-
Notifications
You must be signed in to change notification settings - Fork 674
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
Fixed bug for incorrect name #4175
Fixed bug for incorrect name #4175
Conversation
Signed-off-by: Shovit <[email protected]>
Fixed bug regarding return from invalid name error
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
@kumare3, do you think this PR can be merged? |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4175 +/- ##
==========================================
+ Coverage 58.95% 59.30% +0.34%
==========================================
Files 621 552 -69
Lines 52932 39798 -13134
==========================================
- Hits 31206 23601 -7605
+ Misses 19229 13864 -5365
+ Partials 2497 2333 -164
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
@@ -131,7 +131,7 @@ func CheckValidExecutionID(executionID, fieldName string) error { | |||
matched := executionIDRegex.MatchString(executionID) | |||
|
|||
if !matched { | |||
return errors.NewFlyteAdminErrorf(codes.InvalidArgument, "invalid %s format: %s", fieldName, executionID) | |||
return errors.NewFlyteAdminErrorf(codes.InvalidArgument, "invalid %s format: %s, does not match regex '^[a-z][a-z\-0-9]*$'", fieldName, executionID) |
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.
can we not copy paste the regex, instead print the regex value itself.
Also, update the unit tests
umm is it okay now? |
Lgtm |
while you're at it can you add the hacktoberfest label as well? |
can you share the test location? I'll update it |
I'm not familiar with these tests so i couldn't find it but the changes work well. The test just needs to be updated |
i think it's good now |
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.
Test is failing.
Error Trace: /home/runner/work/flyte/flyte/flyteadmin/pkg/manager/impl/validation/execution_validator_test.go:45
Error: Error message not equal:
expected: "invalid name format: 12345"
actual : "invalid name format: 12345, does not match regex '^[a-z][a-z\\-0-9]*$'"
Updated Test Validation for invalid name by adding the regex in the error message. Signed-off-by: Shovit <[email protected]>
Ok it should work now i updated the test |
@Virtual4087, I'll add the hacktoberfest-accepted label once the PR is merged. |
I think you guys need to update the unit test for the checks to be successful. The test expects "invalid name format: 12345" but you asked to make it ""invalid name format: 12345, does not match regex '^[a-z][a-z\-0-9]*$'". I've also updated the tests on my branch so kindly check the pr once. |
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.
Line 173 and 176 need to be updated as well.
flyte/flyteadmin/pkg/manager/impl/validation/execution_validator_test.go
Lines 173 to 176 in 4a780c3
assert.EqualError(t, err, "invalid a format: a_sdd") | |
err = CheckValidExecutionID("asd@", "a") | |
assert.NotNil(t, err) | |
assert.EqualError(t, err, "invalid a format: asd@") |
updated test to match the current changes Signed-off-by: Shovit <[email protected]>
Done |
Signed-off-by: Shovit <[email protected]>
Signed-off-by: Shovit <[email protected]>
@pingsutw, could you please review this PR now? |
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.
LGTM
Congrats on merging your first pull request! 🎉 |
Finally |
Closes #4174
Tracking issue
Describe your changes
Check all the applicable boxes
Screenshots
Note to reviewers