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

updating an existing example pipelinerun with array results #6055

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

pritidesai
Copy link
Member

@pritidesai pritidesai commented Jan 26, 2023

Changes

Updating a PR to validate the length of the array results including each element in the array.

Also, added an example to validate an array when one of the elements is empty string.

This is for the preparation of a potential promotion of #5688.

Signed-off-by: pritidesai pdesai@us.ibm.com

/kind misc

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

NONE

@tekton-robot tekton-robot added kind/misc Categorizes issue or PR as a miscellaneuous one. release-note-none Denotes a PR that doesnt merit a release note. labels Jan 26, 2023
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 26, 2023
@pritidesai pritidesai added this to the Pipelines v0.45 milestone Jan 27, 2023
Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

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

@pritidesai do you mind passing array results to matrix and when expressions in this example, in addition to params? for the matrix one to work, #6056 has to be merged first

@Yongxuanzhang
Copy link
Member

@pritidesai do you mind passing array results to matrix and when expressions in this example, in addition to params? for the matrix one to work, #6056 has to be merged first

#6056 has updated one example to use matrix and results. Maybe it's ok to let this PR's example only focusing on how to use array results?

@pritidesai
Copy link
Member Author

pritidesai commented Jan 30, 2023

Thank you @jerop and @Yongxuanzhang for the review!

Array indexing into matrix is not yet supported, I agree with @Yongxuanzhang to delay adding an example as it's not possible to run it as part of our CI when the feature is not implemented yet.

I prefer to create a separate PR for referencing array results into when expressions with a necessary doc update. A separate PR will be focused on just when expressions and easier to review for the reviewers. Thanks!

/test check-pr-has-kind-label

@tekton-robot
Copy link
Collaborator

@pritidesai: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

Thank you @jerop and @Yongxuanzhang for the review!

Array indexing into matrix is not yet supported yet, I agree with @Yongxuanzhang to delay adding an example as it's not possible to run it as part of our CI when the feature is not implemented yet.

I prefer to create a separate PR for referencing array results into when expressions with a necessary doc update. A separate PR will be focused on just when expressions and easier to review for the reviewers. Thanks!

/test check-pr-has-kind-label

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.

@jerop
Copy link
Member

jerop commented Jan 30, 2023

sounds good to me to add those examples in other PRs, just want to make sure that those cases are covered too

@pritidesai
Copy link
Member Author

sounds good to me to add those examples in other PRs, just want to make sure that those cases are covered too

Yup, added a note in the issue which is tracking a list of action items for the promotion, thanks!

@pritidesai
Copy link
Member Author

/retest

diff=$(diff <(printf "%s\n" "${VALUE[@]}") <(printf "%s\n" "${EXPECTED[@]}"))
if [[ -z "$diff" ]]; then
echo "Get expected: ${VALUE}"
echo "Got expected: ${VALUE}"
Copy link
Member

Choose a reason for hiding this comment

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

I think we may need to remove the exit 0 here. Otherwise the next validation won't happen

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, you are absolutely right 💯 Thanks for pointing that out 👍 Dropped exit 0 from here.

@pritidesai pritidesai force-pushed the example-pr-array-results branch from efebac2 to 8c88de2 Compare February 3, 2023 17:16
Updating a PR to validate the length of the array results including
each element in the array.

Also, added an example to validate an array when one of the elements is
empty string.

Signed-off-by: pritidesai <pdesai@us.ibm.com>
@pritidesai pritidesai force-pushed the example-pr-array-results branch from 8c88de2 to d945634 Compare February 3, 2023 20:47
@Yongxuanzhang
Copy link
Member

/lgtm
thanks!

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 3, 2023
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.

Thank you @pritidesai
/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli

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 Feb 7, 2023
@tekton-robot tekton-robot merged commit 12ae79b into tektoncd:main Feb 7, 2023
@pritidesai pritidesai deleted the example-pr-array-results branch February 7, 2023 16:16
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/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. 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.

5 participants