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

[release-v0.37.x] Fix the issue with empty array replacement #5394

Conversation

vdemeester
Copy link
Member

@vdemeester vdemeester commented Aug 30, 2022

Changes

This backports #5162 that fixes #5149 as it also affects 0.37.x.

Submitter Checklist

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

  • Has Docs included if any changes are user facing
  • 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)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

After the replacement with an empty array, the original array will be empty.

Example:
---
params:
  - name: myarray
     value: "$(params.anEmptyArray[*])"

/cc @abayer @afrittoli @lbernick @jerop

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 30, 2022
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 30, 2022
@vdemeester vdemeester changed the title SRVKP-2422 fix empty array params [release-v0.37.x] Fix the issue with empty array replacement Aug 30, 2022
Prior to this change, if there is only one element in an array that is
a reference to an empty array, the original array becomes nil after
replacement, but it should be an empty array instead of nil.

Fixes tektoncd#5149

Signed-off-by: Vincent Demeester <[email protected]>
@vdemeester vdemeester force-pushed the backport-fix-empty-array-params branch from 77d4db9 to 3c3e426 Compare August 30, 2022 14:58
@vdemeester
Copy link
Member Author

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 30, 2022
@abayer
Copy link
Contributor

abayer commented Aug 30, 2022

/approve

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 30, 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/apis/pipeline/v1beta1/param_types.go 98.1% 97.4% -0.7

Signed-off-by: Vincent Demeester <[email protected]>
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abayer

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
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/apis/pipeline/v1beta1/param_types.go 98.1% 97.4% -0.7
pkg/pod/creds_init.go 93.9% 93.3% -0.5

@lbernick
Copy link
Member

What's the commit with "nosec"? Is that supposed to be in there?

@abayer
Copy link
Contributor

abayer commented Aug 30, 2022

What's the commit with "nosec"? Is that supposed to be in there?

It's just making golangci-lint be quiet about something we don't care about that's only showing up now because we're using a newer golangci-lint in the test-runner image now than we were at the time of the v0.37.0 release. I already dealt with it on main earlier this month.

@lbernick
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2022
@tekton-robot tekton-robot merged commit 2dbca2c into tektoncd:release-v0.37.x Aug 30, 2022
@vdemeester vdemeester deleted the backport-fix-empty-array-params branch August 30, 2022 21:13
@afrittoli
Copy link
Member

/cherrypick release-v0.36.x

@tekton-robot
Copy link
Collaborator

@afrittoli: new pull request created: #5442

In response to this:

/cherrypick release-v0.36.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.

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 Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants