-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[TEP-0100] Add status helper functions for minimal embedded status #4850
[TEP-0100] Add status helper functions for minimal embedded status #4850
Conversation
The following is the coverage report on the affected files.
|
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.
@abayer - thank you for this follow up!
pkg/helpers/status.go
Outdated
limitations under the License. | ||
*/ | ||
|
||
package helpers |
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.
maybe we can name this package status
? helpers is not too descriptive
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.
I went with helpers
because I thought it might be useful to have a package for any future helper functions, but I'm fine with naming it more narrowly as status
.
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.
@bobcatfish makes some arguments against helpers in https://bobcatfish.com/post/helpers/ - I think they are strong arguments, what do you think?
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.
Sounds fine by me! I'll rename to status
.
/retest |
This is a follow-up to [TEP-0100](https://github.com/tektoncd/community/blob/main/teps/0100-embedded-taskruns-and-runs-status-in-pipelineruns.md), adding helper functions for getting the full underlying `TaskRun` or `Run` status for a `ChildStatusReference`, and for populating full embedded-style maps of `TaskRun` name to `PipelineRunTaskRunStatus` and `Run` name to `PipelineRunRunStatus`. I wasn't sure what package to put these in - there didn't seem to be a good one, so I opted to create the new `pkg/helpers` package. But if someone's got a better location, I'll more than happily move them! Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
92ab74b
to
ab2183d
Compare
The following is the coverage report on the affected files.
|
/retest |
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.
I'm wondering if it would make sense to export helpers that are actually used by the PipelineRun reconciler. It's easy for code that is called only in tests to go stale.
@lbernick The logic in the reconciler package is generating the maps from |
/retest |
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.
/cc @tektoncd/cli-maintainers
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.
Really nice, thank you!
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli, 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 |
/lgtm |
/retest |
Changes
This is a follow-up to TEP-0100,
adding helper functions for getting the full underlying
TaskRun
orRun
status for aChildStatusReference
,and for populating full embedded-style maps of
TaskRun
name toPipelineRunTaskRunStatus
andRun
name to
PipelineRunRunStatus
.I wasn't sure what package to put these in - there didn't seem to be a good one, so I opted to
create the new
pkg/helpers
package. But if someone's got a better location, I'll more than happilymove them!
/kind tep
/kind feature
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
(if there are no user facing changes, use release note "NONE")
Release Notes