Skip to content

Add support for tekton.dev/v1 Task and Pipeline types#75

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
vdemeester:add-v1-types-support
Jul 3, 2026
Merged

Add support for tekton.dev/v1 Task and Pipeline types#75
tekton-robot merged 1 commit into
tektoncd:mainfrom
vdemeester:add-v1-types-support

Conversation

@vdemeester

Copy link
Copy Markdown
Member

Changes

Adds support for validating and linting tekton.dev/v1 resources, while keeping full backward compatibility with tekton.dev/v1beta1.

Fixes #10

catlin was hard-wired to v1beta1. This PR:

  • pkg/parser: registers both the v1 and v1beta1 schemes, accepts both API group versions, and normalizes parsed resources to v1 types. Since the fields catlin inspects (Step.Image/Env/EnvFrom/Script, Task.Spec.Steps) are identical across versions, v1beta1 resources are decoded straight into v1 types.
  • pkg/validator: task validator now operates on v1.Task / v1.Step.
  • pkg/linter: script linter now operates on v1.Task / v1.Step.

ClusterTask was already removed upstream and from catlin, so no work was needed there. The dependency is already on tektoncd/pipeline v1.4.0, which ships the v1 API, so no further dependency bumps were required.

Adds v1 fixtures and tests for the parser, validator, linter and the validate command; existing v1beta1 tests are retained to prove backward compatibility.

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)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Add support for validating and linting `tekton.dev/v1` Task and Pipeline resources.

catlin was hard-wired to v1beta1. Register both v1 and v1beta1 schemes
in the parser, normalize parsed resources to v1 types, and switch the
task validator and script linter to v1.Step/v1.Task. Since the fields
catlin inspects are identical across versions, v1beta1 resources are
decoded straight into v1 types, keeping full backward compatibility.

Adds v1 fixtures and tests for the parser, validator, linter and the
validate command.

Fixes tektoncd#10
@tekton-robot tekton-robot requested review from chmouel and sm43 July 3, 2026 09:17
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 3, 2026
@vdemeester vdemeester added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 3, 2026
@vdemeester vdemeester requested a review from Copilot July 3, 2026 09:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds tekton.dev/v1 support across parsing, validation, and linting while preserving existing tekton.dev/v1beta1 behavior by registering both schemes and normalizing typed decoding to v1 objects.

Changes:

  • Register both Tekton v1 and v1beta1 schemes and accept either GVK during parsing; normalize typed conversions to v1 Task/Pipeline.
  • Update task validation and script linting to operate on v1.Task / v1.Step.
  • Add v1 fixtures/tests for validator, linter, and the validate command testdata.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/parser/parser.go Registers both schemes and treats both v1/v1beta1 as Tekton resources while normalizing typed objects to v1.
pkg/validator/task_validator.go Switches task validation to tekton.dev/v1 Task/Step types.
pkg/validator/task_validator_test.go Adds tekton.dev/v1 Task validation test coverage alongside existing v1beta1 tests.
pkg/linter/script.go Switches script linter to tekton.dev/v1 Task/Step types.
pkg/linter/script_test.go Adds tekton.dev/v1 script-lint fixture/test.
pkg/cmd/validate/validate_test.go Extends validate command tests to include a tekton.dev/v1 task path.
pkg/cmd/validate/testdata/task/v1-hello/0.1/v1-hello.yaml Adds a minimal tekton.dev/v1 Task fixture for validate command tests.
Comments suppressed due to low confidence (1)

pkg/linter/script.go:100

  • validateScript slices s.Script with fixed indexes (e.g. s.Script[0:2], s.Script[0:14]) without checking length, which can panic for short scripts such as "#!/bin/sh\n...". Use strings.HasPrefix instead of slicing to make this safe.
	// use /bin/sh by default if no shbang
	if s.Script[0:2] != "#!" {
		s.Script = "#!/usr/bin/env sh\n" + s.Script
	} else { // using a shbang, check if we have /usr/bin/env
		if s.Script[0:14] != "#!/usr/bin/env" {
			result.Warn("step: %s is not using #!/usr/bin/env ", taskName)
		}
	}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chmouel

chmouel commented Jul 3, 2026

Copy link
Copy Markdown
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 3, 2026
@chmouel

chmouel commented Jul 3, 2026

Copy link
Copy Markdown
Member

/approve

@divyansh42 divyansh42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot

Copy link
Copy Markdown

@divyansh42: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

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.

@vdemeester vdemeester added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 3, 2026
@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: chmouel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 merged commit 6005983 into tektoncd:main Jul 3, 2026
5 checks passed
@vdemeester vdemeester deleted the add-v1-types-support branch July 3, 2026 10:01
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/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. 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.

Add support for v1 Types

5 participants