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

Add --keep-since flag to pipelinerun delete #1392

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

chmouel
Copy link
Member

@chmouel chmouel commented Jun 10, 2021

Changes

Add a --keep-since=Minutes flag to tkn pipelinerun delete.

This allows deleting all pipeline but the one younger than X minutes.

Submitter Checklist

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

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow [commit message best practices](https://github.com

Release Notes

add option --keep-since to tkn pr delete --all to allow keeping some prs that are younger than X minutes when deleting all pipelineruns. 

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 10, 2021
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 10, 2021
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/delete.go 92.9% 84.6% -8.2

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 10, 2021
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/delete.go 92.9% 84.6% -8.2

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/delete.go 92.9% 84.6% -8.2

@vinamra28
Copy link
Member

This PR might address #1388

@chmouel chmouel changed the title Add --keep-younger flag to pipelinerun delete Add --since flag to pipelinerun delete Jun 10, 2021
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/delete.go 92.9% 93.4% 0.5

@chmouel chmouel mentioned this pull request Jun 10, 2021
@chmouel
Copy link
Member Author

chmouel commented Jun 10, 2021

maybe --keep-since is a better flag name 🤔

@pradeepitm12
Copy link
Contributor

maybe --keep-since is a better flag name thinking

@chmouel PERFECT 👍

@pradeepitm12
Copy link
Contributor

How about renaming existing --keep -> --keep-max ?

@chmouel
Copy link
Member Author

chmouel commented Jun 10, 2021

How about renaming existing --keep -> --keep-max ?

Renaming existing is not free backward compatibility and all, we may break a lot of users.. (altho we can do aliases but i don't think it's worth the pain)

@vdemeester
Copy link
Member

How about renaming existing --keep -> --keep-max ?

Renaming existing is not free backward compatibility and all, we may break a lot of users.. (altho we can do aliases but i don't think it's worth the pain)

We could alias it ? But even if we want to do that, it should be in a different PR.

Add a --since age for `tkn pipelinerun delete`.

This allows deleting all pipeline older than X minutes.

Signed-off-by: Chmouel Boudjnah <[email protected]>
@chmouel
Copy link
Member Author

chmouel commented Jun 11, 2021

We could alias it ? But even if we want to do that, it should be in a different PR.

I let this one up as an exercise to the reader 😏

@chmouel chmouel changed the title Add --since flag to pipelinerun delete Add --keep-since flag to pipelinerun delete Jun 11, 2021
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/delete.go 92.9% 94.5% 1.6

Copy link
Contributor

@pradeepitm12 pradeepitm12 left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 14, 2021
@tekton-robot tekton-robot merged commit 29e3aa8 into tektoncd:main Jun 14, 2021
@chmouel chmouel deleted the keepbyage branch June 27, 2021 05:21
pradeepitm12 added a commit that referenced this pull request Jun 29, 2021
#1391 | [Piyush Garg] Update readme for latest version | 2021/06/09-07:23
#1390 | [06kellyjac] Fix version command outputting empty | 2021/06/10-08:49
#1392 | [Chmouel Boudjnah] Add --since flag to pipelinerun delete | 2021/06/14-07:30
#1396 | [hasanrashid] Fix broken links in DEVELOPMENT.MD | 2021/06/18-23:20
#1400 | [Chmouel Boudjnah] Fix typo with my name | 2021/06/23-08:53
#1401 | [Christie Wilson] Add link to tkn bundle to main readme 🔗 | 2021/06/23-09:18
#1403 | [Chmouel Boudjnah] Update README about coloring being disabled | 2021/06/24-13:41
#1405 | [Pradeep Kumar] fix default --prefix=false with p/t/ct start | 2021/06/28-11:00

Signed-off-by: Pradeep Kumar <[email protected]>
pradeepitm12 added a commit that referenced this pull request Jun 29, 2021
#1391 | [Piyush Garg] Update readme for latest version | 2021/06/09-07:23
#1390 | [06kellyjac] Fix version command outputting empty | 2021/06/10-08:49
#1392 | [Chmouel Boudjnah] Add --since flag to pipelinerun delete | 2021/06/14-07:30
#1396 | [hasanrashid] Fix broken links in DEVELOPMENT.MD | 2021/06/18-23:20
#1400 | [Chmouel Boudjnah] Fix typo with my name | 2021/06/23-08:53
#1401 | [Christie Wilson] Add link to tkn bundle to main readme 🔗 | 2021/06/23-09:18
#1403 | [Chmouel Boudjnah] Update README about coloring being disabled | 2021/06/24-13:41
#1405 | [Pradeep Kumar] fix default --prefix=false with p/t/ct start | 2021/06/28-11:00
#1402 | [Chmouel Boudjnah] Add pipelinerun delete by label | 2021/06/29-12:09

Signed-off-by: Pradeep Kumar <[email protected]>
@rolfedh
Copy link

rolfedh commented Oct 25, 2021

Added a release note for this new feature to the Pipelines release notes: https://github.com/openshift/openshift-docs/pull/37369/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

6 participants