-
Notifications
You must be signed in to change notification settings - Fork 35
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
update add apis - process everything before return an error #86
Conversation
Signed-off-by: Stephanie <[email protected]>
@@ -51,15 +52,19 @@ func (d *DevfileV2) GetCommands(options common.DevfileOptions) ([]v1.Command, er | |||
// AddCommands adds the slice of Command objects to the Devfile's commands | |||
// if a command is already defined, error out |
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.
could you pls update the func desc for all the Add funcs, it errors out after processing everything
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.
updated
errorsList = append(errorsList, (&common.FieldAlreadyExistError{Name: command.Id, Field: "command"}).Error()) | ||
continue |
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.
IMO we should update teh test to see if all these ids are being returned in the err. Previously we didnt care as it was just return on first error. But since we are updating it for a specific purpose we should probably test it. We can use regex to match err strings like we do in devfile/api 🤔
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.
updated
Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Stephanie <[email protected]>
964bbca
to
25af2f1
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maysunfaisal, yangcao77 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 |
Signed-off-by: Stephanie [email protected]
What does this PR do?
This PR updates add apis to process everything before return an error.
The error returned is a total error which contains error of all invalid elements during that add action
What issues does this PR fix or reference?
Fixes devfile/api#449
Is your PR tested? Consider putting some instruction how to test your changes
update unit tests to check for error message