Skip to content

Commit

Permalink
pull in changes from devfile api before bumping up version
Browse files Browse the repository at this point in the history
Signed-off-by: Stephanie <yangcao@redhat.com>
  • Loading branch information
yangcao77 committed May 27, 2021
1 parent 5d88bd3 commit 1318c98
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 191 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/devfile/library
go 1.13

require (
github.com/devfile/api/v2 v2.0.0-20210507143755-39103b31c0f3
github.com/devfile/api/v2 v2.0.0-20210519125756-e7f24e33ee17
github.com/fatih/color v1.7.0
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/gobwas/glob v0.2.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/devfile/api/v2 v2.0.0-20210507143755-39103b31c0f3 h1:gm67QZRqq8vCtrpxXlTNPf7xss5rjn9CFcPtAUr+nqo=
github.com/devfile/api/v2 v2.0.0-20210507143755-39103b31c0f3/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg=
github.com/devfile/api/v2 v2.0.0-20210519125756-e7f24e33ee17 h1:+XRdBE7jM0mBdJbjLlu+fKKILHAeamuf5oK+BZZk0Qs=
github.com/devfile/api/v2 v2.0.0-20210519125756-e7f24e33ee17/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
Expand Down
12 changes: 1 addition & 11 deletions pkg/devfile/generator/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,6 @@ func TestAddSyncFolder(t *testing.T) {
},
},
},
{
Name: projectNames[1],
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{"origin": projectRepos[0]},
},
},
},
},
{
Name: projectNames[1],
ProjectSource: v1.ProjectSource{
Expand Down Expand Up @@ -348,7 +338,7 @@ func TestAddSyncFolder(t *testing.T) {
ClonePath: invalidClonePaths[0],
Name: projectNames[0],
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{"origin": projectRepos[0]},
},
Expand Down
160 changes: 2 additions & 158 deletions pkg/devfile/parser/data/v2/2.1.0/devfileJsonSchema210.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package version210
const JsonSchema210 = `{
"description": "Devfile describes the structure of a cloud-native devworkspace and development environment.",
"type": "object",
"title": "Devfile schema - Version 2.1.0-alpha",
"title": "Devfile schema - Version 2.1.0",
"required": [
"schemaVersion"
],
Expand Down Expand Up @@ -657,7 +657,7 @@ const JsonSchema210 = `{
"type": "string"
},
"icon": {
"description": "Optional devfile icon",
"description": "Optional devfile icon, can be a URI or a relative path in the project",
"type": "string"
},
"language": {
Expand Down Expand Up @@ -1306,11 +1306,6 @@ const JsonSchema210 = `{
"git"
]
},
{
"required": [
"github"
]
},
{
"required": [
"zip"
Expand Down Expand Up @@ -1356,48 +1351,12 @@ const JsonSchema210 = `{
},
"additionalProperties": false
},
"github": {
"description": "Project's GitHub source. Deprecated, use 'Git' instead",
"type": "object",
"properties": {
"checkoutFrom": {
"description": "Defines from what the project should be checked out. Required if there are more than one remote configured",
"type": "object",
"properties": {
"remote": {
"description": "The remote name should be used as init. Required if there are more than one remote configured",
"type": "string"
},
"revision": {
"description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.",
"type": "string"
}
},
"additionalProperties": false
},
"remotes": {
"description": "The remotes map which should be initialized in the git project. Must have at least one remote configured",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"name": {
"description": "Project name",
"type": "string",
"maxLength": 63,
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
},
"sparseCheckoutDirs": {
"description": "Populate the project sparsely with selected directories.",
"type": "array",
"items": {
"type": "string"
}
},
"zip": {
"description": "Project's Zip source",
"type": "object",
Expand Down Expand Up @@ -1431,11 +1390,6 @@ const JsonSchema210 = `{
"git"
]
},
{
"required": [
"github"
]
},
{
"required": [
"zip"
Expand Down Expand Up @@ -1481,35 +1435,6 @@ const JsonSchema210 = `{
},
"additionalProperties": false
},
"github": {
"description": "Project's GitHub source. Deprecated, use 'Git' instead",
"type": "object",
"properties": {
"checkoutFrom": {
"description": "Defines from what the project should be checked out. Required if there are more than one remote configured",
"type": "object",
"properties": {
"remote": {
"description": "The remote name should be used as init. Required if there are more than one remote configured",
"type": "string"
},
"revision": {
"description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.",
"type": "string"
}
},
"additionalProperties": false
},
"remotes": {
"description": "The remotes map which should be initialized in the git project. Must have at least one remote configured",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"name": {
"description": "Project name",
"type": "string",
Expand Down Expand Up @@ -1563,11 +1488,6 @@ const JsonSchema210 = `{
"git"
]
},
{
"required": [
"github"
]
},
{
"required": [
"zip"
Expand Down Expand Up @@ -1616,51 +1536,12 @@ const JsonSchema210 = `{
},
"additionalProperties": false
},
"github": {
"description": "Project's GitHub source. Deprecated, use 'Git' instead",
"type": "object",
"required": [
"remotes"
],
"properties": {
"checkoutFrom": {
"description": "Defines from what the project should be checked out. Required if there are more than one remote configured",
"type": "object",
"properties": {
"remote": {
"description": "The remote name should be used as init. Required if there are more than one remote configured",
"type": "string"
},
"revision": {
"description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.",
"type": "string"
}
},
"additionalProperties": false
},
"remotes": {
"description": "The remotes map which should be initialized in the git project. Must have at least one remote configured",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"name": {
"description": "Project name",
"type": "string",
"maxLength": 63,
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
},
"sparseCheckoutDirs": {
"description": "Populate the project sparsely with selected directories.",
"type": "array",
"items": {
"type": "string"
}
},
"zip": {
"description": "Project's Zip source",
"type": "object",
Expand Down Expand Up @@ -1695,11 +1576,6 @@ const JsonSchema210 = `{
"git"
]
},
{
"required": [
"github"
]
},
{
"required": [
"zip"
Expand Down Expand Up @@ -1748,38 +1624,6 @@ const JsonSchema210 = `{
},
"additionalProperties": false
},
"github": {
"description": "Project's GitHub source. Deprecated, use 'Git' instead",
"type": "object",
"required": [
"remotes"
],
"properties": {
"checkoutFrom": {
"description": "Defines from what the project should be checked out. Required if there are more than one remote configured",
"type": "object",
"properties": {
"remote": {
"description": "The remote name should be used as init. Required if there are more than one remote configured",
"type": "string"
},
"revision": {
"description": "The revision to checkout from. Should be branch name, tag or commit id. Default branch is used if missing or specified revision is not found.",
"type": "string"
}
},
"additionalProperties": false
},
"remotes": {
"description": "The remotes map which should be initialized in the git project. Must have at least one remote configured",
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"name": {
"description": "Project name",
"type": "string",
Expand Down
2 changes: 0 additions & 2 deletions pkg/devfile/parser/data/v2/common/project_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ func GetProjectSourceType(projectSrc v1.ProjectSource) (v1.ProjectSourceType, er
switch {
case projectSrc.Git != nil:
return v1.GitProjectSourceType, nil
case projectSrc.Github != nil:
return v1.GitHubProjectSourceType, nil
case projectSrc.Zip != nil:
return v1.ZipProjectSourceType, nil
case projectSrc.Custom != nil:
Expand Down
8 changes: 0 additions & 8 deletions pkg/devfile/parser/data/v2/common/project_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,6 @@ func TestGetProjectSrcType(t *testing.T) {
projectSrcType: v1.GitProjectSourceType,
wantErr: false,
},
{
name: "Github project",
projectSrc: v1.ProjectSource{
Github: &v1.GithubProjectSource{},
},
projectSrcType: v1.GitHubProjectSourceType,
wantErr: false,
},
{
name: "Zip project",
projectSrc: v1.ProjectSource{
Expand Down
18 changes: 9 additions & 9 deletions pkg/devfile/parser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
{
ClonePath: "/data",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -248,7 +248,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
Attributes: parentOverridesFromMainDevfile,
ClonePath: "/projects",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -379,7 +379,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
Attributes: importFromUri1,
ClonePath: "/data",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -766,7 +766,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
{
ClonePath: "/data",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -843,7 +843,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
Attributes: importFromUri2,
ClonePath: "/data",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -953,7 +953,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
{
ClonePath: "/data",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -1056,7 +1056,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
Attributes: importFromUri2,
ClonePath: "/data",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -1595,7 +1595,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
{
ClonePath: "/data",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down Expand Up @@ -1737,7 +1737,7 @@ func Test_parseParentAndPluginFromURI(t *testing.T) {
Attributes: parentOverridesFromMainDevfile,
ClonePath: "/projects",
ProjectSource: v1.ProjectSource{
Github: &v1.GithubProjectSource{
Git: &v1.GitProjectSource{
GitLikeProjectSource: v1.GitLikeProjectSource{
Remotes: map[string]string{
"master": "https://githube.com/somerepo/someproject.git",
Expand Down

0 comments on commit 1318c98

Please sign in to comment.