Skip to content

chore: remove dead OMJob status model and createDefault helper - #36492

Open
detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-remove-dead-omjob-status-model-and-createdef-205f21
Open

detail-app[bot] wants to merge 1 commit into
mainfrom
detail/dead-code/chore-remove-dead-omjob-status-model-and-createdef-205f21

Conversation

@detail-app

@detail-app detail-app Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Removed three unused symbols from OMJob.java (20 lines, 0 additions):

  • the status field on OMJob
  • the nested OMJobStatus class (phase, mainPodName, exitHandlerPodName,
    startTime, completionTime, message, mainPodExitCode)
  • the createDefault() static factory method

Describe your changes

I removed the unused OMJob.status field, the nested OMJob.OMJobStatus
class, and the OMJob.createDefault() helper because they are dead code with
zero callers anywhere in the codebase.

Why they are dead

  • status is never set (no .status(...) builder call, no setStatus(...))
    and never read (no getStatus() on an OMJob) in any production or test
    file. It is deliberately omitted from toMap() (the only serialization path
    used by K8sPipelineClient), so it is never sent to the Kubernetes API.
  • OMJob.OMJobStatus is never instantiated or referenced as a type anywhere
    outside its own declaration. The live CR status subsystem lives in a
    separate, unrelated class org.openmetadata.operator.model.OMJobStatus in
    the openmetadata-k8s-operator module; this service-side nested class was a
    vestigial parallel model that was never wired up.
  • createDefault() has no callers. It returns a half-initialized OMJob (no
    metadata/spec) that would NPE on its own toMap(), so it misled rather
    than helped. Production builders in K8sPipelineClient construct OMJob
    directly via the Lombok builder.

All remaining symbols (OMJobMetadata + 4 fields, OMJobSpec + 3 fields,
OMJobPodSpec + 12 fields, toMap, buildSpecMap) are confirmed living via
K8sPipelineClient and K8sJobUtils.buildPodSpecMap. No imports went dead
(the removed code only used java.lang types and the OMJob builder), so there
are no cascading deletions.

Type of change

  • Improvement

High-level design

N/A — small change, single file, pure deletion of unreferenced code.

Tests

Ran the k8s unit tests in openmetadata-service:
mvn test -pl openmetadata-service -Dtest='OMJobSerializationTest, K8sJobUtilsTest,EnvVarEndToEndTest,CronOMJobSerializationTest, K8sPipelineClientTest,K8sPipelineClientBotTokenBugTest'
=> Tests run: 102, Failures: 0, Errors: 0, Skipped: 0. BUILD SUCCESS.
mvn compile -pl openmetadata-service and mvn spotless:check -pl openmetadata-service both pass.

History

Tooling: Detail: Dead Code


Dead Code PRs can be configured here.

@detail-app
detail-app Bot requested a review from a team as a code owner October 28, 2026 22:45
@detail-app
detail-app Bot requested a review from pmbrull October 28, 2026 22:45
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@detail-app detail-app Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant