-
Notifications
You must be signed in to change notification settings - Fork 63
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 Devfile Samples to reference v2.2.0 Parent stacks #1112
Update Devfile Samples to reference v2.2.0 Parent stacks #1112
Comments
@kim-tsao I'm not 100% about the workaround for this issue. In my mind I have two options:
|
@thepetk I had to verify if the extraDevfileEntries.yaml has multi-version support and it looks like it does: https://github.com/devfile/registry-support/blob/main/index/generator/tests/registry/extraDevfileEntries.yaml#L11-L23 We can set up the samples similar to the test registry nodejs sample , so option 1 is preferred but we need to see if the viewer can process samples like stacks where default versions can be specified like this example here: https://github.com/devfile/registry/blob/main/stacks/nodejs/stack.yaml |
Moving to next sprint (239) as we need to put it on hold for now. |
Resumed working on the issue. |
Working locally in order to check if the registry viewer supports sample versioning |
I've tried to check if the viewer supports multiple versions for samples:
versions:
- version: 1.0.0
schemaVersion: 2.0.0
description: nodejs with devfile v2.0.0
git:
remotes:
origin: https://github.com/redhat-developer/devfile-sample
- version: 1.0.1
schemaVersion: 2.2.1
default: true
description: nodejs with devfile v2.2.0
git:
remotes:
origin: https://github.com/nodeshift-starters/devfile-sample
Should we consider adding a feature in the viewer or am I missing something? |
We have confirmed that the viewer does show up an updated image of the registry with multi-version samples. |
After an investigation on the More detailed looking into {
"name": "nodejs-basic",
"displayName": "Basic Node.js",
"description": "Node.js 16 application using Express 4.18.x",
"type": "sample",
"tags": [
"Node.js",
"Express"
],
"icon": "https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg",
"projectType": "Node.js",
"language": "JavaScript",
"provider": "Red Hat",
"versions": [
{
"version": "1.0.0",
"schemaVersion": "2.0.0",
"git": {
"remotes": {
"origin": "https://github.com/redhat-developer/devfile-sample"
}
},
"description": "nodejs with devfile v2.0.0"
},
{
"version": "1.0.1",
"schemaVersion": "2.2.1",
"default": true,
"git": {
"remotes": {
"origin": "https://github.com/nodeshift-starters/devfile-sample"
}
},
"description": "nodejs with devfile v2.2.0"
}
]
} |
@michael-valdron I was investigating on the viewer side and found this https://github.com/devfile/devfile-web/blob/main/libs/core/src/functions/fetch-devfiles/fetch-devfiles.tsx#L38 which I think means that by default on the viewer we are not accepting samples having multiple versions. WDYT? |
@thepetk Yeah that looks to be the culprit. I checked the |
@michael-valdron do you think we should create a separate issue for the viewer or we should included it as part of this item? |
@thepetk I think this should be its own item, as a user story under the |
Issue created here: #1184 , not sure if we should assign it the blocker label. Temporarily, I'm removing the target date for this issue. |
I'm resuming working on the issue. As discussed, we can introduce references to v.2.2.0 Parent stacks even if the viewer is not supporting them. New target date: [EDIT] Removed |
I've tested different things while looking for the best workaround. The approach I'm most interested in is: Multiple sample versions inside extraDevfileEntriesAs suggested above a good way to start is to include multiple sample versions inside the - name: go-basic
displayName: Basic Go
description: Go 1.16 application
icon: https://go.dev/blog/go-brand/Go-Logo/SVG/Go-Logo_Blue.svg
tags:
- Go
projectType: Go
language: Go
provider: Red Hat
versions:
- version: 1.0.2
schemaVersion: 2.1.0
git:
remotes:
origin: https://github.com/devfile-samples/devfile-sample-go-basic.git
- version: 2.1.0
schemaVersion: 2.2.0
default: true
git:
remotes:
origin: https://github.com/thepetk/devfile-sample-go-basic.git Separate Branch, Separate Sample Repo OR Directory with devfiles?If we follow the above format we will need to support different of devfile samples versions for [Not Supported ATM] Separate branch per devfile sample repoThis way we can introduce a new branch for every sample repo (e.g. versions:
- version: 2.1.0
schemaVersion: 2.2.0
git:
checkoutFrom:
revision: 2.2.x
remotes:
origin: https://github.com/devfile-samples/devfile-sample-go-basic.git If I'm not missing something, right now we don't support this in build-tools. If so, we will have to create a new issue to support this and then we can unblock this approach. [Not Supported ATM] Directory inside each samples that will introduce different devfile versionsThe idea is to have exactly the same structure as the stacks. So for every devfile sample we can have:
Use different repo per devfile.yaml versionFollowing this solution we will have to use a different repo per devfile version. For example for the versions:
- version: 1.0.2
schemaVersion: 2.1.0
git:
remotes:
origin: <repo1>
- version: 2.1.0
schemaVersion: 2.2.0
default: true
git:
remotes:
origin: <repo2> |
I can confirm that all branches are protected, as only members of the devfile-samples org can merge PRs in any branch. Other than that, in order to be able to use consistent port numbers I've created a PR (devfile/registry-support#188) to update the library version, which will let us accept two components declaring the same port. |
As seen during testing, the ODC uses That said, in order to have always the latest version of every sample on the As a result, I'm putting it back to todo and putting the |
The library version of the registry support has been updated (here) and now we can support building a registry with a sample having multiple components using the same port |
Updating this item due to an issue found for parent overrides inside samples. New scopeThis issue will focus on updating the Default Version = Default BranchFor each sample we will keep the convention of maintaining the default sample version to the default sample branch. For example the default version of the go-basic sample (v1.0.2) will be inside the Latest Version = v2.x.x BranchFor every sample that needs to have a new version we will create a new branch starting with Updated extraDevfileEntries.yamlAfter the completion of the above steps the new schemaVersion: 1.0.0
samples:
- name: nodejs-basic
displayName: Basic Node.js
description: Node.js 16 application using Express 4.18.x
icon: https://nodejs.org/static/images/logos/nodejs-new-pantone-black.svg
tags:
- Node.js
- Express
projectType: Node.js
language: JavaScript
provider: Red Hat
versions:
- version: 1.0.0
default: true
schemaVersion: 2.0.0
git:
revision: main
remotes:
origin: https://github.com/redhat-developer/devfile-sample.git
- name: go-basic
displayName: Basic Go
description: Go 1.16 application
icon: https://go.dev/blog/go-brand/Go-Logo/SVG/Go-Logo_Blue.svg
tags:
- Go
projectType: Go
language: Go
provider: Red Hat
versions:
- version: 1.1.0
default: true
schemaVersion: 2.2.0
git:
revision: main
remotes:
origin: https://github.com/devfile-samples/devfile-sample-go-basic.git
- version: 2.0.0
schemaVersion: 2.2.0
git:
revision: v2.0.0
remotes:
origin: https://github.com/devfile-samples/devfile-sample-go-basic.git |
Removing the Also I've created a new version for each sample having a parent stack with multiple versions:
After those PRs are reviewed we can go ahead and create a PR for the updated |
I'm moving this item to review status as the 3 sample related PRs are under review :) |
I've splited the current issue into two parts:
I've updated the story points of this issue to 5 and the new issue has 3 points (total 8, exactly like the previous story points) |
#1360 is now completed we can focus on the update of the |
Which area this feature is related to?
/area registry
Which functionality do you think we should add?
The current samples have a parent reference to the default stack version in the registry. e.g. Devfile sample go basic points to the default go stack version in the community registry. With this set up, parsing the samples will be successful because there are no conflicts. If the sample were changed to point to the latest version (v2.2.0 schema), parsing will fail because the parent and sample devfiles both contain the same command ids. We should create a new version of the devfile sample that is compatible with the parent 2.2.0 schema.
Why is this needed? Is your feature request related to a problem?
Detailed description:
Describe the solution you'd like
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: