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

[TEP074] Remove PipelineResourceResultType of PipelineResourceResult Struct #6198

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Feb 21, 2023

Changes

PipelineResourceResult Struct is a blocker for the cleanup of PipelineResource.

PipelineResourceResult Struct was first introduced just to write digest as results for image resources but over the time,
generalized to take in more results. But it really is just an abstraction of TaskrunResult, ResourceResult and InternalTektonResult. And since now the pipelineResources is going to be removed, it is no longer going to be living in the apis as in resource_types we would need to move it off the apis and rename it.

  • It removes the pipelineResourceResultType since pipelineResources are
    going to be removed

Part of: #6197

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
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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 21, 2023
@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/apis/pipeline/v1/result_types.go 100.0% 6.7% -93.3
pkg/apis/pipeline/v1beta1/resource_types.go 86.0% 58.1% -27.9
pkg/pod/status.go 90.9% 90.8% -0.0

@JeromeJu
Copy link
Member Author

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label Feb 21, 2023
@JeromeJu JeromeJu marked this pull request as ready for review February 21, 2023 22:11
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 21, 2023
@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/apis/pipeline/v1/result_types.go 100.0% 6.7% -93.3
pkg/apis/pipeline/v1beta1/resource_types.go 86.0% 89.3% 3.2
pkg/apis/pipeline/v1beta1/result_types.go 100.0% 81.2% -18.8

@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/v1/result_types.go 100.0% 6.7% -93.3
pkg/apis/pipeline/v1beta1/resource_types.go 86.0% 89.3% 3.2
pkg/apis/pipeline/v1beta1/result_types.go 100.0% 81.2% -18.8

@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/apis/pipeline/v1/result_types.go 100.0% 6.7% -93.3
pkg/apis/pipeline/v1beta1/resource_types.go 86.0% 89.3% 3.2
pkg/apis/pipeline/v1beta1/result_types.go 100.0% 81.2% -18.8

@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/v1/result_types.go 100.0% 6.7% -93.3
pkg/apis/pipeline/v1beta1/resource_types.go 86.0% 89.3% 3.2
pkg/apis/pipeline/v1beta1/result_types.go 100.0% 81.2% -18.8

@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/apis/pipeline/v1/result_types.go 100.0% 6.7% -93.3
pkg/apis/pipeline/v1beta1/resource_types.go 86.0% 89.3% 3.2
pkg/apis/pipeline/v1beta1/result_types.go 100.0% 81.2% -18.8

@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/resource_types.go 86.0% 89.3% 3.2
pkg/pod/status.go 90.9% 90.8% -0.0
pkg/termination/write.go 70.0% 41.2% -28.8

@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/apis/pipeline/v1beta1/resource_types.go 86.0% 89.3% 3.2
pkg/pod/status.go 90.9% 90.8% -0.0
pkg/termination/write.go 70.0% 41.2% -28.8

@JeromeJu JeromeJu changed the title [WIP] migrate pipelineResourceResult Migrate pipelineResourceResult Feb 22, 2023
@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 Feb 22, 2023
@JeromeJu JeromeJu changed the title Migrate pipelineResourceResult Migrate PipelineResourceResult Feb 22, 2023
@JeromeJu
Copy link
Member Author

/retest

@JeromeJu
Copy link
Member Author

JeromeJu commented Mar 8, 2023

Thanks for the reviews and comments.
Instead of migrating the PipelineResourceResult struct and renaming it in the same PR. This PR now intends to break things down by removing PipelineResourceResultType only so as to be the least confusing as possible. PTAL 🙏

This commit removes the PipelineResourceResultType of
PipelineResourceResult Struct given now the PipelineResources have been
removed.
@JeromeJu JeromeJu force-pushed the remove-resource-result-type branch from 903a4eb to aa6cfe8 Compare March 8, 2023 21:53
@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/resource_types.go 80.0% 85.7% 5.7
pkg/pod/status.go 90.9% 90.8% -0.0

@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/apis/pipeline/v1beta1/resource_types.go 80.0% 85.7% 5.7
pkg/pod/status.go 90.9% 90.8% -0.0

pkg/apis/pipeline/v1beta1/resource_types.go Show resolved Hide resolved
@@ -290,8 +290,6 @@ func filterResultsAndResources(results []v1beta1.PipelineResourceResult, specRes
case v1beta1.InternalTektonResultType:
// Internal messages are ignored because they're not used as external result
continue
case v1beta1.PipelineResourceResultType:
Copy link
Member

Choose a reason for hiding this comment

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

This function can be simplified now. The first return value is any TaskRunResults, the second value is any PipelineResourceResults of type PipelineResourceResultType or UnknownResultType, and the third return value is all PipelineResourceResults that aren't InternalTektonResultTypes.

I'm not sure UnknownResourceTypes are actually used anywhere. It might be simpler to just have one function that filters a list of PipelineResourceResults and returns any that are of type TaskRunResultType, and another function that turns those results into TaskRunResults.

Please also add a docstring.

Copy link
Member

Choose a reason for hiding this comment

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

On second thought I think this can happen separately.

@@ -290,8 +290,6 @@ func filterResultsAndResources(results []v1beta1.PipelineResourceResult, specRes
case v1beta1.InternalTektonResultType:
// Internal messages are ignored because they're not used as external result
continue
case v1beta1.PipelineResourceResultType:
Copy link
Member

Choose a reason for hiding this comment

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

On second thought I think this can happen separately.

@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 approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note-none Denotes a PR that doesnt merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 10, 2023
@JeromeJu
Copy link
Member Author

JeromeJu commented Mar 10, 2023

I do appreciate the time PLUS guidance on this @lbernick 😃

And to put the above pointers in a summary, on the next step:

  • Refactor filterResults func
  • Migrate git-init image off PipelineResourceResult to TaskRunResult
    ^^ above 2 could happen in parallel
  • Tombstone ResourcesResult

@lbernick
Copy link
Member

I do appreciate the time PLUS guidance on this @lbernick 😃

And to put the above pointers in a summary, on the next step:

  • Refactor filterResults func
  • Migrate git-init image off PipelineResourceResult to TaskRunResult
    ^^ above 2 could happen in parallel
  • Tombstone ResourcesResult

yeah that sgtm, I'd focus on the changes needed for removing pipelineresources-- I started poking around with a readability refactor to status.go

@Yongxuanzhang
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2023
@JeromeJu
Copy link
Member Author

/test pull-tekton-pipeline-alpha-integration-tests

@tekton-robot tekton-robot merged commit bb8068f into tektoncd:main Mar 10, 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-none Denotes a PR that doesnt merit a release note. 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.

7 participants