Skip to content

Conversation

@tarilabs
Copy link

@tarilabs tarilabs commented Nov 22, 2025

Summary by Sourcery

Expose LMEvalJob child Pod information in the custom resource status to improve visibility in OKD/OCP consoles.

New Features:

  • Add a ChildResourceRef type to reference child resources such as Pods from LMEvalJob status.
  • Extend the LMEvalJobStatus schema with an optional pod field describing the associated Pod.

Enhancements:

  • Populate the new pod reference field when creating the evaluation Pod so status consumers can link back to the child resource.
  • Update generated deepcopy logic to support the new ChildResourceRef type and ensure correct copying of the Pod status field.

@openshift-ci
Copy link

openshift-ci bot commented Nov 22, 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 22, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link

openshift-ci bot commented Nov 22, 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 Nov 22, 2025

Reviewer's Guide

Adds a ChildResourceRef struct to LMEvalJobStatus to surface the created pod as a child resource in OKD/OCP consoles, updates the CRD schema and deepcopy implementations accordingly, and populates the new status field during reconciliation when the pod is created.

Sequence diagram for updating LMEvalJob status with ChildResourceRef on pod creation

sequenceDiagram
  participant "LMEvalJobReconciler" as Reconciler
  participant "LMEvalJob CR" as LMEvalJob
  participant "Kubernetes API" as KubeAPI
  participant "Pod" as Pod

  Reconciler->>KubeAPI: "Create Pod for LMEvalJob"
  KubeAPI-->>Reconciler: "Pod created"

  Reconciler->>LMEvalJob: "Set status.state = ScheduledJobState"
  Reconciler->>LMEvalJob: "Set status.podName = GetPodName()"
  Reconciler->>LMEvalJob: "Set status.pod = ChildResourceRef{Kind='Pod', Namespace=job.Namespace, Name=GetPodName()}"

  Reconciler->>KubeAPI: "Status().Update(LMEvalJob)"
  KubeAPI-->>Reconciler: "LMEvalJob status updated with pod and podName"
Loading

Class diagram for updated LMEvalJobStatus and ChildResourceRef

classDiagram
class ChildResourceRef {
  string Kind
  string Name
  string Namespace
}

class LMEvalJobStatus {
  string podName
  ChildResourceRef pod
  JobState state
  []ProgressBar progressBars
}

LMEvalJobStatus *-- ChildResourceRef : pod
Loading

File-Level Changes

Change Details Files
Introduce ChildResourceRef and expose pod as a child resource in LMEvalJob status for console visibility.
  • Define ChildResourceRef type with kind, name, and namespace JSON fields and an explanatory comment
  • Extend LMEvalJobStatus with an optional Pod field of type ChildResourceRef alongside the existing PodName field
  • Populate job.Status.Pod in the controller when the pod is successfully created, using the job namespace and generated pod name, and set ScheduledJobState and LastScheduleTime as before
api/lmes/v1alpha1/lmevaljob_types.go
controllers/lmes/lmevaljob_controller.go
Update generated deepcopy and CRD schema to support the new ChildResourceRef status field.
  • Add DeepCopyInto and DeepCopy methods for ChildResourceRef in the autogenerated deepcopy file
  • Ensure LMEvalJobStatus.DeepCopyInto copies the Pod field
  • Augment the LMEvalJobStatus section of the CRD to include the pod object schema with required kind, name, and namespace properties and a description
api/lmes/v1alpha1/zz_generated.deepcopy.go
config/crd/bases/trustyai.opendatahub.io_lmevaljobs.yaml

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

@github-actions
Copy link

github-actions bot commented Nov 22, 2025

PR image build and manifest generation completed successfully!

📦 PR image: quay.io/trustyai/trustyai-service-operator:43b0ee17382d348e8f4ca41153d421edf627fe0f

📦 LMES driver image: quay.io/trustyai/ta-lmes-driver:latest

📦 LMES job image: quay.io/trustyai/ta-lmes-job:latest

📦 Guardrails orchestrator image: quay.io/trustyai/ta-guardrails-orchestrator:latest

🗂️ CI manifests

      devFlags:
        manifests:
          - contextDir: config
            sourcePath: ''
            uri: https://api.github.com/repos/trustyai-explainability/trustyai-service-operator-ci/tarball/operator-43b0ee17382d348e8f4ca41153d421edf627fe0f

Signed-off-by: tarilabs <[email protected]>
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.

1 participant