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

V1: Add conversion for TaskRunSpec.TaskRef.Bundle #5381

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

JeromeJu
Copy link
Member

@JeromeJu JeromeJu commented Aug 25, 2022

This commit adds support for TaskRef.Bundle when converting between
v1beta1 and v1 versions of TaskRef. This allows us to release v1 TaskRun
in a backwards compatible way by ensuring that v1beta1 TaskRuns and
PipelineRuns with Bundle converted to v1 TaskRuns conversion.

part of #4985
/kind misc

Changes

Submitter Checklist

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

  • [n/a] 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
  • [n/a] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • [n/a] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 25, 2022
@JeromeJu JeromeJu changed the title V1: Add conversion for TaskRef.Bundle V1: Add conversion for TaskRun.spec.TaskRef.bundle Aug 25, 2022
@JeromeJu JeromeJu changed the title V1: Add conversion for TaskRun.spec.TaskRef.bundle V1: Add conversion for TaskRunSpec.TaskRef.Bundle Aug 25, 2022
@JeromeJu JeromeJu mentioned this pull request Aug 25, 2022
4 tasks
@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/taskrun_conversion.go 96.0% 93.9% -2.2

@Yongxuanzhang
Copy link
Member

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label Aug 25, 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/taskrun_conversion.go 93.9% 92.2% -1.7

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.

Instead of serializing/deserializing to metadata, we should instead convert this to a remote reference w/ the bundle resolver, since the bundle resolver will be packaged with pipelines. The reason is that we still need to support v1beta1 for 9 months, but we'd like to swap our stored version to v1 as soon as we can. When we swap the stored version to v1 and use it in the reconciler, it's way easier to use the existing functionality for remote resolution than it is to deserialize the bundle reference from annotations.

@lbernick
Copy link
Member

I'm not sure though if there's a good way to parse the name to pass to the resolver from the bundle string name (i.e. if we can assume the image name works here). maybe @vdemeester can comment on whether that would work?

@vdemeester
Copy link
Member

Instead of serializing/deserializing to metadata, we should instead convert this to a remote reference w/ the bundle resolver, since the bundle resolver will be packaged with pipelines. The reason is that we still need to support v1beta1 for 9 months, but we'd like to swap our stored version to v1 as soon as we can. When we swap the stored version to v1 and use it in the reconciler, it's way easier to use the existing functionality for remote resolution than it is to deserialize the bundle reference from annotations.

I am not sure that I agree with this too much or not 😅, mainly because we don't have any precedent yet on this (we never really converted to new features before). But it's probably fine.

I'm not sure though if there's a good way to parse the name to pass to the resolver from the bundle string name (i.e. if we can assume the image name works here). maybe @vdemeester can comment on whether that would work?

I am not sure I understand this question, it should be straightforward. Today we have the following…

taskRef:
  bundle: foo.bar/baz # image reference
  name: taskName

… that translates to …

taskRef:
  resolver: bundles
  params:
  - name: bundle
    value: foo.bar/baz
  - name: name
    value: taskName
  - name: kind
    value: Task

The kind param should be straightforward to get from the code, the rest is the same.

@lbernick
Copy link
Member

thanks! I didn't realize the taskName was the same for both-- this sounds good.

@JeromeJu
Copy link
Member Author

JeromeJu commented Aug 29, 2022

Thanks @lbernick and @vdemeester for the guidance and the discussion.

I would like to confirm, so we don't need to parse or validate the image/bundle name essentially. Instead, will it be sufficient converting to the following configurations?

@lbernick
Copy link
Member

Yes, the bundle fields can be passed into taskRef.params without parsing or additional validation.

@JeromeJu JeromeJu force-pushed the 4985-bundle branch 3 times, most recently from d3e040a to 6769f29 Compare September 8, 2022 12:05
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 8, 2022
@tekton-robot tekton-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 8, 2022
@JeromeJu JeromeJu force-pushed the 4985-bundle branch 2 times, most recently from a74570f to 5dc43cf Compare September 8, 2022 20:15
@JeromeJu JeromeJu requested review from lbernick and abayer and removed request for pritidesai, afrittoli, lbernick and abayer September 8, 2022 20:21
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.

thanks Jerome!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lbernick

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 Sep 12, 2022
This commit adds support for TaskRef.Bundle when converting between
v1beta1 and v1 versions of TaskRef. This allows us to release v1 TaskRun
and PipelineRun in a backwards compatible way by ensuring that v1beta1
TaskRuns and PipelineRuns with Bundle converted into ResolverRef and
params on the v1 TaskRuns and PipelineRuns on conversion.
@abayer
Copy link
Contributor

abayer commented Sep 13, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 13, 2022
@tekton-robot tekton-robot merged commit 2ab7fa9 into tektoncd:main Sep 13, 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-none Denotes a PR that doesnt merit a release note. 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.

6 participants