Skip to content

Fixes #32374: serve the reindex entity list from the index registry - #32375

Merged
mohityadav766 merged 12 commits into
mainfrom
fixes-32374-search-index-entity-types-from-backend
Sep 9, 2026
Merged

mohityadav766 merged 12 commits into
mainfrom
fixes-32374-search-index-entity-types-from-backend

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #32374

The Search Indexing application's entity picker was populated from a hardcoded items.enum in the
UI-local schema JSON. That made a runtime fact (which indexes the server registered) into a
per-build snapshot, and it had drifted 15 entity types behind the registry:

source count
UI schema entities.items.enum 53
index mapping registry 68

Absent from the dropdown: aiApplication, aiFrameworkControl, aiGovernanceFramework,
aiGovernancePolicy, auditReport, contextMemory, llmModel, llmService, mcpExecution,
mcpServer, mcpService, pipelineStatus, promptTemplate, relationshipType, tableColumn.

So "check everything in the dropdown" was not equivalent to all, even though the app already
expands all from the registry — every entity type added since the enum was last hand-edited was
silently unreindexable from the UI.

It also could never be correct for a distribution that registers extra indexes: IndexMappingLoader
merges elasticsearch/indexMapping.json plus elasticsearch/collate/indexMapping.json from the
classpath at startup. Collate forked this entire schema file just to widen the enum, and that fork
had drifted too.

Type of change:

  • Bug fix

High-level design:

One definition, two readers — so they cannot drift.

  • SearchRepository.getIndexedEntityTypes() — sorted keys of the merged index mapping registry.
  • ReindexingOrchestrator.getAll() now calls it (was inlining getEntityIndexMap().keySet()), so
    the all expansion and the picker are the same set by construction.
  • GET /v1/search/entityTypes serves it, authorized against APPLICATION / VIEW_BASIC — the same gate as the page that calls it (SettingsRouter renders AppDetails for isAdminUser || hasViewPermissions(APPLICATION), and that page fetches the schema on every mount). It was admin-or-bot in the first revision; changed after review, because admin-only would 403-toast a legitimate viewer on a request they never triggered. Placed on SearchResource because that is
    where searchRepository and the sibling registry endpoints (/templates, /stats,
    /reindexEntities) already live.

UI

  • The enum is removed from SearchIndexingApplication.json — from the source under
    utils/ApplicationSchemas/ and the tracked parsed copy under jsons/applicationSchemas/
    (this repo commits the parsed output; editing only the source would leave the shipped schema stale).
  • getSearchEntityTypes() added to rest/searchAPI.ts.
  • Injected in ApplicationsClassBase.importSchema, the single funnel AppDetails and AppInstall
    both go through, so neither call site needs to know about it.

Failure mode. RJSF picks the multiselect widget off items.enum, so the enum has to be present
at render time. A failed fetch injects an empty enum — the tree still renders with "All" selectable
(and ["all"] is the default and the common choice) — plus an error toast. Letting the fetch throw
would have failed the whole config form for what is an enrichment of one field.

Alternatives rejected. Generating the enum into the schema JSON at build time from
indexMapping.json: needs new codegen wiring, still leaves Collate with its own generated fork, and
still cannot see a classpath merge that only exists at runtime — which is the actual bug.

Deliberately out of scope — same shape, different sources of truth; do not point this endpoint
at them:

  • RdfIndexApp.json entities — the triplestore entity list (app, bot, dataContract, …), not
    search indexes.
  • CacheWarmupApplication.json entities — repository-backed types, and "all" is a real enum
    member there.

Compatibility. Additive endpoint; no schema or migration changes. Stored appConfiguration
values are untouched — the backend schema's entities was always a plain string[] with no enum, so
nothing that validates today stops validating. tableColumn and friends now become individually
selectable; they were already included whenever all was used, so this is not a new code path.

Tests:

Use cases covered

  • Admin opens the Search Indexing app config: the entity picker lists every entity type the server
    registered, including ones added after this build was cut.
  • Admin on a Collate deployment sees Collate-only indexes in the same picker, with no Collate backend
    code.
  • GET /v1/search/entityTypes is rejected for a non-admin.
  • The entity list endpoint is unavailable: the form still renders and "All" is still selectable.

Unit tests

  • Added, in openmetadata-ui/.../AppDetails/ApplicationsClassBase.test.ts:
    • fills the entity list from the server
    • the schema JSON carries no hardcoded enum (asserts on the JSON module directly, so it fails if
      the enum is ever re-added)
    • a failed fetch toasts and leaves the list empty
    • other applications do not trigger the fetch
  • 10/10 pass in that suite (4 new + 6 pre-existing). AppDetails + AppInstall + TreeSelectWidget:
    21/21 pass.
  • Coverage % on changed classes: not measured — jacoco:report / yarn test:coverage were not run.

Backend integration tests

  • Added 2 to openmetadata-integration-tests/.../SearchResourceIT.java:
    • testEntityTypesComesFromTheIndexRegistry — 200, non-empty, sorted, and contains tableColumn
      (which the old hardcoded enum lacked, so its presence is what proves the list is read from the
      registry rather than copied)
    • testEntityTypesIsReadableByApplicationViewer — 200 and a non-empty list for a DataConsumer, pinning that an Application viewer is not 403'd. (DataConsumer grants ViewAll on all resources and is the default role, so there is no clean 403 case left to assert without building a deny policy — say the word if you want one.)
  • These compile but have not been executed here (they need a live server + ES/OS). CI will be the
    first real run.

Ingestion integration tests

  • Not applicable.

Playwright (UI) tests

  • Not added. The existing SearchIndexApplication.spec.ts already drives this picker (it searches for
    and toggles "Table"), and it now exercises the server-driven list unchanged — which is the useful
    end-to-end signal. Happy to add a dedicated spec if reviewers want one.

Manual testing performed

  • mvn compile -pl openmetadata-service and mvn test-compile -pl openmetadata-integration-tests: pass.
  • mvn spotless:apply: no changes.
  • Jest suites above: pass. yarn lint:base on changed files: 0 errors. prettier --check: clean.
  • Verified generateApplicationDocs.js does not consume items.enum by regenerating all app docs:
    zero diff.
  • No local stack run / browser verification. Flagging that honestly rather than checking the box.

UI screen recording / screenshots:

Not attached — I did not have a running stack to record against, so I cannot honestly claim this.
The visible change is that the existing tree-select lists more entity types; there is no new UI
surface. If a recording is required before merge, please say so and I will get one.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: no backend schema changed. The UI-local schema lost a UI-only enum, so
    no migration is needed — stored configs were never validated against it.
  • For UI changes: I attached a screen recording and/or screenshots above. — see note above
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing — the "no hardcoded enum" unit
    test and the tableColumn assertion in the IT both fail if the stale-list behaviour returns.

Downstream

Collate can delete its SearchIndexingApplication-collate.json fork once this lands and the submodule
pin moves; no Collate backend change is needed, because the classpath merge in IndexMappingLoader
already makes this endpoint return the Collate-correct list. Companion Collate issue:
https://github.com/open-metadata/openmetadata-collate/issues/3946

The Search Indexing app's entity picker read a hardcoded `items.enum` in the
UI-local schema JSON, so it was a per-build snapshot of a runtime fact and had
drifted 15 entity types behind the index mapping registry. Selecting everything
in the dropdown was therefore not the same as selecting `all`, which the app
already expands from the registry.

It also could never be right for a distribution that registers extra indexes:
IndexMappingLoader merges elasticsearch/indexMapping.json plus
elasticsearch/collate/indexMapping.json from the classpath at startup, so no
enum baked into the UI bundle can express the reindexable set.

Add SearchRepository.getIndexedEntityTypes() as the one definition and have both
ReindexingOrchestrator.getAll() and a new GET /v1/search/entityTypes read it, so
the picker and `all` cannot drift. The UI drops the enum and fills it in
ApplicationsClassBase.importSchema, the single funnel AppDetails and AppInstall
share; a failed fetch leaves only "All" selectable plus an error toast rather
than breaking the whole form.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 1, 2026 14:00
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 1, 2026
karanh37
karanh37 previously approved these changes Sep 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes drift in the Search Indexing application’s “entities to reindex” picker by removing the hardcoded UI schema enum and sourcing the entity-type list from the server’s merged index mapping registry (including distribution-specific indexes).

Changes:

  • Add GET /v1/search/entityTypes (admin-or-bot) backed by SearchRepository.getIndexedEntityTypes() and reuse it for "all" expansion in ReindexingOrchestrator.
  • Remove the hardcoded entities.items.enum from the Search Indexing application schema JSON (both source and committed parsed copy).
  • Fetch entity types in the UI (getSearchEntityTypes) and inject them into the Search Indexing schema during ApplicationsClassBase.importSchema, with Jest + IT coverage.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
openmetadata-ui/src/main/resources/ui/src/utils/ApplicationSchemas/SearchIndexingApplication.json Removes hardcoded enum from the source schema.
openmetadata-ui/src/main/resources/ui/src/jsons/applicationSchemas/SearchIndexingApplication.json Removes hardcoded enum from the committed parsed schema copy.
openmetadata-ui/src/main/resources/ui/src/rest/searchAPI.ts Adds getSearchEntityTypes() REST helper for the new endpoint.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.ts Injects server-provided enum into SearchIndexingApplication schema and toasts on failure.
openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.test.ts Adds tests for dynamic injection, absence of hardcoded enum, error handling, and non-target apps.
openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java Adds getIndexedEntityTypes() (sorted keys from the merged index registry).
openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java Adds GET /v1/search/entityTypes endpoint (admin-or-bot).
openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/ReindexingOrchestrator.java Uses getIndexedEntityTypes() to expand "all" consistently with the UI picker source.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/SearchResourceIT.java Adds ITs for endpoint correctness (sorted, contains tableColumn) and authorization (403 for DataConsumer).
Suppressed comments (1)

openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.test.ts:69

  • When the entity-type fetch fails, keeping ['all'] in the injected enum preserves the ability to select the default/sentinel value while avoiding enum/default inconsistency during validation.
      expect(schema.properties.entities.items.enum).toEqual([]);
      expect(showErrorToast).toHaveBeenCalledWith(error);
    });

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +54 to +57
entities: {
...(schema.properties?.entities as RJSFSchema),
items: { type: 'string', enum: entityTypes },
},
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 70%
70.42% (95163/135135) 54.95% (56310/102458) 56.33% (18795/33365)

@manerow manerow left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

playwright/e2e/Pages/SearchIndexApplication.spec.ts:330 looks like it will start failing with this change.

await ...getByRole('combobox').fill('Table');
const tableTitle = page.getByRole('tree').getByTitle('Table');

The old enum had exactly one value containing table. The registry adds tableColumn, which TreeSelectWidget renders through startCase as "Table Column". AntD filters the tree on the node value using a case-insensitive substring match (rc-tree-select/OptionList.js:122), so typing Table now leaves two nodes visible.

Playwright's getByTitle also defaults to substring matching, so this locator resolves to 2 elements. waitFor (333), evaluate (336) and click (349) all run in strict mode, so line 333 would be the first to throw strict mode violation.

A minimal fix could be to make the match exact:

const tableTitle = page.getByRole('tree').getByTitle('Table', { exact: true });

Might be worth running this spec locally before merge. The description mentions it exercises the picker "unchanged", but the list it renders is no longer the same, so I do not think we can rely on it as-is.


HttpResponse<String> response = httpGetJson("/v1/search/entityTypes", consumerToken);

assertEquals(403, response.statusCode(), "Non-admin should not be able to list entity types");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will get a 404 rather than a 403.

authorizeAdminOrBot resolves the user before it can deny: DefaultAuthorizer:157 -> SubjectContext:63 -> SubjectCache.getUserContext -> Entity.getEntityByName. SearchResourceIT never creates [email protected], so that lookup throws EntityNotFoundException, which carries Response.Status.NOT_FOUND.

It could still pass by luck if another test class created that user earlier in the same server session, which would make it order-dependent rather than reliable.

AppOperationPermissionsIT.java:38-45 hits the same thing and works around it like this, if you want to reuse the pattern:

@BeforeAll
static void ensureDataConsumerUser() {
  UserTestFactory.getDataConsumer(null);
}

@ApiResponse(responseCode = "403", description = "Admin only")
})
public List<String> getIndexedEntityTypes(@Context SecurityContext securityContext) {
authorizer.authorizeAdminOrBot(securityContext);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One thing to consider: authorizeAdminOrBot is stricter than the page that calls this endpoint.

The Search Indexing app details page is gated on view permission rather than admin. SettingsRouter.tsx:551 passes hasViewPermissions(ResourceEntity.APPLICATION, ...), which is ViewBasic || ViewAll (PermissionsUtils.ts:113-114), and AdminProtectedRoute.tsx:34 renders children when isAdminUser || hasPermission. AppDetails.component.tsx:524 then calls fetchAppDetails -> importSchema on every mount.

So a non-admin holding ViewBasic or ViewAll on Application can open the page and would see a red error toast each time, for a request they never triggered.

Two ways to line the two sides up, whichever you prefer: authorize this endpoint against APPLICATION view permission instead of admin-only, or leave the endpoint as-is and skip the toast on 403 in ApplicationsClassBase.ts:47 while still toasting other failures.

lazy(() => import('../ApplicationConfiguration/ApplicationConfiguration'))
);

const SEARCH_INDEXING_APPLICATION = 'SearchIndexingApplication';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: this constant already exists as SEARCH_INDEXING_APPLICATION in src/constants/explore.constants.ts:117 with the same value, so you may want to import it instead of keeping a second copy.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 9d5310f4f25d606fd89533d4026735e03d62d863 in Playwright run 34195388774, attempt 1.

✅ 1246 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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 45s

⏱️ Max setup 4m 20s · max shard execution 17m 43s · max shard-job elapsed before upload 21m 19s · reporting 6s

🌐 210.78 requests/attempt · 2.22 app boots/UI scenario · 13.45% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 210.78 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.22 per UI scenario (2827 boots / 1271 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 156 0 0 0 0 0
✅ Shard chromium-02 145 0 0 0 0 0
✅ Shard chromium-03 157 0 0 0 0 0
✅ Shard chromium-04 147 0 0 0 0 0
✅ Shard chromium-05 157 0 0 0 0 0
🟡 Shard chromium-06 149 0 1 0 0 0
✅ Shard chromium-07 142 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 7 0 0 0 0 0
✅ Shard ingestion-01 2 0 0 0 0 0
✅ Shard reindex-01 28 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/ExploreTree.spec.ts › Copy field link should have valid URL format for APIEndpoint (shard chromium-06, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

…spec

manerow, on #32375:

- The endpoint was admin-or-bot while the page that calls it is not. SettingsRouter
  renders AppDetails for `isAdminUser || hasViewPermissions(APPLICATION)` and
  AppDetails fetches the schema on every mount, so a viewer holding ViewBasic or
  ViewAll got a red 403 toast for a request they never triggered. Authorize on
  APPLICATION/VIEW_BASIC instead, which is exactly the page's gate.

- The 403 assertion in SearchResourceIT would have been a 404: authorizeAdminOrBot
  resolves the subject first, and SubjectCache.getUserContext falls back to
  Entity.getEntityByName, which throws EntityNotFoundException for a user this
  suite never creates. It could only pass on suite ordering. Pin the user in
  @BeforeAll, as AppOperationPermissionsIT already does, and flip the assertion to
  the case that now matters: an Application viewer gets 200.

- SearchIndexApplication.spec.ts would have broken. rc-tree-select filters on the
  node value (treeNodeFilterProp defaults to 'value'), so typing "Table" leaves
  `tableColumn` visible too, and rc-tree sets title="Table Column" on it;
  getByTitle is substring by default, so the locator resolved to 2 nodes and
  waitFor threw in strict mode. Made it exact.

  The Playwright run on the first commit was green because the impact map never
  selected this spec — the Settings/** entry picks no spec that opens an app config
  form. Added a mapping for the application config forms so a change to the
  schemas, the loader, or the endpoint that fills them selects it. That also puts
  this PR in a full run, so the locator fix gets exercised.

Copilot:

- 'all' is now in the injected enum. The backend sentinel is not an index, so the
  endpoint does not return it, but `default: ["all"]` has to validate against the
  enum; TreeSelectWidget already filters it out of the child nodes. Pre-existing
  inconsistency — the old hardcoded enum omitted it too — fixed while here. It
  also makes the fetch-failure fallback `['all']` rather than empty.

- Reused SEARCH_INDEXING_APPLICATION from constants/explore.constants.ts instead of
  a second copy. Its own `SortingField` import is type-only, so this pulls nothing
  new into the bundle graph.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
yan-3005
yan-3005 previously approved these changes Sep 2, 2026
karanh37
karanh37 previously approved these changes Sep 2, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-09-03T11:28:34Z)

The entry left the queue before it was built, so no checks ran against it.

…ackend

Conflict in ApplicationsClassBase.ts: main replaced the template-literal
`import()` in importSchema with a glob loader map (`applicationSchemaLoaders`
from the new sibling .assets.ts, so ts-jest can mock what it cannot parse), which
rewrote the same lines this branch added the entity-list injection to.

Resolution keeps main's loader and re-applies the injection to the resolved
module. The react import also splits into `import type { ComponentType, FC }`
plus `import { lazy }`, matching main's move to type-only imports, so RJSFSchema
and AxiosError come in the same way.

main's new importSchema resolves to `{}`, so the two assertions this branch added
now name the shape they read instead of reaching through it untyped. The five
pre-existing `Property 'properties' does not exist on type '{}'` errors in the
same file are main's and are left alone.
@mohityadav766

Copy link
Copy Markdown
Member Author

Merged main and resolved the conflict — 8eb6a75c. Back to MERGEABLE.

The conflict

One file: ApplicationsClassBase.ts. Main replaced the template-literal import() in importSchema with a glob loader map (applicationSchemaLoaders, from the new sibling .assets.ts so ts-jest can mock what it can't parse) — which rewrote the exact lines this branch had added the entity-list injection to.

Resolution keeps main's loader and re-applies the injection to the resolved module:

const module = await loader();
const schema =
  (module as { default?: unknown }).default ??
  (module as Record<string, unknown>);

return fqn === SEARCH_INDEXING_APPLICATION
  ? withSearchEntityTypes(schema as RJSFSchema)
  : schema;

The react import also splits per main's move to type-only imports, so RJSFSchema and AxiosError come in the same way:

import type { RJSFSchema } from '@rjsf/utils';
import type { AxiosError } from 'axios';
import type { ComponentType, FC } from 'react';
import { lazy } from 'react';

Checked that main's glob mock (src/test/unit/mocks/glob.mock.js) lazily require()s from src/jsons/applicationSchemas/, so importSchema('SearchIndexingApplication') still resolves the real on-disk JSON under jest — the injection path is genuinely exercised, not stubbed away.

One thing worth flagging

Main's new importSchema resolves to {}, so property access on the result is a type error. That's 7 in this test file under tsc --noEmit — 5 of them are main's own (should import pre-parsed schema and should import the RDF app schema, unchanged on this branch; git show origin/main:…test.ts has schema.properties.entities.default with no cast). I named the shape for the 2 my tests read rather than adding to the pile:

type EntitiesEnumSchema = {
  properties: { entities: { items: { enum: string[] } } };
};

I left main's 5 alone — not my change, and touching them widens the diff for no behavioural gain. Flagging rather than silently ignoring: tsc isn't in the checkstyle gate (and the repo has unrelated errors elsewhere, e.g. AppLiveIndexing.component.tsx, BotDetails.component.tsx), so nothing is red because of it — but whoever owns the glob-loader change may want to give importSchema a real return type.

Verification after the merge

  • ApplicationsClassBase.test.ts 10/10, plus AppInstall and AppDetails — 23/23 across 3 suites.
  • eslint 0 errors, prettier --check clean on both changed files.
  • tsc — my 2 errors gone, main's 5 unchanged.
  • Confirmed every part of this PR survived the merge: the endpoint and getIndexedEntityTypes(), getAll() delegating to it, the ReindexingOrchestratorTest stub, getSearchEntityTypes in searchAPI.ts, the enum removed from both schema copies, the corrected payLoadSize description, the { exact: true } Playwright locator, and the impact-map entry.
  • git diff origin/main..HEAD --stat is exactly the 13 files this PR owns, nothing extra.

Still outstanding and not something I can do: Validate PR Metadata needs issue #32374 added to the Shipping project.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The new Playwright impact-map entry omits openmetadata-service/.../resources/search/**, so changes to the new /v1/search/entityTypes endpoint may not trigger the intended SearchIndexApplication.spec.ts run.

Review details

Suppressed comments (1)

.github/playwright/impact-map.json:348

  • The new impact-map entry is meant to cover the new backend endpoint GET /v1/search/entityTypes, but the sources list only includes .../resources/apps/** and will not match changes under .../resources/search/** (where SearchResource lives). As a result, edits to the endpoint may still ship without running SearchIndexApplication.spec.ts. Add the search resource (and optionally the core search package) to the sources list for this mapping.
        "openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/**",
        "openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/**"
      ],
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

karanh37
karanh37 previously approved these changes Sep 4, 2026
#32576 pruned one om-playwright/no-positional-locator entry out of
eslint-suppressions.json (1323 -> 1322) without lowering the number recorded in
corpus.test.mjs, so `the suppressions baseline matches its recorded state
exactly` fails on main and therefore on every branch merged with it:

  + actual   'om-playwright/no-positional-locator': 1322
  - expected 'om-playwright/no-positional-locator': 1323

Both files here are byte-identical to main, so this is not a violation this
branch introduced or fixed — only the bookkeeping the pruning PR left behind.
Lowering it is what the assertion message asks for; `yarn lint:playwright` is
already clean at 0 errors, so there is nothing to prune.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The new /v1/search/entityTypes endpoint’s authorization contract appears to diverge from the linked issue/PR description (admin-only vs Application-viewer readable) and needs an explicit decision/alignment before merge.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.ts:61

  • The error path always casts to AxiosError, so if getSearchEntityTypes fails with a non-Axios error (e.g. unexpected runtime error), showErrorToast will fall back to a generic message and lose the actual failure reason. Consider detecting an Axios-shaped error and otherwise toasting the Error message/stringified value so operators get a useful hint while still keeping the schema renderable.

openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java:870

  • The linked issue/PR description describes this endpoint as "admin-or-bot" / rejected for non-admins, but the implementation authorizes any principal with Application VIEW_BASIC. This expands access substantially (e.g. DataConsumer with broad view permissions) and changes the security contract. Please confirm the intended audience and align either (a) the authorization gate (e.g. authorizeAdmin/explicit bot policy) or (b) the issue/PR docs + tests to reflect that Application viewers can call it.
    OperationContext operationContext =
        new OperationContext(Entity.APPLICATION, MetadataOperation.VIEW_BASIC);
    authorizer.authorize(
        securityContext, operationContext, new ResourceContext<>(Entity.APPLICATION));
  • Files reviewed: 14/14 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

…ackend

Conflict in corpus.test.mjs: main burned the playwright suppressions down
further — no-blanket-test-slow is gone entirely (83 -> 0) and
no-positional-locator is 1310 — and fixed the 1323/1322 bookkeeping this branch
had patched. Took main's block wholesale; the one-line fix in 6b2682f is
superseded and this file is byte-identical to main again.
karanh37
karanh37 previously approved these changes Sep 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are at least two correctness/contract issues to resolve (Playwright impact-map source glob mismatch and an auth contract mismatch vs the PR/issue description) before this is safe to merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

.github/playwright/impact-map.json:372

  • The new Playwright impact-map entry is intended to cover the new backend endpoint, but the source glob points at resources/apps/** while the endpoint lives under resources/search/**. As written, changes to SearchResource (including /v1/search/entityTypes) may not trigger the intended specs.
        "openmetadata-ui/src/main/resources/ui/src/jsons/applicationSchemas/**",
        "openmetadata-service/src/main/java/org/openmetadata/service/apps/bundles/searchIndex/**",
        "openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/**"
      ],

openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java:871

  • Authorization for this endpoint currently checks Application VIEW_BASIC, but the PR description/linked issue describe it as “admin-or-bot”. Please confirm the intended security contract and align either the implementation (e.g. authorizer.authorizeAdminOrBot(securityContext)) or the PR description/tests accordingly.
    OperationContext operationContext =
        new OperationContext(Entity.APPLICATION, MetadataOperation.VIEW_BASIC);
    authorizer.authorize(
        securityContext, operationContext, new ResourceContext<>(Entity.APPLICATION));

  • Files reviewed: 13/13 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +58 to +61
} catch (error) {
// Leaves the picker with only "All" selectable rather than failing the whole form.
showErrorToast(error as AxiosError);
}
mohityadav766 and others added 2 commits September 7, 2026 12:12
ApplicationConfiguration validates with @rjsf/validator-ajv8 against the stored
appConfiguration, so injecting `enum: ["all"]` on a failed fetch made a saved
`entities: ["table", ...]` fail validation — during a transient outage an admin
could not save the form at all, including edits to unrelated fields. Return the
schema untouched instead: the picker degrades to a plain list, but the stored
selection stays visible and editable. The toast still fires.

Also add the endpoint's own files to the impact-map entry. It listed
resources/apps/** and the searchIndex bundle but not the two files that actually
produce the list, so editing /v1/search/entityTypes or getIndexedEntityTypes()
would not have selected the picker spec — the exact gap the entry exists to close.

Both found by Copilot on a111a47.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It introduces a new backend API + authorization gate and a cross-layer UI schema injection path that should be validated by green CI (including integration/Playwright lanes) before approval.

Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 1 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 1 warning(s) across 1 changed file(s).

Count Rule
1 openmetadata-imports/no-internal-barrel-imports
All findings
Location Rule Message
🟡 src/rest/searchAPI.ts:27:1 openmetadata-imports/no-internal-barrel-imports Import the internal module directly instead of its index barrel so unrelated siblings do not enter the bundle graph.

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change centralizes the entity type source of truth end-to-end (backend + UI) and includes targeted regression tests to prevent future drift.

Review details

Suppressed comments (1)

openmetadata-service/src/main/java/org/openmetadata/service/resources/search/SearchResource.java:870

  • PR description/test plan says GET /v1/search/entityTypes is rejected for non-admins, but this endpoint is explicitly authorized by APPLICATION/VIEW_BASIC (and the added IT even asserts a non-admin DataConsumer can read it). Please align the PR description (and any downstream docs) with the implemented authorization model so reviewers/users aren’t misled about who can call this endpoint.
  public List<String> getIndexedEntityTypes(@Context SecurityContext securityContext) {
    // Gate on Application view, not admin: SettingsRouter renders the app details page for
    // `isAdminUser || hasViewPermissions(APPLICATION)` and that page fetches the config schema on
    // every mount, so an admin-only check here would 403 a legitimate viewer on a request they
    // never triggered.
    OperationContext operationContext =
        new OperationContext(Entity.APPLICATION, MetadataOperation.VIEW_BASIC);
    authorizer.authorize(
        securityContext, operationContext, new ResourceContext<>(Entity.APPLICATION));
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-07T12:10:20Z)

Blocked the queue: playwright-summary

@mohityadav766

Copy link
Copy Markdown
Member Author

Both merge-queue failures on 7a2bfa75 are pre-existing breakage on the queue base, not from this PR. The unit-test one is worth flagging beyond this PR — main's green on it is a skip, not a pass.

OpenMetadata Service Unit Tests — a latent semantic conflict on main

3 failures, all in DataContractPipelineTokenRefreshTest (6 run / 3 failed, out of 8751):

expected: <PipelineServiceClientException> but was: <BadRequestException>
  Caused by: BadRequestException: sourceConfig.config.type is required
expected: <[stale-jwt-token, rotated-jwt-token]> but was: <[]>

Two PRs that were each green on their own:

private IngestionPipeline testSuitePipeline(boolean deployed) {
  return new IngestionPipeline()
      .withId(UUID.randomUUID())
      .withName("dq-pipeline")
      .withFullyQualifiedName("dq-pipeline")
      .withPipelineType(PipelineType.TEST_SUITE)
      .withDeployed(deployed);          // ← no sourceConfig
}

So the new validation rejects the fixture before the deploy path runs — which is also why the second assertion sees []: no tokens were ever captured because no deploy happened.

Why it looks like mine and isn't:

  • #29566 is an ancestor of my queue base 19af6248 — git merge-base --is-ancestor 27063928f7 19af6248 passes. The validation was there before my commit.
  • The batch 19af6248..7a2bfa75 contains exactly one commit (mine), so the queue points the finger here.
  • But main's own run on that identical base (run 34120336607) reports success with openmetadata-service-unit-tests skipped — the job is path-filtered by Detect Changes, and that merge touched no Java. So main was never actually verified on this base.
  • This PR touches Java, so the queue run actually executed the suite and surfaced it. The unrelated queue entry PR Fixes #32639: deserialize and decrypt ingestion-bot JWT token in K8sPipelineClient #32708 (run 34129000151) does the same and fails the identical 3 tests.

Net: any Java-touching PR that queues will hit this until the fixture and the validation agree. Worth someone looking at the path filter too — it means Java breakage can sit on main invisibly and only detonate in the queue.

I have not patched it here, deliberately: the fix has a real design question in it (does a TEST_SUITE pipeline legitimately need a sourceConfig.config.type, or should the new validation exempt that type?), and that is #29566's and #31848's call, not mine. Happy to push the one-line fixture change if either owner tells me which way they want it.

Postgresql PR Playwright E2E Tests — unrelated flake

One failure, chromium-13:

Tag.spec.ts:563 › Tag Page with Data Steward Roles › Add and Remove Assets for Data Steward
  Test timeout of 60000ms exceeded.
  expect(locator).toContainText("0") failed — element(s) not found
  waiting for getByTestId('assets').getByTestId('filter-count')

A Tag-page asset filter-count badge that never rendered. SearchIndexApplication.spec.ts was not in that shard at all (grep -c = 0), and nothing in this PR touches tags, assets, or Data Steward roles.

This PR

Nothing to change — review is APPROVED and the last push (a5f6e1ef) was green on the PR checks. It just needs re-queueing once main's DataContractPipelineTokenRefreshTest is sorted. The only thing still on our side is the Validate PR Metadata item: issue #32374 into the Shipping project.

@gitar-bot

gitar-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Fixes the Search Indexing entity picker to serve the current index registry instead of a stale hardcoded enum, closing a 15-entity gap and ensuring newly registered types are immediately selectable. The backend now exposes GET /v1/search/entityTypes, the UI schema enum is removed, and the picker is populated server-side at render time — with graceful fallback to an empty list if the fetch fails. Consider documenting or enforcing the *Application.svg logo naming convention to avoid silent fallbacks for future or variant deployments.

💡 Edge Case: App-logo glob narrowed to *Application.svg drops non-conforming logos

📄 openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.ts:111-122

appLogoLoaders now globs only ../../../../assets/svg/*Application.svg, whereas the old dynamic import(.../${appName}.svg) could load any SVG matching the app name. Today all bundled app logos follow the *Application.svg convention so this is safe, but any future or Collate-shipped app whose logo file does not end in Application.svg will silently fall back to DefaultAppLogo with no error. Consider widening the glob (e.g. *.svg filtered at lookup, or documenting the naming requirement) if non-conforming logos are ever expected.

🤖 Prompt for agents
Code Review: Fixes the Search Indexing entity picker to serve the current index registry instead of a stale hardcoded enum, closing a 15-entity gap and ensuring newly registered types are immediately selectable. The backend now exposes `GET /v1/search/entityTypes`, the UI schema enum is removed, and the picker is populated server-side at render time — with graceful fallback to an empty list if the fetch fails. Consider documenting or enforcing the `*Application.svg` logo naming convention to avoid silent fallbacks for future or variant deployments.

1. 💡 Edge Case: App-logo glob narrowed to *Application.svg drops non-conforming logos
   Files: openmetadata-ui/src/main/resources/ui/src/components/Settings/Applications/AppDetails/ApplicationsClassBase.ts:111-122

   `appLogoLoaders` now globs only `../../../../assets/svg/*Application.svg`, whereas the old dynamic `import(`.../${appName}.svg`)` could load any SVG matching the app name. Today all bundled app logos follow the `*Application.svg` convention so this is safe, but any future or Collate-shipped app whose logo file does not end in `Application.svg` will silently fall back to `DefaultAppLogo` with no error. Consider widening the glob (e.g. `*.svg` filtered at lookup, or documenting the naming requirement) if non-conforming logos are ever expected.

Options

Display: compact → Showing less information.

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

@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-08T17:38:52Z)

Blocked the queue: py-tests-status, py-tests-status, playwright-summary, integration-tests-mysql-elasticsearch

This branch was previously deployed

1 inactive deployment
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search Indexing app: entity list should come from the backend, not a hardcoded enum in the UI schema

6 participants