cli icon indicating copy to clipboard operation
cli copied to clipboard

Make tkn easier to automate: add run name output, add status check

Open dbazhal opened this issue 4 years ago • 20 comments

Version and Operating System

tkn Version: 0.8.0

Expected Behavior

I want to automate task/pipeline runs with tkn. So i want to be able to do smth like

run_name=$(tkn p start -o name pipeline_name)
tkn pr logs -f $run_name
exit $(tkn pr status $run_name)

or shorter

tkn p start --showlog --watch pipeline_name

So it would be nice to add:

  • option "only output a name of new created run" to run command
  • status command to find out how run ended
  • optionally: add "watch and exit with run status" option to run command

I know that i now can get all data from pipeline run body, but name/status fields seem to be standard enough to deserve separate call in command line.

dbazhal avatar Mar 03 '20 15:03 dbazhal

(I guess tkn version is 0.8.0 though, and the pipeline instance is 0.10.x)

/kind feature

vdemeester avatar Mar 03 '20 15:03 vdemeester

oh, soz, it really is 0.8.0 :D

dbazhal avatar Mar 03 '20 15:03 dbazhal

Even tho that doesnt address fully your use case there is the --last option as well..

chmouel avatar Mar 03 '20 16:03 chmouel

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 avatar Aug 13 '20 15:08 tekton-robot

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 avatar Aug 13 '20 15:08 tekton-robot

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 avatar Aug 13 '20 15:08 tekton-robot

@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.

tekton-robot avatar Aug 13 '20 15:08 tekton-robot

Still would like to see this implemented.

dbazhal avatar Aug 21 '20 13:08 dbazhal

Anybody to /reopen ?

dbazhal avatar Aug 21 '20 13:08 dbazhal

/remove-lifecycle rotten /remove-lifecycle stale /reopen

vdemeester avatar Aug 21 '20 13:08 vdemeester

@vdemeester: Reopened this issue.

In response to this:

/remove-lifecycle rotten /remove-lifecycle stale /reopen

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.

tekton-robot avatar Aug 21 '20 13:08 tekton-robot

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 avatar Nov 19 '20 13:11 tekton-robot

/remove-lifecycle stale

dbazhal avatar Nov 19 '20 14:11 dbazhal

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 avatar Feb 17 '21 15:02 tekton-robot

/remove-lifecycle stale

dbazhal avatar Feb 17 '21 15:02 dbazhal

/lifecycle frozen

would be useful indeed,

chmouel avatar Feb 18 '21 08:02 chmouel

is issue bumping legal? i'd like to bump :)

dbazhal avatar May 13 '21 20:05 dbazhal

Yeah i think there was a PR floating around about it, we need to check how to revive this.

chmouel avatar May 17 '21 07:05 chmouel

+1 on this feature.

Today we are using the following script

tkn pr describe $run_name -o json | jq -c '.status.conditions[] | select(.type | contains("Succeeded")?) | .status'

Yeah i think there was a PR floating around about it, we need to check how to revive this.

@chmouel are you referring to this PR https://github.com/tektoncd/cli/pull/1433 (but for the name, not the status)?

mgreau avatar Mar 04 '22 22:03 mgreau

@mgreau correct! I'd love to have this feature too,

chmouel avatar Mar 07 '22 07:03 chmouel