Skip to content

Commit

Permalink
Prepare for v2.2.2 release (#209)
Browse files Browse the repository at this point in the history
* update tests to incorporate v2.2.2 var warning changes

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* prepare for 2.2.2 release

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* update readme for 2.2.2

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* update go mod

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

* update registry library dep to latest commit

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>

---------

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
  • Loading branch information
Jdubrick committed Mar 28, 2024
1 parent 44ca18d commit 1d563eb
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 87 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/devfile/library/v2
go 1.19

require (
github.com/devfile/api/v2 v2.2.1
github.com/devfile/registry-support/registry-library v0.0.0-20240311160550-e51ee8934746
github.com/devfile/api/v2 v2.2.2
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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ 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=
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=
Expand Down
180 changes: 100 additions & 80 deletions pkg/devfile/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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,
}, {
Expand All @@ -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,
}, {
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand All @@ -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)" {
Expand All @@ -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)" {
Expand All @@ -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)" {
Expand All @@ -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)" {
Expand All @@ -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)" {
Expand All @@ -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)" {
Expand All @@ -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)" {
Expand All @@ -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)" {
Expand All @@ -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,
},
Expand Down

0 comments on commit 1d563eb

Please sign in to comment.