Skip to content
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

improve validation error messages on imported elements #397

Closed
yangcao77 opened this issue Mar 30, 2021 · 0 comments · Fixed by devfile/library#85
Closed

improve validation error messages on imported elements #397

yangcao77 opened this issue Mar 30, 2021 · 0 comments · Fixed by devfile/library#85
Assignees
Labels
area/library Common devfile library for interacting with devfiles kind/enhancement New feature or request

Comments

@yangcao77
Copy link
Contributor

yangcao77 commented Mar 30, 2021

Since the library do validation on flattened devfile, the current error message only contains the element name, does not contain the original source. It is unclear and hard to trace, library should do similar as DWO is doing: https://github.com/devfile/devworkspace-operator/blob/81b939ec513099fbb7f94959bdd5c6f37c47c62d/pkg/library/annotate/plugins.go#L22

An attribute can be added to the element before merge, validator (in devfile/api repo) can include this information in the error message

library.devfile.io/imported-by=<source-location>

This issue also expect change on devfile/api repo, as the validation is actually done in devfile/api validator.
validator will check for the specific attribute before sending back the error message. If the attribute does not exist, the error message will be as what it currently has.

@yangcao77 yangcao77 added kind/enhancement New feature or request area/library Common devfile library for interacting with devfiles labels Mar 30, 2021
@yangcao77 yangcao77 added area/api Enhancement or issue related to the api/devfile specification and removed area/api Enhancement or issue related to the api/devfile specification labels Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/library Common devfile library for interacting with devfiles kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant