Skip to content

Conversation

@ruivieira
Copy link
Member

@ruivieira ruivieira commented Sep 23, 2025

Summary by Sourcery

Remove support for the deprecated v1alpha1 API version and consolidate on the v1 storage version

Enhancements:

  • Drop legacy v1alpha1 conversion code and type definitions
  • Strip v1alpha1 schema from the CRD base and serve only v1
  • Refactor all import paths, type references, controllers, and tests to use the v1 API
  • Remove v1alpha1 registration (AddToScheme) and clean up example/manifests to reference v1

@ruivieira ruivieira self-assigned this Sep 23, 2025
@ruivieira ruivieira added the kind/enhancement New feature or request label Sep 23, 2025
@openshift-ci
Copy link

openshift-ci bot commented Sep 23, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link

openshift-ci bot commented Sep 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found 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

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 23, 2025

Reviewer's Guide

This PR refactors the operator to drop the v1alpha1 API version and fully adopt the v1 storage version by removing all alpha code and schema, updating imports and type references, and adjusting examples and CRDs accordingly.

Entity relationship diagram for TrustyAIService CRD after v1alpha1 removal

erDiagram
    TrustyAIService {
        string apiVersion
        string kind
        object metadata
        TrustyAIServiceSpec spec
        TrustyAIServiceStatus status
    }
    TrustyAIServiceSpec {
        Data data
        Metrics metrics
        int replicas
        Storage storage
    }
    Data {
        string filename
        string format
    }
    Metrics {
        int batchSize
        string schedule
    }
    Storage {
        string databaseConfigurations
        string folder
        string format
        string size
    }
    TrustyAIServiceStatus {
        Condition[] conditions
        string phase
        string ready
        int replicas
    }
    Condition {
        string lastTransitionTime
        string message
        string reason
        string status
        string type
    }
    TrustyAIServiceSpec ||--o| Data : contains
    TrustyAIServiceSpec ||--o| Metrics : contains
    TrustyAIServiceSpec ||--o| Storage : contains
    TrustyAIServiceStatus ||--|{ Condition : has
    TrustyAIService ||--o| TrustyAIServiceSpec : has
    TrustyAIService ||--o| TrustyAIServiceStatus : has
Loading

Class diagram for TrustyAIService type reference update to v1

classDiagram
    class TrustyAIServiceReconciler {
        +updateStatus(ctx, original: TrustyAIService, update)
        +reconcileStatuses(ctx, instance: TrustyAIService)
        +createDeploymentObject(ctx, instance: TrustyAIService, serviceImage, caBundle)
        +createDeployment(ctx, cr: TrustyAIService, imageName, caBundle)
        +updateDeployment(ctx, cr: TrustyAIService, imageName, caBundle)
        +ensureDeployment(ctx, instance: TrustyAIService, caBundle, migration)
        +checkDeploymentReady(ctx, instance: TrustyAIService)
        +createRouteObject(ctx, instance: TrustyAIService)
        +reconcileRouteAuth(instance: TrustyAIService, ctx, newRoute)
        +ReconcileRoute(instance: TrustyAIService, ctx)
        +checkRouteReady(ctx, cr: TrustyAIService)
        +eventModelMeshConfigured(instance: TrustyAIService)
        +eventKServeConfigured(instance: TrustyAIService)
        +eventPVCCreated(instance: TrustyAIService)
        +eventLocalServiceMonitorCreated(instance: TrustyAIService)
        +patchEnvVarsForDeployments(ctx, instance: TrustyAIService, ...)
        +patchEnvVarsByLabelForDeployments(ctx, instance: TrustyAIService, ...)
        +handleInferenceServices(ctx, instance: TrustyAIService, ...)
        +patchKServe(ctx, instance: TrustyAIService, ...)
        +generatePVCName(instance: TrustyAIService)
        +ensurePVC(ctx, instance: TrustyAIService)
        +createPVC(ctx, instance: TrustyAIService)
        +checkPVCReady(ctx, instance: TrustyAIService)
        +generateServiceAccountName(instance: TrustyAIService)
        +createServiceAccount(ctx, instance: TrustyAIService)
        +createClusterRoleBinding(ctx, instance: TrustyAIService, serviceAccountName)
        +GetCustomCertificatesBundle(ctx, instance: TrustyAIService)
        +checkDatabaseAccessible(ctx, instance: TrustyAIService)
        +ensureDestinationRule(ctx, instance: TrustyAIService)
        +deleteExternalDependency(crName, instance: TrustyAIService, namespace, ctx)
        +ensureLocalServiceMonitor(cr: TrustyAIService, ctx)
        +findDatabaseSecret(ctx, instance: TrustyAIService)
        +reconcileService(ctx, cr: TrustyAIService)
        +ensureVirtualService(ctx, instance: TrustyAIService)
    }
    class TrustyAIService {
        +Spec
        +Status
    }
    TrustyAIServiceReconciler --> TrustyAIService : manages
Loading

File-Level Changes

Change Details Files
Remove v1alpha1 CRD schema from the base manifests
  • Deleted the v1alpha1 schema block under spec.versions
  • Left only the v1 storage/version definition
  • Removed served/storage flags for the alpha version
config/crd/bases/trustyai.opendatahub.io_trustyaiservices.yaml
Switch code and tests to use v1 types instead of v1alpha1
  • Updated import paths from /api/tas/v1alpha1 to /api/tas/v1
  • Changed all function signatures, type declarations and method receivers accordingly
  • Adjusted tests to instantiate and refer to v1 TrustyAIService
controllers/tas/*
.github
tests/**/*
controllers/*
controllers/tas/*
controllers/tas/*
Remove the v1alpha1 API package and related conversion code
  • Deleted api/tas/v1alpha1 directory and all generated deepcopy and conversion files
  • Eliminated conversion.go and groupversion_info.go
  • Cleaned up references in module to alpha API
api/tas/v1alpha1/*
Update examples, schemes, and CLI setup to register only v1
  • Changed apiVersion in example and smoke-test YAMLs from v1alpha1 to v1
  • Removed tasv1alpha1.AddToScheme from cmd/main.go
  • Ensured only v1 is registered in the controller manager
artifacts/examples/example-trustyai.yaml
tests/smoke/manifests/trustyai-cr.yaml
cmd/main.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ruivieira ruivieira linked an issue Sep 30, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove TrustyAI service v1alpha1 API version

1 participant