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

Validate devfile with schema with matching apiVersion #14824

Closed
sparkoo opened this issue Oct 9, 2019 · 3 comments
Closed

Validate devfile with schema with matching apiVersion #14824

sparkoo opened this issue Oct 9, 2019 · 3 comments
Assignees
Labels
kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.
Milestone

Comments

@sparkoo
Copy link
Member

sparkoo commented Oct 9, 2019

Is your enhancement related to a problem? Please describe.

Currently, devfile apiVersion is validated at workspace start with hardcoded value. However, it is not validated at workspace create with proper schema. It is mandatory string parameter, so basically any value is valid. To support beta versions, we need to validate devfile with proper schema and apiVersion should be strictly validated.

Describe the solution you'd like

When creating workspace from devfile, read apiVersion value from devfile and find matching schema to validate devfile. When schema for version not found, return error.

Describe alternatives you've considered

  • This solution solves just one beta version with no possibility of multiple stable versions with backward incompatible changes. For more robust solution, we will have to introduce some mechanism for different logic by given apiVersion. The solution seems sufficient for current needs.
  • In case schema is not found for given apiVersion, we might want to have some default schema (1.0.0 probably) to validate. With this, we don't break already existing devfiles with invalid version (which is now basically ignored). However, having this will not force to fix invalid devfiles.

Additional context

Issue was raised up during PreviewUrl feature implementation, where we are not sure about devfile specification and we want to introduce the feature in beta version of the devfile to not break stable devfile version in the future #13945 (comment from PR #14713 (comment))

@sparkoo sparkoo added the kind/enhancement A feature request - must adhere to the feature request template. label Oct 9, 2019
@sparkoo sparkoo self-assigned this Oct 9, 2019
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Oct 9, 2019
@sparkoo sparkoo added team/platform and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Oct 9, 2019
@sparkoo sparkoo changed the title Validate devfile with schema with matching specVersion Validate devfile with schema with matching apiVersion Oct 9, 2019
@benoitf benoitf added this to the Backlog - Platform milestone Oct 9, 2019
@benoitf benoitf added the severity/P2 Has a minor but important impact to the usage or development of the system. label Oct 9, 2019
@sparkoo
Copy link
Member Author

sparkoo commented Oct 11, 2019

fixed by #14834

@sparkoo
Copy link
Member Author

sparkoo commented Oct 12, 2019

reopened because of this small patch in PR #14869

@sparkoo sparkoo reopened this Oct 12, 2019
@sparkoo
Copy link
Member Author

sparkoo commented Oct 12, 2019

fixed #14869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

3 participants