From 4325c1e43b11e42da0d19ba9cc48e5f7d088620a Mon Sep 17 00:00:00 2001 From: Theofanis Petkos Date: Tue, 5 Dec 2023 11:12:01 +0000 Subject: [PATCH 1/7] Add only default tags in index component (#9) Signed-off-by: thepetk --- index/generator/library/library.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index/generator/library/library.go b/index/generator/library/library.go index a629d3ac..647abc24 100644 --- a/index/generator/library/library.go +++ b/index/generator/library/library.go @@ -441,9 +441,11 @@ func parseStackDevfile(devfileDirPath string, stackName string, force bool, vers versionComponent.StarterProjects = append(versionComponent.StarterProjects, starterProject.Name) } - for _, tag := range versionComponent.Tags { - if !inArray(indexComponent.Tags, tag) { - indexComponent.Tags = append(indexComponent.Tags, tag) + if versionComponent.Default { + for _, tag := range versionComponent.Tags { + if !inArray(indexComponent.Tags, tag) { + indexComponent.Tags = append(indexComponent.Tags, tag) + } } } From f39a562b3295e1560d898f9e2bdf954b8af19afb Mon Sep 17 00:00:00 2001 From: thepetk Date: Tue, 5 Dec 2023 11:39:43 +0000 Subject: [PATCH 2/7] Update test cases Signed-off-by: thepetk --- index/generator/tests/registry/index_registry.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index/generator/tests/registry/index_registry.json b/index/generator/tests/registry/index_registry.json index d2804653..e57ff8ad 100644 --- a/index/generator/tests/registry/index_registry.json +++ b/index/generator/tests/registry/index_registry.json @@ -4,7 +4,7 @@ "displayName": "Go Runtime", "description": "Stack with the latest Go version", "type": "stack", - "tags": ["testtag", "Go"], + "tags": ["testtag"], "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg", "projectType": "go", "language": "go", From 1fc7b97cecc2419a05d98fe0f22c494c9950914b Mon Sep 17 00:00:00 2001 From: thepetk Date: Tue, 5 Dec 2023 11:43:07 +0000 Subject: [PATCH 3/7] Fix test cases typo Signed-off-by: thepetk --- index/generator/tests/registry/index_registry.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index/generator/tests/registry/index_registry.json b/index/generator/tests/registry/index_registry.json index e57ff8ad..802f6b9a 100644 --- a/index/generator/tests/registry/index_registry.json +++ b/index/generator/tests/registry/index_registry.json @@ -4,7 +4,7 @@ "displayName": "Go Runtime", "description": "Stack with the latest Go version", "type": "stack", - "tags": ["testtag"], + "tags": ["Go"], "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg", "projectType": "go", "language": "go", From e18ee2e7db3f971a04ff21e380d276d8dbf1793b Mon Sep 17 00:00:00 2001 From: thepetk Date: Tue, 5 Dec 2023 11:56:59 +0000 Subject: [PATCH 4/7] Fix tags in index_extra.json Signed-off-by: thepetk --- index/generator/tests/registry/index_main.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index/generator/tests/registry/index_main.json b/index/generator/tests/registry/index_main.json index 1c7db163..53cfb7bc 100644 --- a/index/generator/tests/registry/index_main.json +++ b/index/generator/tests/registry/index_main.json @@ -4,7 +4,7 @@ "displayName": "Go Runtime", "description": "Stack with the latest Go version", "type": "stack", - "tags": ["testtag", "Go"], + "tags": ["Go"], "icon": "https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/golang.svg", "projectType": "go", "language": "go", From 7127893c9983b5341bc0c21d861f66176520f568 Mon Sep 17 00:00:00 2001 From: thepetk Date: Tue, 5 Dec 2023 15:45:48 +0000 Subject: [PATCH 5/7] Finalize test cases fixes Signed-off-by: thepetk --- index/generator/library/library.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index/generator/library/library.go b/index/generator/library/library.go index 647abc24..b7798327 100644 --- a/index/generator/library/library.go +++ b/index/generator/library/library.go @@ -295,12 +295,11 @@ func parseDevfileRegistry(registryDirPath string, force bool) ([]schema.Schema, } } } else { // if stack.yaml not exist, old stack repo struct, directly lookfor & parse devfile.yaml - versionComponent := schema.Version{} + versionComponent := schema.Version{Default: true} err := parseStackDevfile(stackFolderPath, stackFolderDir.Name(), force, &versionComponent, &indexComponent) if err != nil { return nil, err } - versionComponent.Default = true indexComponent.Versions = append(indexComponent.Versions, versionComponent) } indexComponent.Type = schema.StackDevfileType From c7ecdd1e01fadd747caef6aa8a81b5ebff87eda5 Mon Sep 17 00:00:00 2001 From: thepetk Date: Tue, 12 Dec 2023 13:42:06 +0000 Subject: [PATCH 6/7] Update registry support contributing guide Signed-off-by: thepetk --- CONTRIBUTING.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12f7ea28..825dcb91 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ contribution. See the [DCO](./DCO) file for details. ### Issues -If you spot a problem with the devfile registry, [search if an issue already exists](https://github.com/devfile/api/issues). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/devfile/api/issues/new/choose). +If you spot a problem with the devfile registry, [search if an issue already exists](https://github.com/devfile/api/issues?q=is%3Aissue+is%3Aopen+label%3Aarea%2Fregistry). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/devfile/api/issues/new/choose). You can tag Devfile Registry related issues with the `/area registry` text in your issue. @@ -35,7 +35,6 @@ The `registry-support` repository for the devfile registry is a mono-repo of sor Each of these individual components will have their own readme with instructions for consuming or developing the component, and it's recommended to consult them before development. - #### Building All Components Together This repository contains a handy script that will build all of the individual components of the devfile registry (build-tools, index generator, index server, registry viewer, etc) and produce a deployable @@ -59,21 +58,21 @@ To run these tests, consult the integration test's [readme](./tests/integration) ### Submitting Pull Request **Note:** All commits must be signed off with the footer: + ``` Signed-off-by: First Lastname ``` You can easily add this footer to your commits by adding `-s` when running `git commit`. When you think the code is ready for review, create a pull request and link the issue associated with it. -Owners of the repository will watch out for and review new PRs. +Owners of the repository will watch out for new PRs and provide reviews to them. -By default for each change in the PR, GitHub Actions and OpenShift CI will run checks against your changes (linting, unit testing, and integration tests). +For each change in the PR, GitHub Actions and OpenShift CI will run by default checks against your changes (linting, unit testing, and integration tests). If comments have been given in a review, they have to be addressed before merging. -After addressing review comments, don’t forget to add a comment in the PR afterward, so everyone gets notified by Github and know to re-review. - +After addressing review comments, don't forget to add a comment in the PR with the reviewer mentioned afterward, so they get notified by Github to provide a re-review. # Contact us -If you have questions, please visit us on `#devfile` in the [Kubernetes Slack](https://slack.k8s.io). +If you have any questions, please visit us the `#devfile` channel under the [Kubernetes Slack](https://slack.k8s.io) workspace. From 405a71523a2f3f095f291d7970dd54253ba0350b Mon Sep 17 00:00:00 2001 From: thepetk Date: Tue, 12 Dec 2023 13:52:29 +0000 Subject: [PATCH 7/7] Update contributing guide Signed-off-by: thepetk --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 825dcb91..7464b8b1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ Thank you for your interest in contributing to the Devfile Registry! We welcome ## Code of Conduct -Before contributing to this repository for the first time, please review our project's [Code of Conduct](https://github.com/devfile/api/blob/main/CODE_OF_CONDUCT.md) +Before contributing to this repository for the first time, please review our project's [Code of Conduct](https://github.com/devfile/api/blob/main/CODE_OF_CONDUCT.md). ## Certificate of Origin