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

feat(matrix): Fix matrix param type mismatch problem for ref array result from customrun scenario #8024

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

hittyt
Copy link
Contributor

@hittyt hittyt commented Jun 5, 2024

fix #8022

Changes

Adjust resolveCustomResultRef implementation in Tekton to handle array results from CustomRun tasks correctly. This change resolves a type mismatch issue when using array results as matrix parameters, ensuring compatibility and proper functioning in scenarios where previous CustomRun emits array results.

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
  • pre-commit Passed
  • 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 the release-note-none Denotes a PR that doesnt merit a release note. label Jun 5, 2024
Copy link

linux-foundation-easycla bot commented Jun 5, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 5, 2024
@tekton-robot
Copy link
Collaborator

Hi @hittyt. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@tekton-robot tekton-robot requested review from bobcatfish and dibyom June 5, 2024 14:49
@hittyt hittyt force-pushed the matrix-ref-customrun-results branch from 02df4a4 to 68336fc Compare June 5, 2024 14:53
@hittyt
Copy link
Contributor Author

hittyt commented Jun 5, 2024

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 5, 2024
@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/resources/resultrefresolution.go 99.2% 98.4% -0.8

@chitrangpatel
Copy link
Contributor

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 14, 2024
@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/resources/resultrefresolution.go 98.3% 98.4% 0.1

}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := paramValueFromCustomRunResult(tt.args.result); !reflect.DeepEqual(got, tt.want) {
Copy link
Member

Choose a reason for hiding this comment

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

We use cmp for comparisons (see here for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I've updated the comparison to use cmp as per the project's coding conventions. Please take a look at the latest commit.

…sult from customrun scenario

Adjust `resolveCustomResultRef` implementation in Tekton to handle array
results from CustomRun tasks correctly. This change resolves a type mismatch
issue when using array results as matrix parameters, ensuring compatibility
and proper functioning in scenarios where previous CustomRun emits array results.
@hittyt hittyt force-pushed the matrix-ref-customrun-results branch from 68336fc to 0b0774c Compare June 21, 2024 09:03
@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/resources/resultrefresolution.go 99.2% 99.2% 0.0

@hittyt hittyt requested a review from vdemeester June 21, 2024 09:13
@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/resources/resultrefresolution.go 99.2% 98.4% -0.8

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/core-maintainers

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 2, 2024
@hittyt
Copy link
Contributor Author

hittyt commented Jul 8, 2024

Hi @tektoncd/core-maintainer,

When you get a chance, could you please review this PR? It has already received positive reviews from @vdemeester and is awaiting your lgtm label. This fix is particularly important for us at Alibaba, as we have a significant use-case that depends on its integration.

We would greatly appreciate a review at your earliest convenience to facilitate progress. I believe the PR is fully compliant with the project's contribution guidelines and is ready for merge.

Thank you for your attention to this matter and for your continued work on this project.

@chitrangpatel
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2024
@tekton-robot tekton-robot merged commit 22e3d0e into tektoncd:main Aug 22, 2024
14 checks passed
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Matrix: invalid param type when consuming results from CustomRun on task matrix.params field
4 participants