From d6967f720d771c85981d6c64110c449e9b5f843f Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 28 Mar 2024 15:08:25 -0400 Subject: [PATCH 1/5] update tests to incorporate v2.2.2 var warning changes Signed-off-by: Jordan Dubrick --- pkg/devfile/parse_test.go | 180 +++++++++++++++++++++----------------- 1 file changed, 100 insertions(+), 80 deletions(-) diff --git a/pkg/devfile/parse_test.go b/pkg/devfile/parse_test.go index 9b100dd7..3faf765e 100644 --- a/pkg/devfile/parse_test.go +++ b/pkg/devfile/parse_test.go @@ -300,10 +300,11 @@ spec: "PARAMS": "bar", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -325,10 +326,11 @@ spec: "OTHER": "other", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, { @@ -348,10 +350,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, { @@ -370,10 +373,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -393,10 +397,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -416,10 +421,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -438,10 +444,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -460,10 +467,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -482,10 +490,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -507,10 +516,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -540,10 +550,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: nil, }, @@ -562,10 +573,11 @@ spec: "PARAMS": "from devfile.yaml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Go Runtime (devfile.yaml)" { @@ -591,10 +603,11 @@ spec: "PARAMS": "from .devfile.yaml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Go Runtime (.devfile.yaml)" { @@ -620,10 +633,11 @@ spec: "PARAMS": "from devfile.yml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (devfile.yml)" { @@ -649,10 +663,11 @@ spec: "PARAMS": "from .devfile.yml based on priority", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (.devfile.yml)" { @@ -678,10 +693,11 @@ spec: "PARAMS": "from devfile.yml", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (devfile.yml)" { @@ -707,10 +723,11 @@ spec: "PARAMS": "from .devfile.yml", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (.devfile.yml)" { @@ -736,10 +753,11 @@ spec: "PARAMS": "from .devfile.yaml", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Go Runtime (.devfile.yaml)" { @@ -765,10 +783,11 @@ spec: "PARAMS": "from any valid devfile file", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, additionalChecks: func(devfileObj parser.DevfileObj) error { if devfileObj.Data.GetMetadata().DisplayName != "Test stack (valid-devfile.yaml.txt)" { @@ -794,10 +813,11 @@ spec: "PARAMS": "baz", }, wantVarWarning: variables.VariableWarning{ - Commands: map[string][]string{}, - Components: map[string][]string{}, - Projects: map[string][]string{}, - StarterProjects: map[string][]string{}, + Commands: map[string][]string{}, + Components: map[string][]string{}, + Projects: map[string][]string{}, + StarterProjects: map[string][]string{}, + DependentProjects: map[string][]string{}, }, wantErrorStr: &unsupportedSchemaError, }, From 5eabcf597094ca30b1b2e77bfe26851924705a7f Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 28 Mar 2024 15:08:38 -0400 Subject: [PATCH 2/5] prepare for 2.2.2 release Signed-off-by: Jordan Dubrick --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 89672184..a76a8a21 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/devfile/library/v2 go 1.19 require ( - github.com/devfile/api/v2 v2.2.1 + github.com/devfile/api/v2 v2.2.2 github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746 github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 github.com/fatih/color v1.14.1 diff --git a/go.sum b/go.sum index ef734f6d..972fb6a1 100644 --- a/go.sum +++ b/go.sum @@ -94,6 +94,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/devfile/api/v2 v2.2.1 h1:VSX297YqY4C4j4uhn7M0RdZeBaeWqyVi4NnagzEmxu0= github.com/devfile/api/v2 v2.2.1/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM= +github.com/devfile/api/v2 v2.2.2 h1:DXRCPWFlZhTIE38Of2jzTRjQHadfbxBC8GS+m+EjoCU= +github.com/devfile/api/v2 v2.2.2/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM= github.com/devfile/registry-support/index/generator v0.0.0-20240311135803-6215550f93d4 h1:t09mGdy31tC2YBp6kVD7x8m0jq1CyBUSYMUvrF0iaWw= github.com/devfile/registry-support/index/generator v0.0.0-20240311135803-6215550f93d4/go.mod h1:3Ngbmm12LW03tAEHpDNymM7zryd5H1Xo3ZAGlBpecf8= github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746 h1:VQLQguSjxcU1xtUjbqmEW6R9Ehgjk1PzG56vHnzXyEw= From f4585496915d14d76f04052f48cbdd39b0f675b6 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 28 Mar 2024 15:12:19 -0400 Subject: [PATCH 3/5] update readme for 2.2.2 Signed-off-by: Jordan Dubrick --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62657d84..58f44fa4 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ ## About The Devfile Parser library is a Golang module that: -1. parses a devfile as specified by the [api](https://devfile.io/docs/2.2.1/devfile-schema) & [schema](https://github.com/devfile/api/tree/main/schemas/latest). +1. parses a devfile as specified by the [api](https://devfile.io/docs/2.2.2/devfile-schema) & [schema](https://github.com/devfile/api/tree/main/schemas/latest). 2. writes to the specified devfile with the updated data. 3. generates Kubernetes objects for the various devfile resources. 4. defines util functions for the devfile. From f7c5f82bc68cbcb3e6499e540e1264edbaa2aa86 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 28 Mar 2024 15:32:20 -0400 Subject: [PATCH 4/5] update go mod Signed-off-by: Jordan Dubrick --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 972fb6a1..57f2c9d5 100644 --- a/go.sum +++ b/go.sum @@ -92,8 +92,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devfile/api/v2 v2.2.1 h1:VSX297YqY4C4j4uhn7M0RdZeBaeWqyVi4NnagzEmxu0= -github.com/devfile/api/v2 v2.2.1/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM= github.com/devfile/api/v2 v2.2.2 h1:DXRCPWFlZhTIE38Of2jzTRjQHadfbxBC8GS+m+EjoCU= github.com/devfile/api/v2 v2.2.2/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM= github.com/devfile/registry-support/index/generator v0.0.0-20240311135803-6215550f93d4 h1:t09mGdy31tC2YBp6kVD7x8m0jq1CyBUSYMUvrF0iaWw= From 7ba43b955d33fe3d885dad2296af81effd7b1096 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 28 Mar 2024 15:53:54 -0400 Subject: [PATCH 5/5] update registry library dep to latest commit Signed-off-by: Jordan Dubrick --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a76a8a21..feaf5277 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( github.com/devfile/api/v2 v2.2.2 - github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746 + github.com/devfile/registry-support/registry-library v0.0.0-20240328155806-7c89891a72ce github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 github.com/fatih/color v1.14.1 github.com/fsnotify/fsnotify v1.7.0 diff --git a/go.sum b/go.sum index 57f2c9d5..4fd16dd8 100644 --- a/go.sum +++ b/go.sum @@ -96,8 +96,8 @@ github.com/devfile/api/v2 v2.2.2 h1:DXRCPWFlZhTIE38Of2jzTRjQHadfbxBC8GS+m+EjoCU= github.com/devfile/api/v2 v2.2.2/go.mod h1:qp8jcw12y1JdCsxjK/7LJ7uWaJOxcY1s2LUk5PhbkbM= github.com/devfile/registry-support/index/generator v0.0.0-20240311135803-6215550f93d4 h1:t09mGdy31tC2YBp6kVD7x8m0jq1CyBUSYMUvrF0iaWw= github.com/devfile/registry-support/index/generator v0.0.0-20240311135803-6215550f93d4/go.mod h1:3Ngbmm12LW03tAEHpDNymM7zryd5H1Xo3ZAGlBpecf8= -github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746 h1:VQLQguSjxcU1xtUjbqmEW6R9Ehgjk1PzG56vHnzXyEw= -github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746/go.mod h1:2RRLQaOYuzh8n59euz6Bu60hFoX/LLVM9uzFOFDyOZM= +github.com/devfile/registry-support/registry-library v0.0.0-20240328155806-7c89891a72ce h1:IgUCI7eCq6m0JzRx3+FZuIeJy5e+rUSQYMr3NBzrqyg= +github.com/devfile/registry-support/registry-library v0.0.0-20240328155806-7c89891a72ce/go.mod h1:2RRLQaOYuzh8n59euz6Bu60hFoX/LLVM9uzFOFDyOZM= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2 h1:aBfCb7iqHmDEIp6fBvC/hQUddQfg+3qdYjwzaiP9Hnc= github.com/distribution/distribution/v3 v3.0.0-20221208165359-362910506bc2/go.mod h1:WHNsWjnIn2V1LYOrME7e8KxSeKunYHsxEm4am0BUtcI= github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=