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

CLI tool for manual Trigger runs #624

Closed
dibyom opened this issue Jun 19, 2020 · 17 comments
Closed

CLI tool for manual Trigger runs #624

dibyom opened this issue Jun 19, 2020 · 17 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@dibyom
Copy link
Member

dibyom commented Jun 19, 2020

Expected Behavior

I can easily test out their Trigger config e.g. does the CEL expression work, does my binding expression extract the right variable, does my trigger template replace the right variable etc.

Actual Behavior

I have to setup an EventListener, TriggerBinding, and TriggerTemplate. I have to port-forward to the Listener, and make a curl call, and then look into the Listener logs to figure out what happened.

Additional Info

Example CLI surface from discussing with @bigkevmcd :

triggers-run -H "X-GitHub-Event: testing" -d @testing.json -f triggers.yaml
  1. triggers.yaml is a file containing the trigger definitions
  2. The CLI supports curl like flags for sending headers and body
  3. The tool will prints out the trigger processing logs to stdout
  4. It will also print out the fully formed Tekton resource to be created once the trigger is processed instead of creating them

Out of scope for now:

  1. Testing Trigger level service account permissions

Can be added later:

  1. Actually create the resources instead of just printing them out
  2. Dry run against a already running listener instead of definitions from a file
  3. Make it part of the tkn surface e.g. tkn trigger run ....
  4. Account for the Trigger service account permissions

Related :

  1. TriggerTemplateRun TriggerTemplateRun !? #200
  2. Binding eval tool FR: Binding resolution utility #314

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 19, 2020
@dibyom
Copy link
Member Author

dibyom commented Jun 19, 2020

/cc @wlynch @dorismeixing @bigkevmcd

@vdemeester
Copy link
Member

Any reason for not pushing for having this in tkn early ? 🤔
/cc @danielhelfand @pradeepitm12 @piyush-garg

@danielhelfand
Copy link
Member

Any reason for not pushing for having this in tkn early ? 🤔

Reading this, it sounds like more of a proof of concept/basic requirements at this point and could potentially be added to tkn later on (e.g. tkn trigger run under Can be added later) if understanding correctly? Either as part of tkn itself or maybe could be added as some type of plugin to tkn if that would be a more preferred route.

But I would see no reason not to want something like this as part of tkn. Just would maybe need some thought on where it would best fit structurally.

@dibyom
Copy link
Member Author

dibyom commented Jun 22, 2020

yeah, one motivation for keeping this in Triggers would be faster/easier iteration -- we'd have to do some refactoring to how we execute a Trigger to ensure we can run it outside the context of an EventListener. Once that is done, it should be easy enough to make it part of the tkn surface!
(The plugin model sounds cool too!!)

dorismeixing added a commit to dorismeixing/triggers that referenced this issue Jul 9, 2020
This part one contians the funcstions to parse yaml file and HTTP, and the corresponding unit test.
It relates to issue tektoncd#624.
tekton-robot pushed a commit that referenced this issue Jul 10, 2020
This part one contians the funcstions to parse yaml file and HTTP, and the corresponding unit test.
It relates to issue #624.
wlynch added a commit to wlynch/triggers that referenced this issue Jul 14, 2020
The existing `resolveTrigger` and related Trigger processing functions
currently assume an `EventListenerTrigger` input. With the introduction of
Trigger CRDs, we need a mechanism to handle triggers consisently,
regardless of their originating type.

As a first step, this allows for `TriggerSpec` to be converted to
`EventListenerTrigger` in order to reuse existing libraries.

Part of the work required for
tektoncd#624.
wlynch added a commit to wlynch/triggers that referenced this issue Jul 15, 2020
The existing `resolveTrigger` and related Trigger processing functions
currently assume an `EventListenerTrigger` input. With the introduction of
Trigger CRDs, we need a mechanism to handle triggers consisently,
regardless of their originating type.

As a first step, this allows for `TriggerSpec` to be converted to
`EventListenerTrigger` in order to reuse existing libraries.

Part of the work required for
tektoncd#624.
tekton-robot pushed a commit that referenced this issue Jul 20, 2020
The existing `resolveTrigger` and related Trigger processing functions
currently assume an `EventListenerTrigger` input. With the introduction of
Trigger CRDs, we need a mechanism to handle triggers consisently,
regardless of their originating type.

As a first step, this allows for `TriggerSpec` to be converted to
`EventListenerTrigger` in order to reuse existing libraries.

Part of the work required for
#624.
dorismeixing added a commit to dorismeixing/triggers that referenced this issue Jul 22, 2020
…l referenced bindings, find the trigger template, apply the HTTP request to the binding and template

the part for ProcessTriggerSpec

Add the part one of CLI for trigger run.

This part one contians the funcstions to parse yaml file and HTTP, and the corresponding unit test.
It relates to issue tektoncd#624.

Add unit test for processTriggerSpec

Add unit test for processTriggerSpec

Add ProcessTriggerSpec function to take a Triggers.yaml file, find all referenced bindings, find the trigger template, apply the HTTP request to the binding and template

Add unit test for processTriggerSpec
dorismeixing added a commit to dorismeixing/triggers that referenced this issue Jul 22, 2020
…l referenced bindings, find the trigger template, apply the HTTP request to the binding and template

the part for ProcessTriggerSpec

Add the part one of CLI for trigger run.

This part one contians the funcstions to parse yaml file and HTTP, and the corresponding unit test.
It relates to issue tektoncd#624.

Add unit test for processTriggerSpec

Add unit test for processTriggerSpec

Add ProcessTriggerSpec function to take a Triggers.yaml file, find all referenced bindings, find the trigger template, apply the HTTP request to the binding and template

Add unit test for processTriggerSpec
dorismeixing added a commit to dorismeixing/triggers that referenced this issue Jul 22, 2020
This part one contians the funcstions to parse yaml file and HTTP, and the corresponding unit test.
It relates to issue tektoncd#624.
@tekton-robot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 14, 2020
@tekton-robot
Copy link

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dibyom dibyom reopened this Aug 18, 2020
@dibyom
Copy link
Member Author

dibyom commented Aug 18, 2020

We have some experimental code for this that processes Triggers locally. We should do a release for it and then figure out if it makes sense to merge that into the CLI

@dibyom dibyom removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 18, 2020
@tekton-robot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
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.

/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 Nov 16, 2020
@vdemeester
Copy link
Member

/remove-lifecycle stale

@tekton-robot tekton-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 17, 2020
@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 Feb 15, 2021
@tekton-robot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
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 rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 17, 2021
@dibyom
Copy link
Member Author

dibyom commented Mar 17, 2021

/remove-lifecycle rotten

@tekton-robot tekton-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Mar 17, 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 Jun 15, 2021
@tekton-robot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
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 rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 14, 2021
@tekton-robot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

@tekton-robot
Copy link

@tekton-robot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/close

Send feedback to tektoncd/plumbing.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. 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

4 participants