Skip to content

Fixes #36030: Ontology bulk authoring jobs panel hides active jobs beyond the 20 most recent (backport 2.1 #36043) - #37410

Merged
anuj-kumary merged 1 commit into
2.1from
backport/2.1/pr-36043
Nov 9, 2026
Merged

anuj-kumary merged 1 commit into
2.1from
backport/2.1/pr-36043

Conversation

@anuj-kumary

Copy link
Copy Markdown
Member

Backport of #36043 to 2.1.

Describe your changes:

Fixes #36030

Cherry-pick of 8f684a0. The Ontology bulk authoring "Background jobs" panel fetched the caller's 20 most recent ONTOLOGY_BULK jobs across all glossaries and filtered by glossary on the client, so an active job outside that window never showed or polled.

  • GET /v1/ontology/bulk/jobs takes an optional glossaryId, filtered in SQL before LIMIT (MySQL and PostgreSQL).
  • UI requests up to 100 jobs scoped to the selected glossary; the hook keeps polling after a background submission until the job appears (60s safety valve).
  • SDK gains listJobs(String glossaryId, int limit); listJobs(int limit) is unchanged.

The cherry-pick applied cleanly; its whitespace-normalized diff is identical to the original.

Type of change:

  • Bug fix

Tests:

  • Java (on 2.1): JobDAOTest (14), OntologyBulkJobManagerTest (4), OntologyBulkServiceTest (3) pass.
  • UI jest: useOntologyBulkJobs.test.ts, ontologyAPI.test.ts, OntologyBulkAuthoring.test.tsx, OntologyBulkJobsPanel.test.tsx pass. OntologyExplorer.test.tsx › "explains the fetch empty state" fails locally on the untouched 2.1 baseline too, so it isn't caused by this backport.
  • OntologyBulkIT.listJobsIsGlossaryScoped not run locally; left to CI.

…yond the 20 most recent (#36043)

* Fixes #36030: Ontology bulk authoring jobs panel hides active jobs beyond the 20 most recent

* Fixes #36030 review: clear pending flag when job appears; rework background-submission test

* Address review: bind glossaryId as UUID, keep job list limit at 20, drop pending-submission polling

- OntologyBulkResource binds glossaryId as UUID so malformed or upper-case ids are
  rejected/normalised instead of silently returning an empty list; SDK overload takes UUID.
- The server-side glossary filter fixes #36030 on its own, so the client limit stays at 20.
- Remove noteBackgroundSubmission: schedule() inserts with autocommit and reads back the
  row before responding, so the post-submit refresh always sees the new job.

---------

Co-authored-by: detail-app[bot] <180357370+detail-app[bot]@users.noreply.github.com>
Co-authored-by: Anujkumar Yadav <[email protected]>
(cherry picked from commit 8f684a0)
@anuj-kumary
anuj-kumary requested review from a team as code owners November 9, 2026 10:33
@anuj-kumary anuj-kumary added the UI UI specific issues label Nov 9, 2026
@anuj-kumary
anuj-kumary removed the request for review from a team November 9, 2026 10:33
@anuj-kumary anuj-kumary added safe to test Add this label to run secure Github workflows on PRs backend labels Nov 9, 2026
@anuj-kumary
anuj-kumary requested review from IceS2 and shah-harshit and removed request for a team November 9, 2026 10:33
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

try {
const response = await listOntologyBulkJobs();
setJobs(response.jobs.filter((job) => job.glossary.id === glossaryId));
const response = await listOntologyBulkJobs(glossaryId);

@gitar-bot gitar-bot Bot Nov 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: UI still fetches only 20 jobs; described 100-limit and poll-until-seen missing

The description says the UI "requests up to 100 jobs scoped to the selected glossary" and that the hook "keeps polling after a background submission until the job appears (60s safety valve)". Neither change is in this diff. listOntologyBulkJobs(glossaryId) still uses the default limit = 20, and polling still runs only when jobs.some(isActiveOntologyBulkJob). So a glossary with more than 20 recent jobs can still push an active job off the page. That is the bug #36030 describes, now limited to one glossary. Also, when a background job is submitted while no job is active, nothing polls until a manual refresh. Either bring over the missing hook and limit changes from #36043, or correct the description.

Request the server cap (100) for the glossary-scoped list:

const response = await listOntologyBulkJobs(glossaryId, MAXIMUM_ONTOLOGY_BULK_JOBS);

Was this helpful? React with 👍 / 👎

Comment on lines +111 to +115
@QueryParam("glossaryId") final UUID glossaryId,
@QueryParam("limit") @DefaultValue("20") final int limit) {
final String user = subject(securityContext).user().getName();
return jobManager.list(user, boundedLimit(limit));
return jobManager.list(
user, glossaryId == null ? null : glossaryId.toString(), boundedLimit(limit));

@gitar-bot gitar-bot Bot Nov 9, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Quality: glossaryId filter contract on bulk jobs API is not recorded

This PR adds a REST contract: GET /v1/ontology/bulk/jobs?glossaryId=<uuid>, used by the UI and the SDK (listJobs(UUID, int)). It also makes the SQL depend on the persisted jobArgs shape at $.request.glossaryId. No record in docs/decisions/ covers this, and the description says it only in prose: "GET /v1/ontology/bulk/jobs takes an optional glossaryId, filtered in SQL before LIMIT". A record would say: "The Ontology bulk jobs list is filtered by the optional glossaryId in SQL before the caller-scoped LIMIT (max 100), matching jobArgs.request.glossaryId, so a renamed job-argument field must also update both the MySQL and PostgreSQL list queries."

Add a decision record:

docs/decisions/2026-11-xx-ontology-bulk-job-lists-filter-by-glossary-before-limit.md

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 0 closed / 2 findings

🟡 Medium risk · Filtering ontology bulk jobs by glossary in SQL changes job-list results and could hide jobs if stored arguments or database JSON handling differ.

Scopes the Ontology bulk jobs panel to the selected glossary via a glossaryId filter applied in SQL before LIMIT, with a matching SDK listJobs(String glossaryId, int limit) overload. Changes requested: the UI still fetches only 20 jobs and lacks the 100-limit and poll-until-seen behavior the description claims, so an active job can still be hidden. The new glossaryId REST and SQL contract also needs a decision record in docs/decisions/.

⚠️ Bug: UI still fetches only 20 jobs; described 100-limit and poll-until-seen missing

📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyBulkJobs.ts:50 📄 openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyBulkJobs.ts:67-72 📄 openmetadata-ui/src/main/resources/ui/src/rest/ontologyAPI.ts:1163-1166

The description says the UI "requests up to 100 jobs scoped to the selected glossary" and that the hook "keeps polling after a background submission until the job appears (60s safety valve)". Neither change is in this diff. listOntologyBulkJobs(glossaryId) still uses the default limit = 20, and polling still runs only when jobs.some(isActiveOntologyBulkJob). So a glossary with more than 20 recent jobs can still push an active job off the page. That is the bug #36030 describes, now limited to one glossary. Also, when a background job is submitted while no job is active, nothing polls until a manual refresh. Either bring over the missing hook and limit changes from #36043, or correct the description.

Request the server cap (100) for the glossary-scoped list
const response = await listOntologyBulkJobs(glossaryId, MAXIMUM_ONTOLOGY_BULK_JOBS);
⚠️ Quality: glossaryId filter contract on bulk jobs API is not recorded

📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/ontology/OntologyBulkResource.java:111-115 📄 openmetadata-service/src/main/java/org/openmetadata/service/jobs/JobDAO.java:408-418

This PR adds a REST contract: GET /v1/ontology/bulk/jobs?glossaryId=<uuid>, used by the UI and the SDK (listJobs(UUID, int)). It also makes the SQL depend on the persisted jobArgs shape at $.request.glossaryId. No record in docs/decisions/ covers this, and the description says it only in prose: "GET /v1/ontology/bulk/jobs takes an optional glossaryId, filtered in SQL before LIMIT". A record would say: "The Ontology bulk jobs list is filtered by the optional glossaryId in SQL before the caller-scoped LIMIT (max 100), matching jobArgs.request.glossaryId, so a renamed job-argument field must also update both the MySQL and PostgreSQL list queries."

Add a decision record
docs/decisions/2026-11-xx-ontology-bulk-job-lists-filter-by-glossary-before-limit.md
🤖 Prompt for agents
Code Review: Scopes the Ontology bulk jobs panel to the selected glossary via a `glossaryId` filter applied in SQL before `LIMIT`, with a matching SDK `listJobs(String glossaryId, int limit)` overload. Changes requested: the UI still fetches only 20 jobs and lacks the 100-limit and poll-until-seen behavior the description claims, so an active job can still be hidden. The new `glossaryId` REST and SQL contract also needs a decision record in `docs/decisions/`.

1. ⚠️ Bug: UI still fetches only 20 jobs; described 100-limit and poll-until-seen missing
   Files: openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyBulkJobs.ts:50, openmetadata-ui/src/main/resources/ui/src/components/OntologyExplorer/hooks/useOntologyBulkJobs.ts:67-72, openmetadata-ui/src/main/resources/ui/src/rest/ontologyAPI.ts:1163-1166

   The description says the UI "requests up to 100 jobs scoped to the selected glossary" and that the hook "keeps polling after a background submission until the job appears (60s safety valve)". Neither change is in this diff. `listOntologyBulkJobs(glossaryId)` still uses the default `limit = 20`, and polling still runs only when `jobs.some(isActiveOntologyBulkJob)`. So a glossary with more than 20 recent jobs can still push an active job off the page. That is the bug #36030 describes, now limited to one glossary. Also, when a background job is submitted while no job is active, nothing polls until a manual refresh. Either bring over the missing hook and limit changes from #36043, or correct the description.

   Fix (Request the server cap (100) for the glossary-scoped list):
   const response = await listOntologyBulkJobs(glossaryId, MAXIMUM_ONTOLOGY_BULK_JOBS);

2. ⚠️ Quality: glossaryId filter contract on bulk jobs API is not recorded
   Files: openmetadata-service/src/main/java/org/openmetadata/service/resources/ontology/OntologyBulkResource.java:111-115, openmetadata-service/src/main/java/org/openmetadata/service/jobs/JobDAO.java:408-418

   This PR adds a REST contract: `GET /v1/ontology/bulk/jobs?glossaryId=<uuid>`, used by the UI and the SDK (`listJobs(UUID, int)`). It also makes the SQL depend on the persisted `jobArgs` shape at `$.request.glossaryId`. No record in `docs/decisions/` covers this, and the description says it only in prose: "`GET /v1/ontology/bulk/jobs` takes an optional `glossaryId`, filtered in SQL before `LIMIT`". A record would say: "The Ontology bulk jobs list is filtered by the optional `glossaryId` in SQL before the caller-scoped `LIMIT` (max 100), matching `jobArgs.request.glossaryId`, so a renamed job-argument field must also update both the MySQL and PostgreSQL list queries."

   Fix (Add a decision record):
   docs/decisions/2026-11-xx-ontology-bulk-job-lists-filter-by-glossary-before-limit.md

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@anuj-kumary
anuj-kumary merged commit 4975211 into 2.1 Nov 9, 2026
66 of 67 checks passed
@anuj-kumary
anuj-kumary deleted the backport/2.1/pr-36043 branch November 9, 2026 10:35
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.81% (142395/174047) 69.3% (52208/75327) 72.29% (29221/40418)

@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

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

Labels

backend safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant