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

Make PipelineSpec/PipelineRef in PipelineRun consistent with TaskRun #1495

Merged

Conversation

vdemeester
Copy link
Member

Changes

In TaskRun, TaskRef can be nil, which was not the case for
PipelineRun (and PipelineRef). This fixes that by making the two consistent.

Note that we could do the opposite (aka change how it works in TaskRun).

Signed-off-by: Vincent Demeester vdemeest@redhat.com

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.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

@googlebot googlebot added the cla: yes Trying to make the CLA bot happy with ppl from different companies work on one commit label Oct 30, 2019
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 30, 2019
@vdemeester vdemeester force-pushed the taskref-pipelineref-consistency branch from c6c149e to ee162e2 Compare October 30, 2019 09:22
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

// Check that one of PipelineRef and PipelineSpec is present
if ps.PipelineRef.Name == "" && ps.PipelineSpec == nil {
return apis.ErrMissingField("spec.pipelineRef.name", "spec.pipelineSpec")
// Check that one of PipelineRef and TaskSpec is present
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be PipelineSpec?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oups =)

}

// Validate PipelineSpec if it's present
// Validate TaskSpec if it's present
Copy link
Member

Choose a reason for hiding this comment

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

PipelineSpec?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oups =)

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 30, 2019
@vdemeester vdemeester force-pushed the taskref-pipelineref-consistency branch from ee162e2 to b0cd520 Compare October 30, 2019 10:39
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

1 similar comment
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@bobcatfish
Copy link
Collaborator

I think this might solve #1498 ?

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.

Thanks for the cleanup @vdemeester !

/approve
/lgtm

image

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish, dibyom

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

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-test

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-test

@vdemeester
Copy link
Member Author

/hold
Might be a legit failure… got twice the same error…

@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 Oct 30, 2019
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/hold cancel
/test pull-tekton-pipeline-integration-tests

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 31, 2019
@dibyom
Copy link
Member

dibyom commented Oct 31, 2019

I1031 13:41:09.704] ERROR: tests timed out

Looks like YAML tests are timing out?

@vdemeester
Copy link
Member Author

@dibyom yeah, the cloud-event yaml test is wanking since a few days… not sure why, @afrittoli is looking to update it with sidecars

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Heh, I guess this is because TaskRef can be replaced by a TaskSpec.

Thanks for the cleanup!

@@ -5402,6 +5402,33 @@ Import: github.com/tektoncd/pipeline/vendor/github.com/modern-go/reflect2



===========================================================
Copy link
Member

Choose a reason for hiding this comment

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

uh? why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

@afrittoli not sure, ran ./hack/update-codegen.sh and it added that 😓

@afrittoli
Copy link
Member

This will close #1498

@afrittoli
Copy link
Member

/test pull-tekton-pipeline-integration-tests

7 similar comments
@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@pritidesai
Copy link
Member

thanks for these changes
/lgtm

@vdemeester
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@vdemeester vdemeester force-pushed the taskref-pipelineref-consistency branch from b0cd520 to 013c8ab Compare November 5, 2019 10:20
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2019
In TaskRun, TaskRef can be nil, which was not the case for
PipelineRun (and PipelineRef). This fixes that by making the two consistent.

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
@vdemeester vdemeester force-pushed the taskref-pipelineref-consistency branch from 013c8ab to 19070c7 Compare November 5, 2019 10:37
ctx, err := tag.New(
context.Background(),
tag.Insert(r.pipeline, pr.Spec.PipelineRef.Name),
Copy link
Member Author

Choose a reason for hiding this comment

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

The failure was legit 😅 this was putting the controller in a crashloop 😝

@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/pipelinerun/metrics.go 86.0% 86.8% 0.8

@abayer
Copy link
Contributor

abayer commented Nov 5, 2019

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2019
@tekton-robot tekton-robot merged commit f15a0f3 into tektoncd:master Nov 5, 2019
@vdemeester vdemeester deleted the taskref-pipelineref-consistency branch November 5, 2019 14:18
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants