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

Refactor the Storage resource interface to remove a type switch state… #1135

Merged
merged 1 commit into from
Jul 30, 2019

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Jul 30, 2019

…ment.

Changes

Right now the upload phase for artifacts needs to behave differently between
normal resources and storage (GCS, BuildGCS) resources, leading to type switches
in this code.

This refactor moves that logic up into the normal Resource interface, allowing the
logic to remain uniform between the two resource types.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

…ment.

Right now the upload phase for artifacts needs to behave differently between
normal resources and storage (GCS, BuildGCS) resources, leading to type switches
in this code.

This refactor moves that logic up into the normal Resource interface, allowing the
logic to remain uniform between the two resource types.
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jul 30, 2019
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlorenc

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 30, 2019
@dlorenc
Copy link
Contributor Author

dlorenc commented Jul 30, 2019

This will help out with #1087 and the other resource refactors going on.

Ref #1076

@abayer
Copy link
Contributor

abayer commented Jul 30, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2019
@tekton-robot
Copy link
Collaborator

The following is the coverage report on pkg/.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1alpha1/build_gcs_resource.go 83.3% 81.4% -1.9
pkg/apis/pipeline/v1alpha1/cluster_resource.go 75.7% 73.7% -2.0
pkg/apis/pipeline/v1alpha1/gcs_resource.go 88.2% 85.7% -2.5
pkg/apis/pipeline/v1alpha1/pull_request_resource.go 81.0% 77.3% -3.7
pkg/apis/pipeline/v1alpha1/storage_resource.go 100.0% 45.0% -55.0
pkg/reconciler/v1alpha1/taskrun/resources/output_resource.go 89.9% 91.8% 2.0

@tekton-robot tekton-robot merged commit 74bfcd4 into tektoncd:master Jul 30, 2019
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Jul 31, 2019
…ment.

This change refactors the way input resources attach volumes to their steps.
Previously, there was a special-cased switch statement for Storage type resources.
This made the logic for resources hard to follow, and spread across the codebase. This
change refactors that by moving it up into the general Resource interface.

This is another follow-on to tektoncd#1135
dlorenc added a commit to dlorenc/build-pipeline that referenced this pull request Jul 31, 2019
…ment.

This change refactors the way input resources attach volumes to their steps.
Previously, there was a special-cased switch statement for Storage type resources.
This made the logic for resources hard to follow, and spread across the codebase. This
change refactors that by moving it up into the general Resource interface.

This is another follow-on to tektoncd#1135
tekton-robot pushed a commit that referenced this pull request Jul 31, 2019
…ment.

This change refactors the way input resources attach volumes to their steps.
Previously, there was a special-cased switch statement for Storage type resources.
This made the logic for resources hard to follow, and spread across the codebase. This
change refactors that by moving it up into the general Resource interface.

This is another follow-on to #1135
@bobcatfish
Copy link
Collaborator

yussssssss

@bobcatfish
Copy link
Collaborator

hm but it looks like all the coverage went down

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. cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants