Skip to content

Do not print twice Cancelled when listing#2438

Merged
tekton-robot merged 1 commit intotektoncd:mainfrom
chmouel:do-not-print-twice-cancelled-when-listing
Nov 29, 2024
Merged

Do not print twice Cancelled when listing#2438
tekton-robot merged 1 commit intotektoncd:mainfrom
chmouel:do-not-print-twice-cancelled-when-listing

Conversation

@chmouel
Copy link
Member

@chmouel chmouel commented Nov 27, 2024

When listing the status of pipelinerun we would show something like this for cancelled PR:

NAME            STARTED         DURATION   STATUS
pr-hmth-fmknk   5 minutes ago   1m8s       Succeeded
pr-hmth-7qzlb   5 minutes ago   11s        Cancelled(Cancelled)
pr-hmth-dtdrh   7 minutes ago   1m14s      Succeeded
pr-zrbj-f4kq8   7 minutes ago   1m24s      Succeeded
pr-zrbj-hxhw2   7 minutes ago   9s         Cancelled(Cancelled)

which makes no sense, the Cancelled(Cancelled) is redundant, so we fix this by checking the reasons is not the same as what we are going to set. which now show a nicer:

NAME            STARTED          DURATION   STATUS
pr-hmth-fmknk   8 minutes ago    1m8s       Succeeded
pr-hmth-7qzlb   8 minutes ago    11s        Cancelled
pr-hmth-dtdrh   10 minutes ago   1m14s      Succeeded
pr-zrbj-f4kq8   10 minutes ago   1m24s      Succeeded
pr-zrbj-hxhw2   10 minutes ago   9s         Cancelled

Changes

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

See the contribution guide
for more details.

Release Notes

Fix listing with `tkn pr list` as *Cancelled*

When listing the status of pipelinerun we would show something like
this for cancelled PR:

```console
NAME            STARTED         DURATION   STATUS
pr-hmth-fmknk   5 minutes ago   1m8s       Succeeded
pr-hmth-7qzlb   5 minutes ago   11s        Cancelled(Cancelled)
pr-hmth-dtdrh   7 minutes ago   1m14s      Succeeded
pr-zrbj-f4kq8   7 minutes ago   1m24s      Succeeded
pr-zrbj-hxhw2   7 minutes ago   9s         Cancelled(Cancelled)
```

which makes no sense, the Cancelled(Cancelled) is redundant, so we
fix this by checking the reasons is not the same as what we are going to
set. which now show a nicer:

```console
NAME            STARTED          DURATION   STATUS
pr-hmth-fmknk   8 minutes ago    1m8s       Succeeded
pr-hmth-7qzlb   8 minutes ago    11s        Cancelled
pr-hmth-dtdrh   10 minutes ago   1m14s      Succeeded
pr-zrbj-f4kq8   10 minutes ago   1m24s      Succeeded
pr-zrbj-hxhw2   10 minutes ago   9s         Cancelled
```

Signed-off-by: Chmouel Boudjnah <[email protected]>
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Nov 27, 2024
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Nov 27, 2024
@pratap0007
Copy link
Contributor

/lgtm

@tekton-robot
Copy link
Contributor

@pratap0007: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

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.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 29, 2024
@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

Details 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 Nov 29, 2024
@tekton-robot tekton-robot merged commit e34ea22 into tektoncd:main Nov 29, 2024
@chmouel chmouel deleted the do-not-print-twice-cancelled-when-listing branch November 29, 2024 13:00
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-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants