-
Notifications
You must be signed in to change notification settings - Fork 255
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
parse full duration for time formatting #1520
Conversation
Hi @jbpratt. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Hi, this may not be the desired result for describing the duration, if so we can close this and close up #1495 as won't fix 😺 |
I think the output in question (in the issue) comes from here cli/pkg/pipelinerun/description/description.go Lines 113 to 119 in d1bbad0
Lines 32 to 39 in d1bbad0
ParseShort to Parse results in the seemingly desired output.
|
Adding some output examples:
|
/ok-to-test |
The following is the coverage report on the affected files.
|
/test pull-tekton-cli-unit-tests |
Instead of having this long text |
Sure, I'll need to figure that out because the library used doesn't support that https://github.com/hako/durafmt (maybe a custom format, or this just works with native time/duration). Any suggestions are welcome :) |
6f6dce5
to
493fbb7
Compare
@piyush-garg PTAL, I've updated to use the native
|
The following is the coverage report on the affected files.
|
Use native `time.Duration.String()` format fixes tektoncd#1495 Signed-off-by: jbpratt <jbpratt78@gmail.com>
493fbb7
to
a79baae
Compare
Again, if this isn't desired we can close this out and leave an explanation on the ticket (#1495) |
The following is the coverage report on the affected files.
|
Hi @pradeepitm12 @piyush-garg @vdemeester please take a look |
/lgtm |
@piyush-garg: GitHub didn't allow me to request PR reviews from the following users: for, opinions/reviews. Note that only tektoncd members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks way much better to me, those "human duration" always bugged me. Feel free to clean this go.mod entry then and that should probably good to go.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chmouel 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 |
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
#1525 | [Piyush Garg] Update docs to latest version 0.23.0 | 2022/03/09-17:25 #1528 | [Chmouel Boudjnah] generate universal binaries for osx | 2022/03/11-10:28 #1529 | [PuneetPunamiya] Adds namespace where operator is installed | 2022/03/11-14:06 #1530 | [Chmouel Boudjnah] Remove go11modules export instructions in README | 2022/03/14-15:49 #1526 | [Chmouel Boudjnah] Add information about arch package | 2022/03/14-16:17 #1523 | [Vincent Demeester] ROADMAP.md: update it to reflect 2022 goals | 2022/03/15-11:18 #1467 | [mathew-fleisch] Go compile darwin-arm64 in makefile for m1 macs | 2022/03/15-13:04 #1520 | [jbpratt] parse full duration for time formatting | 2022/03/15-16:12 #1531 | [Chmouel Boudjnah] Add "tkn taskrun export" | 2022/03/18-09:46 #1538 | [Chmouel Boudjnah] update to cobra 1.4.0 | 2022/03/18-11:42 null | [PuneetPunamiya] Updates the configMap name for Operator version | 2022/03/18-13:01 null | [Chmouel Boudjnah] Add -o name to pipeline start | 2022/03/22-11:32 null | [Piyush Garg] This will fix the version command failing for chain and operator | 2022/03/23-12:16 null | [Pradeep Kumar] fix error while deleting pr without status | 2022/03/24-07:16 Signed-off-by: Piyush Garg <pgarg@redhat.com>
Changes
Use native
.String()
impl fortime.Duration
fixes #1495
Signed-off-by: jbpratt jbpratt78@gmail.com
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make check
make generated
See the contribution guide
for more details.
Release Notes