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

[TEP-0100] Add status helper functions for minimal embedded status #4850

Merged
merged 1 commit into from May 12, 2022

Conversation

abayer
Copy link
Contributor

@abayer abayer commented May 9, 2022

Changes

This is a follow-up to TEP-0100,
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!

/kind tep
/kind feature

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in
    (if there are no user facing changes, use release note "NONE")

Release Notes

Added helper functions for retrieving full `TaskRun` and `Run` statuses when using `embedded-status=minimal`.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). kind/feature Categorizes issue or PR as related to a new feature. labels May 9, 2022
@abayer
Copy link
Contributor Author

abayer commented May 9, 2022

/assign @jerop
/assign @lbernick

@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 9, 2022
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/helpers/status.go Do not exist 89.2%

Copy link
Member

@jerop jerop left a 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!

limitations under the License.
*/

package helpers
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

@abayer
Copy link
Contributor Author

abayer commented May 10, 2022

/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>
@abayer abayer force-pushed the minimal-status-helper-funcs branch from 92ab74b to ab2183d Compare May 10, 2022 17:01
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/status/status.go Do not exist 89.2%

@abayer
Copy link
Contributor Author

abayer commented May 10, 2022

/retest

Copy link
Member

@lbernick lbernick left a 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.

@abayer
Copy link
Contributor Author

abayer commented May 11, 2022

@lbernick The logic in the reconciler package is generating the maps from ResolvedPipelineRunTasks, not from ChildStatusReferences, so it's not really portable. These helper functions are really just wrappers around Get calls, etc.

@abayer
Copy link
Contributor Author

abayer commented May 11, 2022

/retest

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.

/cc @tektoncd/cli-maintainers

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 12, 2022
Copy link
Member

@afrittoli afrittoli left a 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

@tekton-robot
Copy link
Collaborator

[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:
  • OWNERS [afrittoli,vdemeester]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@afrittoli
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 12, 2022
@abayer
Copy link
Contributor Author

abayer commented May 12, 2022

/retest

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. kind/feature Categorizes issue or PR as related to a new feature. kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants