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

A workaround for 'ODO' stopped working after Devfile schema update to v.2.2.2 #4183 #4185

Conversation

vrubezhny
Copy link
Contributor

@vrubezhny vrubezhny commented Jun 6, 2024

This is the only workaround limiting the devfile version for node.js component to v.2.2.0 when running the integration tests

Issue: #4183

… v.2.2.2 redhat-developer#4183

This is the only workaround limiting the devfile version for node.js component to v.2.2.0

Issue: redhat-developer#4183

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.87%. Comparing base (da60441) to head (0460d6f).
Report is 276 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4185       +/-   ##
===========================================
+ Coverage   32.37%   43.87%   +11.50%     
===========================================
  Files          85       95       +10     
  Lines        6505     7710     +1205     
  Branches     1349     1630      +281     
===========================================
+ Hits         2106     3383     +1277     
+ Misses       4399     4327       -72     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vrubezhny vrubezhny changed the title A workaround for 'ODO' stopped working after Devfile schema update to… A workaround for 'ODO' stopped working after Devfile schema update to v.2.2.2 #4183 Jun 7, 2024
@vrubezhny vrubezhny requested a review from datho7561 June 7, 2024 00:15
@@ -109,6 +109,7 @@ export class Odo {
starter: string = undefined,
useExistingDevfile = false,
customDevfilePath = '',
devfileVersion?: string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does it know which version of devfile it should not update to? we need to define it somewhere.

Copy link
Contributor Author

@vrubezhny vrubezhny Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only a workaround to make the test working with current officially released 'odo' version and the Default Devfile Registry.

The officially released 'odo' supports devfile schema versions <= 2.2.0. So this version is provided as the value of this argument hereafter in the test when creating a component from 'node.js' devfile (because this devfile has multiple versions and [if not specifying this argument] odo returns the default one, which currently is set to be > 2.2.0.

We do not provide this argument value when creating a component with 'Go' devfile - its devfile returned by default has schema version < 2.2.0 so it perfectly works with odo.

Copy link
Collaborator

@mohitsuman mohitsuman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devfile version info ?

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jun 7, 2024

devfile version info ?

NAME REGISTRY DESCRIPTION ARCHITECTURES VERSIONS
nodejs DefaultDevfileRegistry Node.js application 2.1.1, 2.2.0, 2.2.1

So, for these nodejs versions we're downloading devfiles with the following schema versions:

Stack Versions --> Schema Versions
nodejs 2.2.1 (latest) --> devfile 2.2.2
nodejs 2.1.1, 2.2.0 --> devfile 2.1.0

The PR makes odo to install Node.js version v.2.2.0 which makes it to download devfile with schema version 2.1.0 that odo is fully compatible with.

Default Devfile registry contains multiple versions for Node.js devfile, by default odo retrieves the devfile version marked as 'defaultwhich schema version is >2.2.0` - this make a problem for 'odo' that is officially released.

In order to fix tests we force 'odo' to retrieve a nodejs v.2.2.0 devfile with schema version === 2.1.0 instead of the default one, which makes 'odo' happy when it parses this schema.

There is a proposal to use nightly builds for 'odo' binary instead of official release (see: #4183 (comment)) - the devfile schema version issue is fixed on the main 'odo' branch and the fixed version is available at https://odo.dev/docs/overview/installation#nightly-builds

@vrubezhny vrubezhny self-assigned this Jun 7, 2024
@datho7561
Copy link
Contributor

I still don't see the Nodejs devfile listed in the devfile registry viewer, so I don't think this will do much. (eg. you can't choose to create a project based on the nodejs devfile, so it doesn't make sense to reduce the version of that devfile that's used.)

@vrubezhny
Copy link
Contributor Author

I still don't see the Nodejs devfile listed in the devfile registry viewer, so I don't think this will do much. (eg. you can't choose to create a project based on the nodejs devfile, so it doesn't make sense to reduce the version of that devfile that's used.)

This is a quite strange thing... as for the Default Devfile Registry:

... while the Devfile Registry editor shows only 11 entries.

Also, the result of odo registry --devfle-registry DefaultDevfileRegistry is a bit different from what we have on the web site, for instance the Web site contains devfile with name: wildfly while the command returns the same (or similar) defvile with name: java-wildfly... Looks like they actually reference the different registries or the output is modified somehow.

@vrubezhny vrubezhny marked this pull request as draft June 10, 2024 01:00
@vrubezhny
Copy link
Contributor Author

We probably won't need this PR if we move to using ODO nightly builds.

See: PR #4191 - [build] Use ODO binary from nightly builds #4191

@mohitsuman
Copy link
Collaborator

@vrubezhny if there is a new release of odo binary, that should fix the issue?

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jun 10, 2024

@vrubezhny if there is a new release of odo binary, that should fix the issue?

That's not a release (no more releases are produced unless they have a blocker issue), but nightly builds made from the ODO repository main branch that currently contains quite a lot of dependency updates. And the support for Devfile schema v.2.2.2 is included as well.
I've tested the current ODO nightly build: 3.15.0 (6d83e4043-nightly) - it creates a component from 'nodejs' devfile (schema v.2.2.2) with no problem:

$ odo version
odo v3.15.0 (6d83e4043-nightly)

Server: https://127.0.0.1:42801
Kubernetes: v1.27.3
Podman Client: 4.9.4

$ odo init --name=component1 --devfile=nodejs --starter=nodejs-starter
  __
 /  \__     Initializing a new component
 \__/  \    
 /  \__/    odo version: v3.15.0 (6d83e4043-nightly)
 \__/

 ✓  Downloading devfile "nodejs" [4s]
 ✓  Downloading starter project "nodejs-starter" [515ms]

Your new component 'component1' is ready in the current directory.
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.
Changes will be directly reflected on the cluster.

$ cat devfile.yaml | grep schemaVersion:
schemaVersion: 2.2.2

So, yeah. Using ODO nightly builds should fix the issue.

@vrubezhny
Copy link
Contributor Author

vrubezhny commented Jun 14, 2024

@vrubezhny if there is a new release of odo binary, that should fix the issue?

I probably got the question wrongly...

If ODO team makes a new release - then the problem will definitely be solved with no any changes from our side.

Using nightly builds looks now as a bed option, as the download URL is static and the track of nightly build binaries isn't kept - this really prevents us from using them.

Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the integration test suite for the time being, which I think is very helpful.

@vrubezhny is this ready for merge?

@vrubezhny
Copy link
Contributor Author

Closing this as not needed anymore after ODO v.3.16.1 is released and move to using ODO nightly builds for the following ODO updates

@vrubezhny vrubezhny closed this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

4 participants