Description of problem: Currently, the `Import from Git` flow from the `+Add` page can be really misleading with the Openshift 4.10 (4.10.0-0.nightly-2022-01-26-234447) A couple of examples using the following repositories: 1. Repository with devfile v1 e.g. https://github.com/edeandrea/summit-lab-spring-music ERROR: Import is not possible. Failed to parse devfile: schemaVersion not present in devfile: However, devfile is valid and the error message is misleading - https://github.com/edeandrea/summit-lab-spring-music/blob/pipeline/devfile.yaml The error message could be better e.g. `deviles v1 are not suported` 2. Repository with Devfile 2.1 - https://github.com/eclipse-che/blog ERROR: Import is not possible. Console Devfile Import Dev Preview, supports only one image component, now has 0 The error message should provide clarification why this particular devfile can not be used for the import. In general, it looks like `Import from Git` flow expects very specific devfiles with an image component for outerloop deployment e.g. https://registry.devfile.io/viewer/devfiles/Community+nodejs-basic Other valid devfiles v1, v2.1, v2.2 could fail with `ERROR: Import is not possible` + error message with no clarification on how to fix it. Additional info: In general, if devfile is not supported it might be a good idea to switch automatically to another import strategy e.g. "Builder Image", or provide clear instructions/documentation link with clarification on how to make a proper devfile for the `Git Import` flow
1. The devfile is actually not valid for the devfile 2.x spec. That error is coming from a combination of ODC and devfile library. The error from the devfile library side is correct since devfile v1 and v2 are using different fields to store the devfile version number. Devfile 2.x is using `schemaVersion` while devfile 1 is using `apiVersion`. The listed devfile is missing the `schemaVersion` field so the error message is correct. I suggest fixing the message on the ODC side since ODC only supports devfile 2.2 or above (since this is ODC specific) by changing/adding to the generic "ERROR: Import is not possible." to something more specific that mention only supporting devfiles using version 2.2 or above. 2. Again, since ODC only supports devfile 2.2, we should provide similar message as suggested in #1.
I assume the part "ERROR: Import is not possible" is the generic import error message that ODC provides and will remain unchanged. It is the second line of the error that needs to be updated. 1. Original: ERROR: Import is not possible. Failed to parse devfile: schemaVersion not present in devfile: Suggested: ERROR: Import is not possible. Failed to parse devfile: schemaVersion not present in devfile. Only devfile 2.2.0 or above is supported. The devfile needs to have the schemaVersion set in the metadata section with a value of 2.2.0 or above. 2. Original: ERROR: Import is not possible. Console Devfile Import Dev Preview, supports only one image component, now has 0 Suggested: ERROR: Import is not possible. Only devfile 2.2.0 or above with one image component is supported. If we have any documentation that documents the requirement, also add this to the end of the message above: Refer to ??? for more details.
Verified improved labels on 4.11.0-0.nightly-2022-06-15-222801 Hey ibuziuk, please take a look and reopen the issue if you see any other improvement options.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5069