Skip to content

Add support for 2.3.0 schema version #219

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

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/devfile/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestParseDevfileAndValidate(t *testing.T) {

devfileStruct := schema.DevWorkspaceTemplate{
TypeMeta: metav1.TypeMeta{
APIVersion: "2.1.0",
APIVersion: "2.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of moving this to 2.3.0 what do you think about having a struct for each version to test against, it looks to me like we are moving to only testing 2.3.0?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need to update all the tests to be 2.3.0, library is, and should be, backward compatible, so for any existing features we test with, leave it as it's previous version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

only bump-up devfile version in test if the unit test covers new features introduced in the latest version
@michael-valdron

Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI, just created this issue: devfile/api#1603

Copy link
Member Author

Choose a reason for hiding this comment

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

only bump-up devfile version in test if the unit test covers new features introduced in the latest version @michael-valdron

@yangcao77 @Jdubrick Reverted with 267aa8b, though I left in the changes to the unsupportedSchemaError test case since the result will change with the addition of 2.3.0.

},
Spec: schema.DevWorkspaceTemplateSpec{
DevWorkspaceTemplateSpecContent: schema.DevWorkspaceTemplateSpecContent{
Expand Down Expand Up @@ -152,26 +152,26 @@ metadata:
tags:
- Go
version: 1.0.0
schemaVersion: 2.2.2
schemaVersion: 2.3.0
`

devfileContentWithVariable := devfileContent + `variables:
PARAMS: foo`
devfileContentWithParent := `schemaVersion: 2.2.2
devfileContentWithParent := `schemaVersion: 2.3.0
parent:
id: devfile1
registryUrl: http://127.0.0.1:8080/registry
`
devfileContentWithUnsupportedSchema := `schemaVersion: 2.2.5
devfileContentWithUnsupportedSchema := `schemaVersion: 2.3.5
parent:
id: devfile1
registryUrl: http://127.0.0.1:8080/registry
`
devfileContentWithParentNoRegistry := `schemaVersion: 2.2.2
devfileContentWithParentNoRegistry := `schemaVersion: 2.3.0
parent:
id: devfile1
`
devfileContentWithCRDParent := `schemaVersion: 2.2.2
devfileContentWithCRDParent := `schemaVersion: 2.3.0
parent:
kubernetes:
name: devfile1
Expand Down Expand Up @@ -267,7 +267,7 @@ spec:
testServer.Start()
defer testServer.Close()

unsupportedSchemaError := `error parsing devfile because of non-compliant data due to unable to find schema for version "2.2.5". The parser supports devfile schema for version 2.0.0, 2.1.0, 2.2.0, 2.2.1, 2.2.2, v1alpha2`
unsupportedSchemaError := `error parsing devfile because of non-compliant data due to unable to find schema for version "2.3.5". The parser supports devfile schema for version 2.0.0, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.3.0, v1alpha2`

type args struct {
args parser.ParserArgs
Expand Down
Loading