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

Adds a tool to create a simple task template #739

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PuneetPunamiya
Copy link
Member

Signed-off-by: Puneet Punamiya ppunamiy@redhat.com

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.


@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 26, 2021
@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign vdemeester
You can assign the PR to them by writing /assign @vdemeester in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 26, 2021
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @tektoncd/catalog-maintainers

@tekton-robot tekton-robot requested a review from a team June 11, 2021 09:10
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 11, 2021
@PuneetPunamiya
Copy link
Member Author

/hold cancel

@PuneetPunamiya
Copy link
Member Author

/test pull-tekton-catalog-integration-tests

@PuneetPunamiya PuneetPunamiya changed the title [WIP] Adds a tool to create a simple task template Adds a tool to create a simple task template Jun 11, 2021
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 11, 2021
Copy link
Member

@chmouel chmouel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits about code, maybe you would like to do a class and some argpass for passing default argument, you can maybe get inspiration from this script if you want to snatch the parse_args/main and class function

tools/tools.py Outdated
json_object = json.loads(jsondata)

# Type of resource
type = input("Enter type of resource: task/pipeline: ").lower()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is normally a reserver word in python :D

tools/tools.py Outdated
metadata["annotations"]["tekton.dev/pipelines.minVersion"] = minPipelineVersion
metadata["annotations"]["tekton.dev/displayName"] = displayName

except OSError as error:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't you just os.path.exists the file instead of a try block?

tools/tools.py Outdated
metadata["annotations"]["tekton.dev/displayName"] = displayName

except OSError as error:
print("""Resource with %s and version %s already exists""" %
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use fstring instead

@chmouel
Copy link
Member

chmouel commented Jun 11, 2021

I think ideally it would be best to include a README template as well and have a few argument, we could as plug inside cookicutter which would get us a lot of lifting :

https://github.com/cookiecutter/cookiecutter

For example for a default template on django https://github.com/pydanny/cookiecutter-django

Another idea, would be to just do this in go inside catlin (with go 1.5 embed stuff), having the validator near the linter (ie: same repo) is not a bad idea i think, so we can update easily the lint and the default template in a commit,

optional: true # Optional value of the workspace

params:
- name: '' # Name of parms

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo

Suggested change
- name: '' # Name of parms
- name: '' # Name of param

  - This patch adds a tool which help to create
    a manifest template for task/pipeline based
    on Tekton Catalog Organization Proposal

Signed-off-by: Puneet Punamiya <ppunamiy@redhat.com>
@tekton-robot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 15, 2021
@vinamra28
Copy link
Member

/remove-lifecycle stale
@PuneetPunamiya any progress on this?

@tekton-robot tekton-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 18, 2021
@tekton-robot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2022
@vinamra28
Copy link
Member

/remove-lifecycle stale
/lifecycle frozen

@tekton-robot tekton-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 16, 2022
@vinamra28
Copy link
Member

since we are moving all these in catlin, @PuneetPunamiya can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants