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 Git PipelineResources #6135

Closed
wants to merge 1 commit into from

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Feb 8, 2023

This is targeted to be the last PR for the removal of PipelineResources along with the removal of generic pipelineresources functions.

Changes

This commit removes the Git pipelineResources, it removes github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/git and the corresponding test cases.

The coverage drops are expected as it is one of the last few PRs for removing the resources.

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

action required: please migrate off of `git` `pipelineresources` as it is removed, please refer to the doc at https://github.com/tektoncd/pipeline/blob/main/docs/pipelineresources.md#replacing-an-git-resource

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Feb 8, 2023
@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 8, 2023
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign dibyom after the PR has been reviewed.
You can assign the PR to them by writing /assign @dibyom in a comment when ready.

The full list of commands accepted by this bot can be found 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

@JeromeJu
Copy link
Member Author

JeromeJu commented Feb 8, 2023

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label Feb 8, 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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.7

@tekton-robot tekton-robot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note-none Denotes a PR that doesnt merit a release note. labels Feb 9, 2023
@JeromeJu JeromeJu changed the title Remove Git PipelineResources [TEP074] Remove Git PipelineResources Feb 9, 2023
This commit removes the `Git` pipelineResources, it removes
`github.com/tektoncd/pipeline/pkg/apis/resource/v1alpha1/git` and the
corresponding test cases.
@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/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.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/reconciler/pipelinerun/pipelinerun.go 87.2% 86.5% -0.8
pkg/reconciler/pipelinerun/resources/input_output_steps.go 96.9% 84.4% -12.5
pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go 94.9% 94.7% -0.3
pkg/reconciler/taskrun/resources/taskresourceresolution.go 100.0% 89.5% -10.5
pkg/reconciler/taskrun/taskrun.go 84.5% 83.8% -0.7
pkg/reconciler/taskrun/validate_resources.go 98.5% 97.8% -0.7

var validResource = v1beta1.TaskResource{
ResourceDeclaration: v1beta1.ResourceDeclaration{
Name: "validsource",
Type: "git",
Copy link
Member

Choose a reason for hiding this comment

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

technically it would be better to replace this with the image resource as you've done elsewhere (aligns better with our code standards on always being in a releasable state)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, I was also debating this to see what would be a best solution since we are going to be in a stage where all the resourceTypes are removed before we start to remove the generic resourceTypes functions. Does that mean the removal of the last resourceTypes should also include the removal of the generic functions? But until then we need to change them all to the very last resource type?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the answer offline with Lee.

I am hoping to put this PR as the last removal along with the generic functions of PipelineResources eg. inputresources etc.

Copy link
Member

Choose a reason for hiding this comment

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

It might make sense to put a hold on this pr or mark it as a draft in that case

@@ -469,31 +173,6 @@ func TestCleanupArtifactStorage(t *testing.T) {
}
}

func TestInitializeArtifactStorageWithoutConfigMap(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

is the function InitializeArtifactStorage deleted somewhere?

@@ -1103,19 +1086,6 @@ func TestApplyResources(t *testing.T) {
spec.Steps[8].Image = "/foo/builtImage"
spec.Steps[9].Image = "/workspace/foo/builtImage"
}),
}, {
name: "input resource specified",
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 this is OK to delete fully because despite the test name it's really a test for the git pipelineresource mutations it looks like

gcsInputs = []v1beta1.TaskResource{{
ResourceDeclaration: v1beta1.ResourceDeclaration{
Name: "workspace",
Type: "gcs",
TargetPath: "gcs-dir",
}}}
multipleGcsInputs = []v1beta1.TaskResource{
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 restored?

Comment on lines -749 to -792
}, {
desc: "invalid gcs resource type name",
task: task,
taskRun: &v1beta1.TaskRun{
ObjectMeta: metav1.ObjectMeta{
Name: "get-from-invalid-gcs",
Namespace: "marshmallow",
},
Spec: v1beta1.TaskRunSpec{
Resources: &v1beta1.TaskRunResources{
Inputs: []v1beta1.TaskResourceBinding{{
PipelineResourceBinding: v1beta1.PipelineResourceBinding{
ResourceRef: &v1beta1.PipelineResourceRef{
Name: "storage-gcs-invalid",
},
Name: "workspace",
},
}},
},
},
},
wantErr: true,
}, {
desc: "invalid gcs resource type name",
task: task,
taskRun: &v1beta1.TaskRun{
ObjectMeta: metav1.ObjectMeta{
Name: "get-from-invalid-gcs",
Namespace: "marshmallow",
},
Spec: v1beta1.TaskRunSpec{
Resources: &v1beta1.TaskRunResources{
Inputs: []v1beta1.TaskResourceBinding{{
PipelineResourceBinding: v1beta1.PipelineResourceBinding{
ResourceRef: &v1beta1.PipelineResourceRef{
Name: "storage-gcs-invalid",
},
Name: "workspace",
},
}},
},
},
},
wantErr: true,
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 restored?

},
},
}
taskWithMultipleGcsInputs := &v1beta1.Task{
Copy link
Member

Choose a reason for hiding this comment

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

curious why this PR deletes a lot of GCS tests?

Name: "git-repo",
},
ResourceSpec: &resourcev1alpha1.PipelineResourceSpec{
Type: resourcev1alpha1.PipelineResourceTypeGit,
Copy link
Member

Choose a reason for hiding this comment

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

I'd swap to a different resource type here

@JeromeJu
Copy link
Member Author

/hold
This will be the last removal of pipelineResources along with the generic functions.

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 10, 2023
@JeromeJu
Copy link
Member Author

Closing as #6150 supersedes this PR

@JeromeJu JeromeJu closed this Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/misc Categorizes issue or PR as a miscellaneuous one. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. 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.

3 participants