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

Migrate v1beta1 RunResult to Unversioned Package #6514

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Apr 10, 2023

This commit migrates the v1beta1 RunResult to the unversioned result
package since it is no longer a struct in api used for v1beta1 resource types.
The RunResult struct was previously PipelineResourceResult and it has been renamed
and moved to an unversioned package because it is no longer used in apis.

The old struct PipelineResourceResult is kept in v1beta1 for backward compatibility.

follows up: #6434
fixes: #6197
/kind misc

Changes

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
  • 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
  • [n/a] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • [n/a] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

pipelineResourceResult is tombstoned

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/misc Categorizes issue or PR as a miscellaneuous one. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 10, 2023
@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@JeromeJu
Copy link
Member Author

Could we please help check if it makes sense to move RunResult (previously PipelineResourceResult) to pkg/result instead of the pkg/apis/pipeline/v1beta1/result_types? 🙏
cc @lbernick @Yongxuanzhang @chitrangpatel

Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

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

thanks Jerome, can you please add a bit more detail to the commit message/pr description on the reason for this change?

@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 Apr 11, 2023
@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@wlynch
Copy link
Member

wlynch commented Apr 11, 2023

This while this isn't is a breaking schema change, this is a breaking client change since previous code using the v1beta1 fields will break. 😢

Is there any down side to just freezing the fields in place as deprecated in the current package? (we could also move the deprecated types to a separate file in the same package if you're looking to separate out deprecated fields).

@JeromeJu
Copy link
Member Author

Thanks Billy. I thought for this we were aliasing the old struct with PipelineResourceResult in

type PipelineResourceResult = RunResult

Is there any down side to just freezing the fields in place as deprecated in the current package? (we could also move the deprecated types to a separate file in the same package if you're looking to separate out deprecated fields).

And for this since we are going to swap the storage version as this struct is used in pkg/pod/status we would need to either migrate this to v1 or an unversioned package moving forward 😿

Does it make sense that with the aliased v1beta1.PipelineResourceResult left in v1beta1 for backward compatibility while moving the renamed RunResult struct to an unversioned package for keeping the apis independent yet backward compatible? Happy to move it to a more proper place if there is under the apis 🙏

@wlynch
Copy link
Member

wlynch commented Apr 12, 2023

And for this since we are going to swap the storage version as this struct is used in pkg/pod/status we would need to either migrate this to v1 or an unversioned package moving forward 😿

If it's used in the v1 API, package versioned or not it's still effectively a part of the v1 API. 😥 I'd be careful with how these are referenced across v1.

Does it make sense that with the aliased v1beta1.PipelineResourceResult left in v1beta1 for backward compatibility while moving the renamed RunResult struct to an unversioned package for keeping the apis independent yet backward compatible? Happy to move it to a more proper place if there is under the apis 🙏

Makes sense to me!

You'd need type aliases for each type/field moved to the new package. Otherwise PipelineResourceResult would resolve, but underlying types like ResultType, RunResult, etc. won't.

@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@JeromeJu
Copy link
Member Author

If it's used in the v1 API, package versioned or not it's still effectively a part of the v1 API. 😥 I'd be careful with how these are referenced across v1.

I might have been unclear on the v1 apis perspective. Wanted to say that neither PipelineResourceResult nor RunResult is not going to be migrated to v1. I mentioned pod.status just that these two structs are referenced there and it would be easier to change to the v1 storedVersion with RunResult(PipelineResourceResult aliased) moved to an unversioned package.

You'd need type aliases for each type/field moved to the new package. Otherwise PipelineResourceResult would resolve, but underlying types like ResultType, RunResult, etc. won't.

Updated! Thanks for the pointer as always for making sure the compatibility issues:)

@jerop jerop added this to the Pipelines v0.47 milestone Apr 12, 2023
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.

One small thing, otherwise lgtm.

pkg/apis/pipeline/v1beta1/resource_types.go Show resolved Hide resolved
This commit migrates the v1beta1 RunResult to the unversioned result
package since it is no longer a struct in api used for v1beta1 resource types.
The RunResult struct was previously PipelineResourceResult and it has been renamed
and moved to an unversioned package because it is no longer used in apis.

The old struct PipelineResourceResult and its ResultType is aliased and kept in
v1beta1 for backward compatibility.
@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/result/result.go Do not exist 85.7%

@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/result/result.go Do not exist 85.7%

@JeromeJu JeromeJu requested a review from wlynch April 13, 2023 15:05
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.

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2023
@tekton-robot tekton-robot merged commit fbdb75c into tektoncd:main Apr 14, 2023
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesnt merit a release note. labels Nov 8, 2023
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 Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PipelineResourceResult Renamed and Moving off resource_types
5 participants