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

Rename ArrayOrString to ParamValues #5304

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

Yongxuanzhang
Copy link
Member

@Yongxuanzhang Yongxuanzhang commented Aug 10, 2022

Changes

This commit fixes issue #4858. With the implementation of Tep75,
ArrayOrString contains object type and it would be confusing if still
use the same name. This commit renames it to ParamValues and type alias
ResultValues to ParamValues. Also use type alias to make sure dependant
libraries can still use ArrayOrString and NewArrayOrString.

/kind cleanup

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

Rename ArrayOrString to ParamValues, NewArrayOrString to NewStructuredValues

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Aug 10, 2022
@tekton-robot
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 10, 2022
@Yongxuanzhang
Copy link
Member Author

/test all

@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 96.3% 95.4% -0.9

Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

This is going to be a breaking change to downstream clients. Can we use a type alias (example) instead and deprecate the old ArrayOrString type before removing it?

pkg/apis/pipeline/v1/param_types.go Outdated Show resolved Hide resolved
@Yongxuanzhang
Copy link
Member Author

Yongxuanzhang commented Aug 10, 2022

This is going to be a breaking change to downstream clients. Can we use a type alias (example) instead and deprecate the old ArrayOrString type before removing it?

Yes I added type alias just under this type:
ArrayOrString = ParamValues
ResultValues = ParamValues
And also for method:
NewArrayOrString = NewStructuredValues

So other libraries shouldn't break.

@wlynch
Copy link
Member

wlynch commented Aug 10, 2022

Gah! Totally missed it! 🤦

Thanks 🙏

Copy link
Member

@wlynch wlynch left a comment

Choose a reason for hiding this comment

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

Let's add a simple test to ensure we don't break existing ArrayOrString compatibility, but otherwise lgtm!

pkg/apis/pipeline/v1/param_types.go Outdated Show resolved Hide resolved
@abayer abayer changed the title Rename ArrayOrString to ParamValues WIP: Rename ArrayOrString to ParamValues Aug 11, 2022
@abayer abayer marked this pull request as ready for review August 11, 2022 14:36
@abayer
Copy link
Contributor

abayer commented Aug 11, 2022

I just retitled the PR to start with WIP and marked it as ready for review, so that all the CI jobs launch properly/automatically.

@Yongxuanzhang
Copy link
Member Author

I just retitled the PR to start with WIP and marked it as ready for review, so that all the CI jobs launch properly/automatically.

Oh thank you!

@Yongxuanzhang Yongxuanzhang force-pushed the rename-arrayorstring branch 2 times, most recently from 32b151b to 2865db4 Compare August 11, 2022 17:51
pkg/apis/pipeline/v1/param_types.go Outdated Show resolved Hide resolved
pkg/apis/pipeline/v1/result_types.go Outdated Show resolved Hide resolved
@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 95.4% 96.3% 0.9

@Yongxuanzhang
Copy link
Member Author

/retest

@Yongxuanzhang Yongxuanzhang force-pushed the rename-arrayorstring branch 2 times, most recently from 47f0124 to d6b9248 Compare August 11, 2022 21:31
@Yongxuanzhang Yongxuanzhang force-pushed the rename-arrayorstring branch 2 times, most recently from 4414b55 to f5fc2de Compare August 12, 2022 15:11
@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 95.4% 96.3% 0.9

@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 95.4% 96.3% 0.9

@Yongxuanzhang Yongxuanzhang force-pushed the rename-arrayorstring branch 2 times, most recently from e2028cc to cdd3c13 Compare August 12, 2022 16:18
@Yongxuanzhang Yongxuanzhang changed the title WIP: Rename ArrayOrString to ParamValues Rename ArrayOrString to ParamValues Aug 12, 2022
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 12, 2022
@@ -151,12 +151,12 @@ func resolveResultRef(pipelineState PipelineRunState, resultRef *v1beta1.ResultR
}

var runName, runValue, taskRunName string
var resultValue v1beta1.ArrayOrString
var resultValue v1beta1.ParamValue
Copy link
Member

Choose a reason for hiding this comment

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

should this be a ResultValue? I think you may be able to cast the return value (not sure). As an aside when we update to go 1.18 we might be able to use generics for that function.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yes! This should be result value. I have went through the ParamValue used in result files again and fix some other places as well

Now they can be used interchangeably due to the type alias.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lbernick

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 Aug 15, 2022
This commit fixes issue tektoncd#4858. With the implementation of Tep75,
ArrayOrString contains object type and it would be confusing if still
use the same name. This commit renames it to ParamValues and type alias
ResultValues to ParamValues. Also use type alias to make sure dependant
libraries can still use ArrayOrString and NewArrayOrString.
@abayer
Copy link
Contributor

abayer commented Aug 16, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 16, 2022
@tekton-robot tekton-robot merged commit 795e720 into tektoncd:main Aug 16, 2022
@vdemeester
Copy link
Member

/cc @tektoncd/cli-maintainers we will need to update our usage of ArrayOrString at some point 👼🏼

@pritidesai
Copy link
Member

please make sure to include this kind of notice in the release notes 🙏

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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants