Skip to content

chore: remove dead Test/TestSuite v3 code - #8019

Merged
vsukhin merged 3 commits into
mainfrom
vsukhin/fix/dead-crd
Aug 3, 2026
Merged

chore: remove dead Test/TestSuite v3 code#8019
vsukhin merged 3 commits into
mainfrom
vsukhin/fix/dead-crd

Conversation

@vsukhin

@vsukhin vsukhin commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Test and TestSuite (tests.testkube.io) are deprecated CRDs, retained only so existing cluster resources are not garbage-collected. Nothing serves or reconciles them: no API routes, no CLI commands, no controller, no client. This removes the surface that has no callers at all.

  • delete pkg/tcl/mappertcl/tests (no importers)
  • delete pkg/mapper/testworkflows/kube.go; all three roots (MapTestKubeToTestWorkflowKube, MapTestSuiteKubeToTestWorkflowKube, MapExecutorKubeToTestWorkflowTemplateKube) were unreferenced, leaving the whole file orphaned
  • drop the unused crd.Template consts and their .tmpl files, keeping webhook, webhooktemplate and testtrigger
  • drop vestigial testsuitev3/testsv3/testsourcev1 AddToScheme calls in pkg/triggers/watcher.go; no informer for those types exists
  • delete the typed tests/v2 and tests/v3 clientsets and their fakes. v2 was additionally broken: tests.testkube.io/v2 was never registered in the scheme builder, so any call would have failed at request time.

The CRDs, api/tests/v3 and api/testsuite/v3 are left untouched, along with the sub-types (Variable, ArtifactRequest, EnvReference, GitAuthType, ArgsModeType) that TestWorkflow v1 and TestTrigger v1 embed.

Pull request description

Checklist (choose whats happened)

  • breaking change! (describe)
  • tested locally
  • tested on cluster
  • added new dependencies
  • updated the docs
  • added a test

Breaking changes

Changes

Fixes

Test and TestSuite (tests.testkube.io) are deprecated CRDs, retained only so
existing cluster resources are not garbage-collected. Nothing serves or
reconciles them: no API routes, no CLI commands, no controller, no client.
This removes the surface that has no callers at all.

- delete pkg/tcl/mappertcl/tests (no importers)
- delete pkg/mapper/testworkflows/kube.go; all three roots
  (MapTestKubeToTestWorkflowKube, MapTestSuiteKubeToTestWorkflowKube,
  MapExecutorKubeToTestWorkflowTemplateKube) were unreferenced, leaving the
  whole file orphaned
- drop the unused crd.Template consts and their .tmpl files, keeping webhook,
  webhooktemplate and testtrigger
- drop vestigial testsuitev3/testsv3/testsourcev1 AddToScheme calls in
  pkg/triggers/watcher.go; no informer for those types exists
- delete the typed tests/v2 and tests/v3 clientsets and their fakes. v2 was
  additionally broken: tests.testkube.io/v2 was never registered in the
  scheme builder, so any call would have failed at request time.

The CRDs, api/tests/v3 and api/testsuite/v3 are left untouched, along with the
sub-types (Variable, ArtifactRequest, EnvReference, GitAuthType, ArgsModeType)
that TestWorkflow v1 and TestTrigger v1 embed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@testkube-dev

testkube-dev Bot commented Jul 26, 2026

Copy link
Copy Markdown

This is a summary headline

This is a really cool summary for you to look at, we have also included links to the Testkube Dashboard

View execution in Testkube

@vsukhin

vsukhin commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR removes unused legacy Test/TestSuite conversion, CRD-rendering, scheme-registration, and generated clientset surfaces while retaining the deprecated CRD definitions needed to preserve existing cluster resources.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains in the reviewed removal paths, and no eligible follow-up finding was identified.

Important Files Changed

Filename Overview
pkg/crd/crd.go Narrows CRD rendering to the webhook and trigger models that still have templates and active callers.
pkg/mapper/testworkflows/kube.go Removes the unreferenced legacy Test, TestSuite, and Executor conversion implementation.
pkg/operator/clientset/versioned/clientset.go Removes unused Test v2/v3 typed clients from the generated clientset surface.
pkg/operator/clientset/versioned/scheme/register.go Removes scheme registrations corresponding to the deleted Test v3 typed clients.
pkg/triggers/watcher.go Removes unused Test, TestSuite, and TestSource scheme registrations from a watcher that has no informers for those resources.

Reviews (2): Last reviewed commit: "fix: remove const" | Re-trigger Greptile

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR removes unused/dead code paths related to deprecated tests.testkube.io Test/TestSuite v3 (and related) surfaces, including orphaned mappers, clientsets, and CRD templating assets, leaving only the still-supported trigger/webhook CRD template flow and watcher scheme registrations.

Changes:

  • Removed unused scheme registrations and Kubernetes watcher wiring for deprecated Test/TestSuite/TestSource types.
  • Deleted unreferenced mapping/helpers (pkg/tcl/mappertcl/tests, pkg/mapper/testworkflows/kube.go) and deprecated CRD template assets/constants.
  • Removed typed operator clientsets (and fakes) for tests.testkube.io v2/v3 and updated the versioned clientset accordingly.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/triggers/watcher.go Drops unused AddToScheme calls/imports for deprecated Test/TestSuite/TestSource types in the trigger watcher.
pkg/tcl/mappertcl/tests/openapi_kube.go Removes dead TCL mapper for Test v3 execution request fields.
pkg/tcl/mappertcl/tests/kube_openapi.go Removes dead TCL mapper for Test v3 execution request fields (reverse mapping).
pkg/operator/clientset/versioned/typed/tests/v3/testsuite.go Deletes unused v3 typed client for TestSuite resources.
pkg/operator/clientset/versioned/typed/tests/v3/tests_client.go Deletes unused v3 typed client root.
pkg/operator/clientset/versioned/typed/tests/v3/test.go Deletes unused v3 typed client for Test resources.
pkg/operator/clientset/versioned/typed/tests/v3/generated_expansion.go Deletes unused v3 typed client expansion interfaces.
pkg/operator/clientset/versioned/typed/tests/v3/fake/fake_testsuite.go Deletes unused fake v3 TestSuite client.
pkg/operator/clientset/versioned/typed/tests/v3/fake/fake_tests.go Deletes unused fake v3 Test client.
pkg/operator/clientset/versioned/typed/tests/v3/fake/fake_tests_client.go Deletes unused fake v3 typed client root.
pkg/operator/clientset/versioned/typed/tests/v3/fake/doc.go Deletes unused fake v3 package doc.
pkg/operator/clientset/versioned/typed/tests/v3/doc.go Deletes unused v3 package doc.
pkg/operator/clientset/versioned/typed/tests/v2/testsuite.go Deletes unused v2 typed client for TestSuite resources.
pkg/operator/clientset/versioned/typed/tests/v2/tests_client.go Deletes unused v2 typed client root.
pkg/operator/clientset/versioned/typed/tests/v2/generated_expansion.go Deletes unused v2 typed client expansion interface.
pkg/operator/clientset/versioned/typed/tests/v2/fake/fake_testsuite.go Deletes unused fake v2 TestSuite client.
pkg/operator/clientset/versioned/typed/tests/v2/fake/fake_tests_client.go Deletes unused fake v2 typed client root.
pkg/operator/clientset/versioned/typed/tests/v2/fake/doc.go Deletes unused fake v2 package doc.
pkg/operator/clientset/versioned/typed/tests/v2/doc.go Deletes unused v2 package doc.
pkg/operator/clientset/versioned/scheme/register.go Removes v3 Test/TestSuite scheme registration from the operator clientset scheme.
pkg/operator/clientset/versioned/fake/register.go Removes v3 Test/TestSuite scheme registration from the fake operator clientset scheme.
pkg/operator/clientset/versioned/fake/clientset_generated.go Removes fake clientset accessors for TestsV2/TestsV3.
pkg/operator/clientset/versioned/clientset.go Removes TestsV2/TestsV3 from the public clientset interface and initialization.
pkg/mapper/testworkflows/kube.go Deletes orphaned mapping layer from Test/TestSuite/Executor CRDs to TestWorkflow CRDs.
pkg/crd/templates/testsuite.tmpl Removes deprecated TestSuite CRD YAML template.
pkg/crd/templates/testsource.tmpl Removes deprecated TestSource CRD YAML template.
pkg/crd/templates/test.tmpl Removes deprecated Test CRD YAML template.
pkg/crd/templates/template.tmpl Removes deprecated Template CRD YAML template.
pkg/crd/templates/executor.tmpl Removes deprecated Executor CRD YAML template.
pkg/crd/crd.go Removes template constants for deprecated CRD templates (keeping webhook/webhooktemplate/testtrigger).

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

Comment thread pkg/crd/crd.go
vsukhin added 2 commits July 30, 2026 14:56
Signed-off-by: Vladislav Sukhin <vladislav@kubeshop.io>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

@vsukhin
vsukhin marked this pull request as ready for review July 30, 2026 12:20
@vsukhin
vsukhin requested a review from a team as a code owner July 30, 2026 12:20
@vsukhin
vsukhin requested a review from niyiomotoso July 30, 2026 12:20
@vsukhin
vsukhin merged commit e68bcec into main Aug 3, 2026
18 checks passed
@vsukhin
vsukhin deleted the vsukhin/fix/dead-crd branch August 3, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants