Repository navigation
chore: remove dead OMJob status model and createDefault helper - #36492
Open
detail-app[bot] wants to merge 1 commit into
Open
detail-app[bot] wants to merge 1 commit into
detail-app[bot] wants to merge 1 commit into
Conversation
Contributor
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed three unused symbols from OMJob.java (20 lines, 0 additions):
statusfield on OMJobOMJobStatusclass (phase, mainPodName, exitHandlerPodName,startTime, completionTime, message, mainPodExitCode)
createDefault()static factory methodDescribe your changes
I removed the unused
OMJob.statusfield, the nestedOMJob.OMJobStatusclass, and the
OMJob.createDefault()helper because they are dead code withzero callers anywhere in the codebase.
Why they are dead
statusis never set (no.status(...)builder call, nosetStatus(...))and never read (no
getStatus()on an OMJob) in any production or testfile. It is deliberately omitted from
toMap()(the only serialization pathused by K8sPipelineClient), so it is never sent to the Kubernetes API.
OMJob.OMJobStatusis never instantiated or referenced as a type anywhereoutside its own declaration. The live CR status subsystem lives in a
separate, unrelated class
org.openmetadata.operator.model.OMJobStatusinthe 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 (nometadata/spec) that would NPE on its own
toMap(), so it misled ratherthan 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
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-serviceandmvn spotless:check -pl openmetadata-serviceboth pass.History
Tooling: Detail: Dead Code
Dead Code PRs can be configured here.