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

Refine check if the result is from a matrix task #8158

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

zregvart
Copy link
Contributor

Changes

Given a matrix run of a TaskRun with cardinality of 1, the result from it will not be converted to an array but kept as a string, i.e. as if the TaskRun was not configured to run with matrix.

This causes issues for consumers of the TaskRun's results as they will be configured to consume array results. As a result making the passed value equal to expression value instead.

Resolves: #8157

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

Fixed variable substitution of results from matrix TaskRuns with cardinality of 1.

Given a matrix run of a TaskRun with cardinality of 1, the result from
it will not be converted to an array but kept as a string, i.e. as if
the TaskRun was not configured to run with matrix.

This causes issues for consumers of the TaskRun's results as they will
be configured to consume array results. As a result making the passed
value equal to expression value instead.

Resolves: tektoncd#8157
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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 Jul 29, 2024
@tekton-robot
Copy link
Collaborator

Hi @zregvart. 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 afrittoli and jerop July 29, 2024 12:57
@zregvart
Copy link
Contributor Author

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 29, 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 98.3% 99.2% 0.8

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/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 Jul 29, 2024
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 @chitrangpatel @afrittoli
we'll want to backport this I think

@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 29, 2024
@arewm
Copy link

arewm commented Jul 31, 2024

Wow, this is awesome! Looking forward to this bug being resolved so I can start using matrix builds!

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.

/lgtm

@@ -132,7 +132,7 @@ func convertToResultRefs(pipelineRunState PipelineRunState, target *ResolvedPipe
resolvedResultRefs = append(resolvedResultRefs, resolved)
default:
// Matrixed referenced Pipeline Task
if len(referencedPipelineTask.TaskRuns) > 1 {
if referencedPipelineTask.PipelineTask.IsMatrixed() {
Copy link
Member

Choose a reason for hiding this comment

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

Heh, we don't want to exclude size 1 matrices 😅

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2024
@afrittoli
Copy link
Member

cc @chitrangpatel @afrittoli we'll want to backport this I think

Yeah, definitely

@tekton-robot tekton-robot merged commit f89f789 into tektoncd:main Jul 31, 2024
14 checks passed
@zregvart zregvart deleted the issue/8157 branch July 31, 2024 13:41
@vdemeester
Copy link
Member

/cherry-pick release-v0.62.x

@vdemeester
Copy link
Member

/cherry-pick release-v0.59.x

@tekton-robot
Copy link
Collaborator

@vdemeester: new pull request created: #8167

In response to this:

/cherry-pick release-v0.62.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: #8168

In response to this:

/cherry-pick release-v0.59.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.

@vdemeester
Copy link
Member

/cherry-pick release-v0.56.x

@tekton-robot
Copy link
Collaborator

@vdemeester: new pull request created: #8169

In response to this:

/cherry-pick release-v0.56.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.

arewm added a commit to konflux-ci/olm-operator-konflux-sample that referenced this pull request Aug 30, 2024
Actions taken:
* Move the PipelineSpec content into a Pipeline file
* Rearranged the spec to be ordered params, tasks, results, finally,
  workspaces
* Added back the on-cel-expressions from before (changing the pipeline
  which will trigger builds from multi-arch-build-pipeline)
* Added spec.params.build-platforms to the PipelineRun
* Changed the build-image-index task to accept a single value for IMAGES
  to allow for a single arch build for initial builds since
  tektoncd/pipeline#8158 is not deployed to the
  Konflux cluster yet.

Signed-off-by: arewm <[email protected]>
arewm added a commit to konflux-ci/olm-operator-konflux-sample that referenced this pull request Aug 30, 2024
Actions taken:
* Move the PipelineSpec content into a Pipeline file
* Rearranged the spec to be ordered params, tasks, results, finally,
  workspaces
* Added back the on-cel-expressions from before (changing the pipeline
  which will trigger builds from multi-arch-build-pipeline)
* Added spec.params.build-platforms to the PipelineRun
* Changed the build-image-index task to accept a single value for IMAGES
  to allow for a single arch build for initial builds since
  tektoncd/pipeline#8158 is not deployed to the
  Konflux cluster yet.

Signed-off-by: arewm <[email protected]>
arewm added a commit to konflux-ci/olm-operator-konflux-sample that referenced this pull request Aug 30, 2024
Actions taken:
* Move the PipelineSpec content into a Pipeline file
* Rearranged the spec to be ordered params, tasks, results, finally,
  workspaces
* Added back the on-cel-expressions from before (changing the pipeline
  which will trigger builds from multi-arch-build-pipeline)
* Added spec.params.build-platforms to the PipelineRun
* Changed the build-image-index task to accept a single value for IMAGES
  to allow for a single arch build for initial builds since
  tektoncd/pipeline#8158 is not deployed to the
  Konflux cluster yet.

Signed-off-by: arewm <[email protected]>
arewm added a commit to konflux-ci/olm-operator-konflux-sample that referenced this pull request Aug 30, 2024
Actions taken:
* Move the PipelineSpec content into a Pipeline file
* Rearranged the spec to be ordered params, tasks, results, finally,
  workspaces
* Added back the on-cel-expressions from before (changing the pipeline
  which will trigger builds from multi-arch-build-pipeline)
* Added spec.params.build-platforms to the PipelineRun
* Changed the build-image-index task to accept a single value for IMAGES
  to allow for a single arch build for initial builds since
  tektoncd/pipeline#8158 is not deployed to the
  Konflux cluster yet.

Signed-off-by: arewm <[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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

No variable substitution when using matrix and array the length of 1
6 participants