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

Support context variable replacements in custom tasks #6620

Merged
merged 1 commit into from
May 18, 2023

Conversation

EmmaMunley
Copy link
Contributor

@EmmaMunley EmmaMunley commented May 4, 2023

Changes

This PR adds support for context variable replacements, allowing users to define context variables in inline pipeline specs for custom tasks. Prior to this PR, context variable replacements were only supported for non-custom tasks.

/kind bug

Submitter Checklist

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

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • 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). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

A user can now define context variables in inline pipeline specs for custom tasks.

@tekton-robot tekton-robot added kind/bug Categorizes issue or PR as related to a bug. release-note-none Denotes a PR that doesnt merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 4, 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/resources/apply.go 98.1% 98.1% 0.0

@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/resources/apply.go 98.1% 98.1% 0.0

@EmmaMunley
Copy link
Contributor Author

There seems to be a flake with the git-resolver pipeline-integration-test which I've filed an issue for here: #6626

/retest

@jerop jerop self-assigned this May 10, 2023
@EmmaMunley EmmaMunley force-pushed the apply-pt-task-contexts branch from 43c2625 to 07da08d Compare May 12, 2023 20:00
@tekton-robot tekton-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 12, 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 89.2% 89.2% 0.0

@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 89.2% 89.2% 0.0

Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

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

please add a test where a custom task uses context variables to ensure they are replaced 🙏🏾

@EmmaMunley EmmaMunley force-pushed the apply-pt-task-contexts branch from 07da08d to cc8cca4 Compare May 15, 2023 20:32
@EmmaMunley
Copy link
Contributor Author

please add a test where a custom task uses context variables to ensure they are replaced 🙏🏾

@jerop Added a context param for Custom Tasks in testing.

@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 89.2% 89.2% 0.0

@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 89.2% 89.2% 0.0

@jerop
Copy link
Member

jerop commented May 15, 2023

Error: error processing import paths in "config/webhook.yaml": error resolving image references: GET https://cgr.dev/token?scope=repository%3Achainguard%2Fstatic%3Apull&service=cgr.dev: FORBIDDEN: Forbidden

/retest

@EmmaMunley EmmaMunley requested a review from jerop May 16, 2023 16:33
Copy link
Member

@jerop jerop left a comment

Choose a reason for hiding this comment

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

Thanks @EmmaMunley!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerop

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 May 16, 2023
@jerop
Copy link
Member

jerop commented May 16, 2023

@EmmaMunley please update the docs to indicate that custom tasks do take context variables - https://github.com/tektoncd/pipeline/blob/main/docs/pipelines.md#using-custom-tasks

@EmmaMunley EmmaMunley force-pushed the apply-pt-task-contexts branch from cc8cca4 to b22f171 Compare May 16, 2023 19:15
@tekton-robot tekton-robot removed the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 16, 2023
@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 16, 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 89.2% 89.2% 0.0

@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 89.2% 89.2% 0.0

@EmmaMunley EmmaMunley force-pushed the apply-pt-task-contexts branch from b22f171 to 32b2180 Compare May 16, 2023 21:24
@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 89.2% 89.2% 0.0

@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 89.2% 89.2% 0.0

Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

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

It seems like this is a user facing bug fix; i.e. we now support context variable replacement in custom tasks in inline pipeline specs. Can you please focus the commit message and PR title more on the user impact? I found it hard to understand from the title/description what the changes were and why they were being made. This also needs a release note.

This commit enables adds support for context variable replacements, allowing
users to  define context variables in inline pipeline specs for custom tasks. Prior to this, context variable replacements were only supported for non-custom tasks.
@EmmaMunley EmmaMunley force-pushed the apply-pt-task-contexts branch from 32b2180 to f9d66ae Compare May 17, 2023 15:28
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesnt merit a release note. labels May 17, 2023
@EmmaMunley EmmaMunley changed the title Update ApplyPipelineTaskContexts to include CustomTasks Support context variable replacements in custom tasks May 17, 2023
@EmmaMunley EmmaMunley requested a review from lbernick May 17, 2023 15:31
@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 89.2% 89.2% 0.0

@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 89.2% 89.2% 0.0

@lbernick
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 17, 2023
@tekton-robot
Copy link
Collaborator

@EmmaMunley: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-beta-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/retest CI #6680

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.

@EmmaMunley
Copy link
Contributor Author

/retest
#6680

@tekton-robot tekton-robot merged commit de0ee3b into tektoncd:main May 18, 2023
@EmmaMunley EmmaMunley deleted the apply-pt-task-contexts branch May 18, 2023 15:29
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/bug Categorizes issue or PR as related to a bug. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants