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

Disable implicit param behavior for Pipeline objects. #4511

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

wlynch
Copy link
Member

@wlynch wlynch commented Jan 24, 2022

Changes

We received feedback that the implicit param implementation has behavior that
some users found unexpected - primarily, that the implicit behavior modifying
Pipelines on admission. This change disables the implicit behavior for Pipelines,
but keeps the PipelineRun and TaskRun behavior in place.

This is implemented by introducing a new context variable, similar to
the existing Alpha context behavior, that is only enabled on
PipelineRun/TaskRun reconcile. This allows for minimally invasive
changes while giving us the flexibility to revert this behavior or
enable in other contexts such as during reconcile.

On top of this:

  • Moves implicit param tests to their own file, adds test for Pipeline
    to cover the behavior in question.
  • Fixes bug with param context key using var struct{} instead of type
    struct{} -> using var associates the value to any key of struct{},
    whereas type struct{} creates a new type that can be used by only that
    key. There's no indication that this was causing problems before.

/kind misc

Fixes #4388

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in or deleted (only if no user facing changes)

Release Notes

[alpha only]: Implicit parameters now only affect PipelineRuns and TaskRuns (notably removes behavior for Pipelines). We are actively collecting feedback around this feature, so please let us know if this is disruptive!

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/misc Categorizes issue or PR as a miscellaneuous one. labels Jan 24, 2022
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 24, 2022
@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/param_context.go 98.3% 98.4% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_defaults.go 93.3% 94.1% 0.8

We recently received feedback that the implicit param behavior
implementation was not quite implemented as expected in the TEP -
primarily, that the implicit behavior modifying Pipelines on admission
was unexpected. As a short term measure, this change disables the
implicit behavior for Pipelines, but keeps the PipelineRun and TaskRun
behavior in place.

This is implemented by introducing a new context variable, similar to
the existing Alpha context behavior, that is only enabled on
PipelineRun/TaskRun reconcile. This allows for minimially invasive
changes while giving us the flexibility to revert this behavior or
enable in other contexts such as during reconcile.

On top of this:
- Moves implicit param tests to their own file, adds test for Pipeline
to cover the behavior in question.
- Fixes bug with param context key using var struct{} instead of type
struct{} -> using var associates the value to any key of struct{},
whereas type struct{} creates a new type that can be used by only that
key. There's no indication that this was causing problems before.
@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/param_context.go 98.3% 98.4% 0.1
pkg/apis/pipeline/v1beta1/pipelinerun_defaults.go 93.3% 94.1% 0.8

@ghost ghost added the needs-cherry-pick Indicates a PR needs to be cherry-pick to a release branch label Jan 25, 2022
@ghost ghost added this to the Pipelines v0.32 milestone Jan 25, 2022
@ghost
Copy link

ghost commented Jan 25, 2022

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

@ghost
Copy link

ghost commented Jan 26, 2022

/lgtm

Thanks @wlynch !

@tekton-robot tekton-robot assigned ghost Jan 26, 2022
@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2022
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2022
@tekton-robot tekton-robot merged commit 4186dc9 into tektoncd:main Jan 26, 2022
@ghost ghost removed the needs-cherry-pick Indicates a PR needs to be cherry-pick to a release branch label Feb 4, 2022
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 Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Params copied in all steps in saved pipeline in alpha mode on Openshift with tekton 0.29+
4 participants