Repository navigation
Make background job types an open set - #37592
Conversation
Collate copied jobs/backgroundJob.json and configuration/slackAppConfiguration.json to add its ADMIN_OPS_* job types and Slack socket mode, and the copies replaced the OpenMetadata classes at runtime. The job-type copy fell behind again, so ontology library installs fail on Collate with NoSuchFieldError for JobType.ONTOLOGY_PACK_INSTALL. Add the six ADMIN_OPS_* job types and the optional connectionMode (default Webhook) and appToken fields here, so Collate can delete both copies. Record that openmetadata-spec is the only definition of its schemas.
BackgroundJob.jobType becomes a string. The worker already dispatched by methodName through JobHandlerRegistry and the column is a VARCHAR; the enum was only enforced when a row was read back, where an unknown value threw. OpenMetadata's own types are constants in BackgroundJobTypes. The ADMIN_OPS_*, DELETE_ENTITY and DELETE_TOKEN values, which only Collate writes, leave the spec.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Resolve conflicts with the squashed #37581 (identical content) and with #37455, which added a CONTEXT_MEMORY_EXTRACTION check and recovery tests written against the removed BackgroundJob.JobType enum. Both now compare against BackgroundJobTypes; the "every type but memory extraction" case lists the same values as strings.
Resolve import conflicts with #37479: keep its PageType import and drop the unused BackgroundJob import, since job types now come from BackgroundJobTypes.
🔴 Playwright Results — workflow failedValidated commit ✅ 7240 passed · ❌ 28 failed · 🟡 2 flaky · ⏭️ 1 skipped · 🧰 0 lifecycle flaky ❌ Action needed: test(s) failed on every attempt against this PR’s validated commit — see Genuine Failures below. These are test failures, not CI budget or infrastructure issues. PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 52m 43s ⏱️ Max setup 13m 19s · max shard execution 19m 0s · max shard-job elapsed before upload 29m 20s · reporting 18s 🌐 151.43 requests/attempt · 2.17 app boots/UI scenario · 35.26% common-shard skew
Optimization targets still in progress:
Genuine Failures (failed on all attempts)❌
|
UI browser testsRan: all test files (no impact map from main yet) Result: ✅ 1070 passed · 154 skipped Changed files no browser test loads
|
Code Review ✅ Approved 🔴 High riskReplacing the generated BackgroundJob.JobType enum with String breaks Java source compatibility, so existing consumers may fail to compile until migrated. Makes VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Issue
Fixes #37580
This is the follow-up to #37581 (comment). It is stacked on #37581, so the diff shows only this change. The paired Collate change is open-metadata/openmetadata-collate#8473.
What
BackgroundJob.jobTypebecomes a string instead of a closed enum.Stringconstants in the newBackgroundJobTypes. Every caller ofBackgroundJob.JobTypemoves to them, and the two==comparisons becomeequals.JobDAO.insertJobtakes aStringjob type.BackgroundJobMapperreads the column value as it is, with nofromValue.MEMORY_GLOSSARY_DERIVATION_JOB_TYPEmoves fromJobDAOintoBackgroundJobTypes. The worker's workaround for Collate loading an older enum is gone.ADMIN_OPS_*(6),DELETE_ENTITYorDELETE_TOKEN. Only Collate writes them, and Collate now owns them.JobTypeenum is removed, soNavBarcompares againstCUSTOM_PROPERTY_ENUM_CLEANUP_JOB_TYPE.Why
The worker already runs a job through the handler named by
methodNameinJobHandlerRegistry, which a distribution extends (OpenMetadataApplication.getJobHandlerRegistry()is protected).background_jobs.jobTypeis aVARCHAR(256), and Collate already inserts its admin-ops jobs with string types. The enum was enforced in one place only: when the worker read a row back,JobType.fromValuethrew on a value the enum did not list. Since that read happens while fetching the next pending job, one such row stops the queue for every job type. That is why Collate's types had to be listed in openmetadata-spec, and why each missed sync broke Collate.With a string type, a distribution writes its own job type and registers its handler, with no OpenMetadata change. A job whose handler is not registered still fails with
No handler registered for <methodName>, so a separate type registry would add no protection and isn't included.Compatibility.
BackgroundJob.JobTypeno longer exists. Collate is the only known caller outside this repo, and it moves in the paired PR.JobTypeenum is removed.NavBarwas its only consumer.Decision record
This amends ADR:2026-11-11-openmetadata-spec-is-the-only-definition-of-its-schemas (v2). Job types are an open set, so they are no longer values a distribution adds to the spec. The rule still applies to every other schema.
Verification
JobDAOTest,GenericBackgroundWorkerTest,MemoryGlossaryDerivationJobHandlerTest,PageContextProcessingEngineTest,OntologyBulkJobManagerTestandBackgroundJobCleanupSchedulerTest: 43 run, all passing. Two of these tests are new:JobDAOTest.workerReadsAJobTypeOpenMetadataDoesNotDefine: the mapper returns a storedDOWNSTREAM_REINDEXrow unchanged.GenericBackgroundWorkerTest.runsAJobTypeOpenMetadataDoesNotDefineWithItsRegisteredHandler: the worker runs that job through its registered handler and marks itCOMPLETED.openmetadata-integration-teststest-compilepasses. The touched ITs (ContextMemoryExtractionIT,ContextMemoryDerivationIT,NativeOntologyPackInstallJobIT,NativeOntologyCapacityPerfIT) only swap the constant and run in the merge queue.json2ts-generate-all.sh -l trueandyarn parse-schemachange onlygenerated/jobs/backgroundJob.ts.plan_local_java_tests.py --check-branch: the impact map is complete.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Makes
BackgroundJob.jobTypean open string while keeping OpenMetadata's existing values.No actionable issues found. This review used source checks; no tests were run.
harshachexplicitly acknowledges the removed Java enum and describes the paired Collate update.Diagram
Reviews (1) · Last reviewed commit: "Merge branch 'main' into harshach/open-b..." · Reviewed by Greptile