Skip to content
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

Validation Tool to follow the Catalog Structure #413

Closed
PuneetPunamiya opened this issue Jul 13, 2020 · 9 comments
Closed

Validation Tool to follow the Catalog Structure #413

PuneetPunamiya opened this issue Jul 13, 2020 · 9 comments
Assignees
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@PuneetPunamiya
Copy link
Member

PuneetPunamiya commented Jul 13, 2020

Expected Behavior

  1. Each resource should follow the following structure
    ./task/         👈 the kind of the resource 
      
      /argocd       👈 definition file must have same name
        /0.1
          /OWNERS     👈 owners of this ressource
          /README.md     
          /argocd.yaml   👈 the file name must be resource name
          /samples/deploy-to-k8s.yaml
        /0.2/...
     
     /golang-build
        /0.1
          /README.md
          /golang-build.yaml
          /samples/golang-build.yaml
  • NOTE : The resource name and the directory name should match
  1. Resource YAML file should include the following changes
  • Labels include the version of the resource.
  • Annotations include
    • minimum pipeline version supported by the resource
    • tags associated with the resource
    • displayName of the resource
  
labels:
  app.kubernetes.io/version: "0.1"            👈 version of the resource
  
annotations:
  tekton.dev/pipelines.minVersion: "0.12.1"   👈 will work from x version  of pipeline
  tekton.dev/tags: "ansible, cli"                        👈 Comma separated list of tags 
  tekton.dev/displayName: "Ansible Tower Cli"  👈 displayName can be optional   
  
spec:
description: |-
  ansible-tower-cli task simplifies 
  workflow, jobs, manage users...   👈 # Summary
  
  Ansible Tower (formerly ‘AWX’) is a ...

Actual Behavior

  • API breakage
  • No concept of versions
  • Are the Resources valid
  • No field to mention Minimum Pipeline Version
sthaha added a commit to sthaha/tektoncd-catalog that referenced this issue Jul 13, 2020
We would need to ensure that the PR submissions are manually validated
against the [TEP-003] until we have the [validation tool] added to CI.

Signed-off-by: Sunil Thaha <sthaha@redhat.com>

---

[TEP-003]: https://github.com/tektoncd/community/blob/master/teps/0003-tekton-catalog-organization.md
[validation tool]: tektoncd#413
sthaha added a commit to sthaha/tektoncd-catalog that referenced this issue Jul 13, 2020
We would need to ensure that the PR submissions are manually validated
against the [TEP-003] until we have the [validation tool] added to CI.

Signed-off-by: Sunil Thaha <sthaha@redhat.com>

---

[TEP-003]: https://github.com/tektoncd/community/blob/master/teps/0003-tekton-catalog-organization.md
[validation tool]: tektoncd#413
sthaha added a commit to sthaha/tektoncd-catalog that referenced this issue Jul 13, 2020
We would need to ensure that the PR submissions are manually validated
against the [TEP-003] until we have the [validation tool] added to CI.

Signed-off-by: Sunil Thaha <sthaha@redhat.com>

---

[TEP-003]: https://github.com/tektoncd/community/blob/master/teps/0003-tekton-catalog-organization.md
[validation tool]: tektoncd#413
tekton-robot pushed a commit that referenced this issue Jul 13, 2020
We would need to ensure that the PR submissions are manually validated
against the [TEP-003] until we have the [validation tool] added to CI.

Signed-off-by: Sunil Thaha <sthaha@redhat.com>

---

[TEP-003]: https://github.com/tektoncd/community/blob/master/teps/0003-tekton-catalog-organization.md
[validation tool]: #413
popcor255 pushed a commit to popcor255/catalog that referenced this issue Jul 14, 2020
We would need to ensure that the PR submissions are manually validated
against the [TEP-003] until we have the [validation tool] added to CI.

Signed-off-by: Sunil Thaha <sthaha@redhat.com>

---

[TEP-003]: https://github.com/tektoncd/community/blob/master/teps/0003-tekton-catalog-organization.md
[validation tool]: tektoncd#413
@piyush-garg piyush-garg mentioned this issue Jul 21, 2020
9 tasks
@wumaxd wumaxd mentioned this issue Jul 22, 2020
9 tasks
@wumaxd
Copy link
Member

wumaxd commented Jul 23, 2020

@PuneetPunamiya Regarding 1.
How about creating a list of changed directories (./task/<dir>) based on the CHANGED_FILES in the presubmit-tests.sh (

).
Based on this list check if for each version a task exists (./task/<dir>/<version>/<dir>.yml) and if a README exists (./task/<dir>/<version>/README.md). Would you want to see more enforced?

I would do this using a bash if/else like this

if [ ! -f "$FILE" ]; then
    echo "$FILE does not exist."
fi

If this is fine, I would be happy to take this task.

Regarding 2.
We could do a hack by transforming the yaml to json first and then apply a schema.

Something like

ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < test.yml > test.json && ajv validate -s ./schema.json -d test.json; rm test.json

The solution would not be nice but a quick try to enforce some kind of schema on the yaml files.

@vdemeester
Copy link
Member

/cc @sthaha who also started to work on this I think 😉

@vinamra28 vinamra28 mentioned this issue May 27, 2024
12 tasks
This was referenced Jun 2, 2024
@jimmyjones2 jimmyjones2 mentioned this issue Jun 22, 2024
11 tasks
@garethahealy garethahealy mentioned this issue Jul 22, 2024
12 tasks
@piyush-garg piyush-garg mentioned this issue Aug 21, 2024
12 tasks
This was referenced Sep 6, 2024
@sarroutbi sarroutbi mentioned this issue Sep 18, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants