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

Disallow the Cluster and Git resource types as Output resources. #1109

Closed
wants to merge 1 commit into from

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Jul 22, 2019

Changes

The cluster type currently has no defined behavior as output resources, and
the git type behaves incorrectly. The new Volume type should be used instead
for the use-cases supported by the old Git resource.

This is part of the large cleanup in #1076, and should not be submitted until
after #1087.

Submitter Checklist

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

Release Notes

The Git and Cluster PipelineResource types can no longer be used as an Output resource.
To replace the Git type, please use the Volume type. The Cluster type previously had no effect, so simply remove it as an Output.

The cluster type currently has no defined behavior as output resources, and
the git type behaves incorrectly. The new Volume type should be used instead
for the use-cases supported by the old Git resource.

This is part of the large cleanup in tektoncd#1076, and should not be submitted until
after tektoncd#1087.
@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Jul 22, 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 22, 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/reconciler/v1alpha1/taskrun/taskrun.go 71.0% 71.3% 0.3

@dlorenc dlorenc mentioned this pull request Jul 22, 2019
1 task
@tekton-robot
Copy link
Collaborator

@dlorenc: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-tekton-pipeline-integration-tests 19bc550 link /test pull-tekton-pipeline-integration-tests

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@bobcatfish
Copy link
Collaborator

bobcatfish commented Jul 23, 2019

🎉 I am excited to get this ball rolling!! 🎉

imo this counts as a backwards incompatible change, in which case I think we'd want to do something like:

  1. warn in logs when ppl use git as an output
  2. make sure we get the new volume type into this release
  3. make it pretty clear in the working group that we're doing this
  4. only actually remove in the next release (or even the one after)

I think (as you're seeing in the test failures) that it might be impossible to do input output linking in our tests with out this? (i think to use GCS we would need to surmount #821 🤔🤔🤔

Also need to update:

(I'm definitely for doing this in the long run! I think this is gonna be a pretty disruptive change to anyone using linking tho since using a git output was pretty much the go-to way to do this)

@abayer
Copy link
Contributor

abayer commented Jul 23, 2019

I agree with @bobcatfish - Jenkins X's pipelines all utilize git as output, e.g., so a transition period is needed, even given that this states not to merge it until #1087 lands.

@abayer
Copy link
Contributor

abayer commented Jul 23, 2019

/hold

@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 Jul 23, 2019
@bobcatfish bobcatfish added the next-release For PRs that shouldn't be merged until the next release (backward incompatible) label Aug 12, 2019
Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

// ResourceFromType returns a PipelineResourceInterface from a PipelineResource's type.
func ResourceFromType(r *PipelineResource) (PipelineResourceInterface, error) {
// InputResourceFromType returns a PipelineResourceInterface from a PipelineResource's type.
func InputResourceFromType(r *PipelineResource) (PipelineResourceInterface, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

would it be crazy in Go to define a top level like map of types to New functions? e.g. something like:

PipelineResourceTypeGit: NewGitResource,
PipelineResourceTypeImage: NewImageResource,

If case statements are clearer, just ignore me

case PipelineResourceTypeCluster:
return NewClusterResource(r)
default:
return InputOutputResourceFromType(r)
Copy link
Collaborator

Choose a reason for hiding this comment

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

i found it confusing that the default for this function calls InputOutputResourceFromType - id find it a bit easier to see explicitly which types are allowed for input and output, and always default to an error

@bobcatfish bobcatfish added this to the Pipelines 0.7 🐱 milestone Aug 26, 2019
bobcatfish added a commit to bobcatfish/pipeline that referenced this pull request Sep 14, 2019
In tektoncd#1109 we will be removing support for git as an output. In the
current implementation, git as an output is just a volume that holds the
data from the git repo, and copies it between Tasks (when git as an
output is linked to git as an input). As discussed in tektoncd#1076, the model
we want for PipelineResources is for them to take the outside world and
represent it on disk when used as an input, and when used as an output,
to update the outside world. In order to do this, what we actually want for a
git output is for it to create a commit the repo it is referencing.
However up until this point folks have been using git resources in the
way that we want Volume Resources to behave tektoncd#1062, so we want to
transition folks to Volume Resources and away from using git outputs.

Fixes tektoncd#1283
@bobcatfish bobcatfish removed this from the Pipelines 0.8 🐱 milestone Oct 3, 2019
@bobcatfish
Copy link
Collaborator

@sbwsg and @dlorenc have a new design to propose for #1272 and #1076 which I think will make this change unnecessary since they are proposing overhauling the way we express these resources completely, so I'm going to close this PR for now, but we can re-open if we decide we want to keep making these incremental improvements to PipelineResources as they are today (see also #1062 (comment))

@bobcatfish bobcatfish closed this Oct 25, 2019
@bobcatfish
Copy link
Collaborator

p.s. I may open a PR to disallow cluster outputs anyway since that doesnt really make sense

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 do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. next-release For PRs that shouldn't be merged until the next release (backward incompatible) 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