-
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
Refactor ResolvedPipelineTask and remove redundant fields #6649
Refactor ResolvedPipelineTask and remove redundant fields #6649
Conversation
c85b77b
to
8a5774c
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
8a5774c
to
1127c9e
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/assign @lbernick |
1127c9e
to
6f03a8e
Compare
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.
Thanks for the review @lbernick. Updated with comments below.
@@ -112,9 +112,9 @@ func (state PipelineRunState) ToMap() map[string]*ResolvedPipelineTask { | |||
// IsBeforeFirstTaskRun returns true if the PipelineRun has not yet started its first TaskRun | |||
func (state PipelineRunState) IsBeforeFirstTaskRun() bool { | |||
for _, t := range state { | |||
if t.IsCustomTask() && t.RunObject != nil { | |||
if t.IsCustomTask() && len(t.RunObjects) > 0 { |
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.
Updated and added test coverage for matrixed runs.
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest |
@EmmaMunley: The
The following commands are available to trigger optional jobs:
Use 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. |
/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.
@EmmaMunley thanks for the updates! would you mind pulling the bug fixes (e.g. isBeforeFirstTaskRun) into a separate PR?
6f03a8e
to
3fba1b8
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
/retest |
350e429
to
38c2e08
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
38c2e08
to
a791bad
Compare
The following is the coverage report on the affected files.
|
The following is the coverage report on the affected files.
|
a791bad
to
156dc98
Compare
The following is the coverage report on the affected files.
|
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.
In general lgtm, thanks for improving the code! There are lots of nice improvements
Currently, PipelineRun resolution code can be difficult to understand. This commit removes some of the redundant fields in ResolvedPipelineTask including the singular version of: TaskRun, TaskRunName, ObjectRun, ObjectRunName so that only the list of TaskRuns, TaskRunNames, ObjectRuns, ObjectRunNames can be used regardless if the PipelineTask is matrixed or not. This also streamlines the codebase by removing the switch statements used throughout. This partially addresses Issue tektoncd#6628.
156dc98
to
88ed934
Compare
The following is the coverage report on the affected files.
|
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.
Thanks @EmmaMunley!
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerop, lbernick, Yongxuanzhang 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 |
Changes
Currently, PipelineRun resolution code can be difficult to understand. This commit removes some of the redundant fields in ResolvedPipelineTask including the singular version of: TaskRun, TaskRunName, ObjectRun, ObjectRunName so that only the list of TaskRuns, TaskRunNames, ObjectRuns, ObjectRunNames can be used regardless if the PipelineTask is matrixed or not. This also streamlines the codebase by removing the switch statements used throughout. This partially addresses Issue #6628.
/kind cleanup
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes