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

don't return validation error when final tasks failed/skipped #7407

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

Yongxuanzhang
Copy link
Member

Changes

This commit closes #6139, in previous fix PR:
#6395, only dagTasks statuses are considered and final tasks are missing. This PR fixes this.

/kind bug

Signed-off-by: Yongxuan Zhang [email protected]

Submitter Checklist

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

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 23, 2023
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.3% 92.3% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.5% 99.5% 0.0

@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/reconciler/pipelinerun/pipelinerun.go 92.3% 92.3% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.5% 99.5% 0.0

@chitrangpatel
Copy link
Contributor

/approve

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2023
This commit closes tektoncd#6139, in previous fix PR:
tektoncd#6395, only dagTasks statuses
are considered and final tasks are missing. This PR fixes this.

Signed-off-by: Yongxuan Zhang [email protected]
@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/reconciler/pipelinerun/pipelinerun.go 92.3% 92.3% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.5% 99.5% 0.0

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/pipelinerun.go 92.3% 92.3% 0.0
pkg/reconciler/pipelinerun/resources/pipelinerunstate.go 99.5% 99.5% 0.0

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chitrangpatel, 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 [chitrangpatel,vdemeester]

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

@@ -542,6 +542,30 @@ func (facts *PipelineRunFacts) GetPipelineTaskStatus() map[string]string {
return tStatus
}

// GetPipelineTaskStatus returns the status of a PipelineFinalTask depending on its taskRun
func (facts *PipelineRunFacts) GetPipelineFinalTaskStatus() map[string]string {
// construct a map of tasks.<pipelineTask>.status and its state
Copy link
Member

@QuanZhang-William QuanZhang-William Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this code is very similar to GetPipelineTaskStatus. Can we refactor this part 🙏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the switch part is overlapping, I think that's fine? 🤔

// None includes skipped as well
s = PipelineTaskStateNone
}
tStatus[PipelineTaskStatusPrefix+t.PipelineTask.Name+PipelineTaskStatusSuffix] = s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use fmt.Sprintf()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean fmt.Sprintf(PipelineTaskStatusPrefix, t.PipelineTask.Name, PipelineTaskStatusSuffix)?
we don't have format here, the ide will complain

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking about using fmt.Sprintf("%s%s%s", aa, bb, cc). Not really a big deal though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh 😂 my bad

@QuanZhang-William
Copy link
Member

Thanks!

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 8, 2023
@tekton-robot tekton-robot merged commit 7c040de into tektoncd:main Dec 8, 2023
13 checks passed
@vdemeester
Copy link
Member

@Yongxuanzhang @QuanZhang-William @chitrangpatel we should probably backport this to affected LTS as well, make sense ?

@vdemeester
Copy link
Member

/cherry-pick release-v0.47.x

@vdemeester
Copy link
Member

/cherry-pick release-v0.50.x

@vdemeester
Copy link
Member

/cherry-pick release-v0.53.x

@tekton-robot
Copy link
Collaborator

@vdemeester: #7407 failed to apply on top of branch "release-v0.47.x":

Applying: don't return validation error when final tasks failed/skipped
Using index info to reconstruct a base tree...
A	examples/v1/pipelineruns/6139-regression.yaml
M	pkg/reconciler/pipelinerun/pipelinerun.go
M	pkg/reconciler/pipelinerun/resources/pipelinerunstate.go
M	pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/reconciler/pipelinerun/resources/pipelinerunstate_test.go
Auto-merging pkg/reconciler/pipelinerun/resources/pipelinerunstate.go
Auto-merging pkg/reconciler/pipelinerun/pipelinerun.go
CONFLICT (content): Merge conflict in pkg/reconciler/pipelinerun/pipelinerun.go
Auto-merging examples/v1beta1/pipelineruns/6139-regression.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 don't return validation error when final tasks failed/skipped
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-v0.47.x

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.

@tekton-robot
Copy link
Collaborator

@vdemeester: new pull request created: #7485

In response to this:

/cherry-pick release-v0.50.x

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.

@tekton-robot
Copy link
Collaborator

@vdemeester: new pull request created: #7486

In response to this:

/cherry-pick release-v0.53.x

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.

@Yongxuanzhang
Copy link
Member Author

Yongxuanzhang commented Dec 13, 2023

@Yongxuanzhang @QuanZhang-William @chitrangpatel we should probably backport this to affected LTS as well, make sense ?

Yes! Thanks for helping me to patch this fix. I don't have time this week. >_< But may be able to do so next week or next month after holidays...

@vdemeester
Copy link
Member

This also affects 0.54.x 🙃
/cherry-pick release-v0.54.x

@tekton-robot
Copy link
Collaborator

@vdemeester: new pull request created: #7510

In response to this:

This also affects 0.54.x 🙃
/cherry-pick release-v0.54.x

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.

@concaf
Copy link
Contributor

concaf commented Jan 3, 2024

@vdemeester in case you missed it, it failed to apply on 0.47.x - #7407 (comment)

vdemeester added a commit to vdemeester/tektoncd-pipeline that referenced this pull request Jan 3, 2024
Add some missing functions.

Signed-off-by: Vincent Demeester <[email protected]>
vdemeester added a commit to vdemeester/tektoncd-pipeline that referenced this pull request Jan 3, 2024
Add some missing functions.

Signed-off-by: Vincent Demeester <[email protected]>
@vdemeester
Copy link
Member

#7487 I did the cherry-pick manually

tekton-robot pushed a commit that referenced this pull request Jan 3, 2024
Add some missing functions.

Signed-off-by: Vincent Demeester <[email protected]>
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/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pipeline failing with "invalid pipelineresults" when referencing results of skipped tasks
6 participants