Skip to content

Fix column filtering on Lineage - #25353

Merged
chirag-madlani merged 108 commits into
mainfrom
fix-column-filtering
Apr 6, 2026
Merged

chirag-madlani merged 108 commits into
mainfrom
fix-column-filtering

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Jan 18, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fix #24246

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.


Summary by Gitar

  • Test fixes:
    • Enabled 4 previously skipped Playwright tests for lineage and impact analysis service filter selection

This will update automatically on new commits.

@mohityadav766 mohityadav766 self-assigned this Jan 18, 2026
@mohityadav766 mohityadav766 added the UI UI specific issues label Jan 18, 2026
@mohityadav766
mohityadav766 requested a review from a team as a code owner January 18, 2026 06:03
@mohityadav766 mohityadav766 added the To release Will cherry-pick this PR into the release branch label Jan 18, 2026
@mohityadav766
mohityadav766 requested a review from a team as a code owner January 18, 2026 06:03
@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Jan 18, 2026
harshach
harshach previously approved these changes Jan 18, 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

Copilot reviewed 149 out of 197 changed files in this pull request and generated 1 comment.

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

Copilot reviewed 149 out of 197 changed files in this pull request and generated 1 comment.

Comment on lines +110 to +112
ColumnMetadataCache cache = new ColumnMetadataCache();
AtomicInteger batchFetches = new AtomicInteger();
AtomicInteger fallbackFetches = new AtomicInteger();

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

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

This test uses AtomicInteger but the diff snippet does not show an import being added for it. Ensure java.util.concurrent.atomic.AtomicInteger is imported, otherwise the test file won't compile.

Copilot uses AI. Check for mistakes.

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

Copilot reviewed 149 out of 197 changed files in this pull request and generated 5 comments.

description =
"Column-level lineage filter. Supports filtering by column names, tags, or glossary terms (e.g., 'columnName:customer_id', 'tag:PII', 'glossary:BusinessTerm')")
@QueryParam("columnFilter")
@QueryParam("column_filter")

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

This changes public query parameter names from columnFilter/preservePaths to column_filter/preserve_paths for existing endpoints, which is a breaking API change for clients that still send camelCase params. To avoid breaking existing integrations, consider accepting both names (e.g., support both @QueryParam(\"columnFilter\") and @QueryParam(\"column_filter\") and coalesce), or provide a deprecation window.

Copilot uses AI. Check for mistakes.
description =
"When true, preserves all nodes in the path to filtered results. When false, only returns nodes matching the filter. Default is true.")
@QueryParam("preservePaths")
@QueryParam("preserve_paths")

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

This changes public query parameter names from columnFilter/preservePaths to column_filter/preserve_paths for existing endpoints, which is a breaking API change for clients that still send camelCase params. To avoid breaking existing integrations, consider accepting both names (e.g., support both @QueryParam(\"columnFilter\") and @QueryParam(\"column_filter\") and coalesce), or provide a deprecation window.

Copilot uses AI. Check for mistakes.
Comment on lines +158 to +168
public String getLineageByEntityCount(
String fqn,
String direction,
int from,
int size,
Integer nodeDepth,
int maxDepth,
boolean includeDeleted,
String queryFilter,
String columnFilter,
String entityType)

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

The server-side entity-count endpoint now supports additional toggles (preserve_paths, include_pagination_info, and also upstream/downstream depth inputs). The SDK wrapper doesn’t expose these new parameters, which makes the new capability inaccessible via the SDK and can force consumers to drop down to raw HTTP. Consider adding overloads/params to cover the new query params so the SDK remains feature-complete with the REST API.

Copilot uses AI. Check for mistakes.
Comment on lines 100 to 103
Map<String, Object> entityDoc = entityFetcher.fetchEntity(parentFqn);
extractColumnMetadata(parentFqn, entityDoc, entry.getValue());
loadedParentFqns.add(parentFqn);
} catch (Exception e) {

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

entityFetcher.fetchEntity(parentFqn) can return null (or an empty/malformed document) in some implementations; extractColumnMetadata(...) will then throw a NullPointerException. Add a null guard (similar to the batch-loading path) and skip/mark the parent as loaded or log accordingly to avoid repeated failing fetches.

Suggested change
Map<String, Object> entityDoc = entityFetcher.fetchEntity(parentFqn);
extractColumnMetadata(parentFqn, entityDoc, entry.getValue());
loadedParentFqns.add(parentFqn);
} catch (Exception e) {
Map<String, Object> entityDoc = entityFetcher.fetchEntity(parentFqn);
if (nullOrEmpty(entityDoc)) {
LOG.warn("Skipping metadata load for parent entity {} because no entity document was returned", parentFqn);
loadedParentFqns.add(parentFqn);
continue;
}
extractColumnMetadata(parentFqn, entityDoc, entry.getValue());
loadedParentFqns.add(parentFqn);
} catch (Exception e) {
loadedParentFqns.add(parentFqn);

Copilot uses AI. Check for mistakes.
Comment on lines +34 to 35
@Slf4j
public class LineageUtil {

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

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

With Lombok @Slf4j, the generated logger is log, not LOG. If this class doesn’t already define a LOG field elsewhere, this won’t compile. Align by either using the Lombok-generated log consistently, or remove @Slf4j and keep the existing logger pattern.

Copilot uses AI. Check for mistakes.

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@gitar-bot

gitar-bot Bot commented Apr 6, 2026 •

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 31 resolved / 40 findings

Fixes column filtering on Lineage with comprehensive test coverage and resolved 22+ filtering and query logic issues. However, 9 findings remain open including missing SearchIndex.ML_MODEL_SERVICE in entityIconMapping, useEffect resetting name/description on test-case selection, incomplete SLF4J log messages, and several minor issues with pagination counts, unchecked casts, and hardcoded values that should be addressed before merge.

⚠️ Bug: entityIconMapping lost SearchIndex.ML_MODEL_SERVICE key

The refactoring of entityIconMapping from an inline object to a module-level constant removed many duplicate SearchIndex.* / EntityType.* entries that had identical string values. However, SearchIndex.ML_MODEL_SERVICE = 'mlModelService' (capital M) differs from EntityType.MLMODEL_SERVICE = 'mlmodelService' (lowercase m). The old code had both keys mapping to MlModelIcon; the new code only keeps the EntityType entry. Any code path that calls getEntityIcon with the SearchIndex.ML_MODEL_SERVICE value ('mlModelService') will no longer resolve an icon.

Suggested fix
Add the missing entry back to entityIconMapping:

  [SearchIndex.ML_MODEL_SERVICE]: MlModelIcon,

Alternatively, audit all removed SearchIndex entries
against their EntityType counterparts to confirm
string equality before deduplicating.
⚠️ Bug: useEffect resets name/description on every test-case selection

The useEffect at line 206-214 in BundleSuiteForm.tsx includes testCaseSelectionPayload in its dependency array. Every time the user selects or deselects a test case, handleTestCaseSelection calls setTestCaseSelectionPayload(payload), which triggers this effect. The effect then calls form.setFieldsValue({ name: initialValues.name || '', description: initialValues.description || '', testCaseSelection: testCaseSelectionPayload }), overwriting whatever the user has typed into the name and description fields with the initial values.

This means: user types a bundle suite name → selects a test case → name field is reset to empty (or initial value). This makes the form unusable when initialValues has no name (the common "create new" path).

The fix is to either remove testCaseSelectionPayload from the dependency array (since handleTestCaseSelection already syncs the form field directly on line 222), or split the effect so form field initialization only runs once on mount.

Suggested fix
useEffect(() => {
  if (initialValues) {
    form.setFieldsValue({
      name: initialValues.name || '',
      description: initialValues.description || '',
      testCaseSelection: testCaseSelectionPayload,
    } as Record<string, unknown>);
  }
  // Only run on mount / when initialValues change
  // testCaseSelectionPayload sync is handled by handleTestCaseSelection
}, [initialValues, form]);
💡 Edge Case: Pagination counts empty for current direction when nodeDepth=0

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ESLineageGraphBuilder.java:757-768 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OSLineageGraphBuilder.java:757-768

In buildEntityCountPaginationInfo, when nodeDepth == 0 the early return passes an empty currentDirectionDepthCounts map (initialized as new LinkedHashMap<>() at line 741 and never populated before the early return at line 759). This means the current direction's depth counts will only contain the root entry {0: 1}, while the opposite direction may compute full counts via getEntityCountDepthCounts. The pagination info shown to the user for the current direction will report totalEntities = 1 (just root).

This is likely only cosmetic since depth-0 is an edge case (the UI depth dropdown probably starts at 1+), and increasing depth triggers a fresh pagination info fetch. However, if it's reachable, the upstream/downstream toggle badges would show incorrect totals.

Suggested fix
When `nodeDepth == 0` and `includePaginationInfo` is true, compute the current direction's counts via `getEntityCountDepthCounts` instead of using the empty `currentDirectionDepthCounts`:

// Replace the early-return pagination block with:
if (Boolean.TRUE.equals(request.getIncludePaginationInfo())) {
  // currentDirectionDepthCounts is empty at depth 0;
  // compute fresh counts for both directions.
  result.setPaginationInfo(
      buildEntityCountPaginationInfo(
          request, hasNodeLevelQueryFilter,
          structuralQueryFilter,
          getEntityCountDepthCounts(...)));
}
💡 Bug: Incomplete SLF4J log messages missing placeholders after refactoring

Several String.format → SLF4J conversions dropped the second placeholder {}, leaving incomplete message text ending with "due to " or similar. In SLF4J, when the last argument is a Throwable and there's no matching {}, it's logged as a stack trace—so exception info isn't lost—but the message text is grammatically incomplete and inconsistent with the original intent.

Examples:

  • "Could not initialize bot for pipeline [{}] due to " — was "...due to [%s]"
  • "Error updating automator [{}] due to " — was "...due to [%s]"
  • "Error migrating app extension [{}] due to " — was "...due to [%s]"
  • "Error in sending invite to User{}" — missing space before {}
  • "Error in sending mail for reset password{}" — missing space before {}
Suggested fix
// OpenMetadataConnectionBuilder.java:80
LOG.warn(
    "Could not initialize bot for pipeline [{}] due to ",
    ingestionPipeline.getPipelineType(),
    e);
// should be:
LOG.warn(
    "Could not initialize bot for pipeline [{}]",
    ingestionPipeline.getPipelineType(),
    e);

// UserResource.java:735
LOG.error("Error in sending invite to User: {}", ex.getMessage());
💡 Quality: Repeated unchecked casts of raw Map in line chart aggregator

The refactoring removed a single typed local variable Map<String, MetricFormulaHolder> metricFormulaHolderInternal = metricFormulaHolder and replaced it with three separate inline unchecked casts ((Map<String, MetricFormulaHolder>) metricFormulaHolder). This is more verbose, harder to read, and duplicates the cast logic. The original single-assignment approach was actually cleaner—consider restoring it or fixing the interface to use generics.

Suggested fix
// Restore the typed local variable at the top of the method:
@SuppressWarnings("unchecked")
Map<String, MetricFormulaHolder> metricFormulaHolderTyped =
    (Map<String, MetricFormulaHolder>) metricFormulaHolder;
// Then use metricFormulaHolderTyped throughout
💡 Quality: Debug console.log left in test utility

📄 openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:864 📄 openmetadata-ui/src/main/resources/ui/src/context/LineageProvider/LineageProvider.tsx:1723 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageFilters.spec.ts:604

A console.log('Expected Row:', expectedRow, parsedData) statement was added to verifyColumnLineageInCSV. This appears to be a debugging aid that was accidentally left in. It will produce noisy output in every test run that exercises CSV lineage verification.

Suggested fix
Remove the console.log statement.
💡 Performance: Unnecessary JSON string round-trip; use valueToTree directly

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java:573-574 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java:1495-1496

The code serializes the response POJO to a JSON string via pojoToJson() and then parses it back to a JsonNode via readTree(). This double conversion is unnecessary since JsonUtils.valueToTree(response) converts a POJO directly to a JsonNode without the intermediate string allocation and parsing. This pattern appears in both export methods.

Suggested fix
// Replace:
String jsonResponse = JsonUtils.pojoToJson(response);
JsonNode rootNode = JsonUtils.readTree(jsonResponse);

// With:
JsonNode rootNode = JsonUtils.valueToTree(response);
💡 Security: Hardcoded localhost fallback in MCP callback URL resolution

In McpCallbackServlet.resolveBaseUrl(), if both the MCP config and system repository fail to provide a base URL, the method falls back to http://localhost:8585 (line 124). In production deployments where config is temporarily unavailable (e.g., during startup race conditions), this would cause the OAuth redirect to go to localhost, which would fail silently for end users and could potentially leak auth codes to localhost listeners. The method already logs warnings for the failure cases, but the fallback value is unsafe.

Suggested fix
Consider throwing an IllegalStateException instead of
falling back to localhost, so the error is surfaced clearly:

throw new IllegalStateException(
    "Cannot resolve base URL from MCP config or system settings. "
    + "Configure openMetadataUrl in system settings.");
💡 Quality: McpExecutionDAO insert methods accept unused bind parameters

The insert and insertWithoutExtension methods in McpExecutionDAO override the parent EntityTimeSeriesDAO signatures but their SQL only uses :json. The parameters entityFQNHash, jsonSchema, and extension are accepted but silently ignored. While this works correctly because the mcp_execution_entity table only has id, serverId, json, and timestamp columns (all generated from JSON), it violates the implicit contract of the parent interface where these parameters are expected to be persisted.

This could cause subtle issues if someone later tries to query by entityFQNHash or extension expecting them to be stored.

✅ 31 resolved
✅ Bug: Column-level filters sent twice with different semantics
✅ Quality: Large code duplication between ES and OS graph builders

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ESLineageGraphBuilder.java:675 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OSLineageGraphBuilder.java:676
The searchLineageByEntityCount method changes (lines 675-714) are identical between ESLineageGraphBuilder and OSLineageGraphBuilder. The same logic for needsPathPreservation, cache checks, applyInMemoryFiltersWithPathPreservationForEntityCount, and the downstream edge fix are copy-pasted. The new AbstractLineageGraphBuilder base class was introduced in this PR but the duplicated methods weren't pulled up into it.

✅ Bug: hasNodeLevelFilters uses substring match on raw JSON string

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ESLineageGraphBuilder.java:1179 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ESLineageGraphBuilder.java:1156 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OSLineageGraphBuilder.java:1181 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OSLineageGraphBuilder.java:1158
hasNodeLevelFilters and getStructuralFilterOnly use String.contains() on the raw JSON query filter string to classify filter types. This is fragile because it matches substrings in values, not just field names.

For example, if a user filters by an entity whose FQN contains "service" (e.g., my_service_table), hasNodeLevelFilters returns true even though no actual service filter is applied. This triggers the expensive unfiltered-fetch-then-in-memory-filter path unnecessarily and bypasses the entity-count cache.

Similarly, getStructuralFilterOnly rejects filters containing "tag" anywhere — a deleted:true filter on an entity named "staging" would pass, but one on an entity named "tag_manager" would not.

This applies to both ESLineageGraphBuilder and OSLineageGraphBuilder (identical implementations).

✅ Bug: Local dev config leaked: hardcoded private IP and changed DB/search defaults

📄 conf/openmetadata.yaml:206 📄 conf/openmetadata.yaml:211 📄 conf/openmetadata.yaml:399 📄 conf/openmetadata.yaml:407
The openmetadata.yaml default configuration was changed from MySQL to PostgreSQL with a hardcoded private IP address (192.168.29.7), the search type default was flipped from elasticsearch to opensearch, and a cluster alias openmetadata was added. These appear to be local development settings that were accidentally committed. Any deployment relying on these defaults (without explicit env-var overrides) will attempt to connect to the wrong database driver, a non-routable private IP, and the wrong search backend.

✅ Bug: Combined name+filter search uses AND for name/displayName

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/QueryFilterParser.java:386 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/QueryFilterParser.java:253 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/QueryFilterParser.java:260
When a user combines a name/displayName search with another filter (e.g., tag, domain, tier), isNameSearch() returns false because parsedFilter.size() != 2. The code then falls through to the AND loop, which requires the entity to match BOTH name AND displayName independently. Entities that only have a name but no displayName (or vice versa) will be incorrectly excluded from results.

For example, searching for table "foo" filtered by a specific tag would produce a parsedFilter with 3 keys (name, displayName, tag). isNameSearch returns false, the AND loop requires all three fields to match, and any entity without a displayName fails.

...and 26 more resolved from earlier reviews

🤖 Prompt for agents
Code Review: Fixes column filtering on Lineage with comprehensive test coverage and resolved 22+ filtering and query logic issues. However, 9 findings remain open including missing SearchIndex.ML_MODEL_SERVICE in entityIconMapping, useEffect resetting name/description on test-case selection, incomplete SLF4J log messages, and several minor issues with pagination counts, unchecked casts, and hardcoded values that should be addressed before merge.

1. 💡 Edge Case: Pagination counts empty for current direction when nodeDepth=0
   Files: openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ESLineageGraphBuilder.java:757-768, openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OSLineageGraphBuilder.java:757-768

   In `buildEntityCountPaginationInfo`, when `nodeDepth == 0` the early return passes an empty `currentDirectionDepthCounts` map (initialized as `new LinkedHashMap<>()` at line 741 and never populated before the early return at line 759). This means the current direction's depth counts will only contain the root entry `{0: 1}`, while the opposite direction may compute full counts via `getEntityCountDepthCounts`. The pagination info shown to the user for the current direction will report `totalEntities = 1` (just root).
   
   This is likely only cosmetic since depth-0 is an edge case (the UI depth dropdown probably starts at 1+), and increasing depth triggers a fresh pagination info fetch. However, if it's reachable, the upstream/downstream toggle badges would show incorrect totals.

   Suggested fix:
   When `nodeDepth == 0` and `includePaginationInfo` is true, compute the current direction's counts via `getEntityCountDepthCounts` instead of using the empty `currentDirectionDepthCounts`:
   
   // Replace the early-return pagination block with:
   if (Boolean.TRUE.equals(request.getIncludePaginationInfo())) {
     // currentDirectionDepthCounts is empty at depth 0;
     // compute fresh counts for both directions.
     result.setPaginationInfo(
         buildEntityCountPaginationInfo(
             request, hasNodeLevelQueryFilter,
             structuralQueryFilter,
             getEntityCountDepthCounts(...)));
   }

2. 💡 Bug: Incomplete SLF4J log messages missing placeholders after refactoring

   Several `String.format` → SLF4J conversions dropped the second placeholder `{}`, leaving incomplete message text ending with "due to " or similar. In SLF4J, when the last argument is a `Throwable` and there's no matching `{}`, it's logged as a stack trace—so exception info isn't lost—but the message text is grammatically incomplete and inconsistent with the original intent.
   
   Examples:
   - `"Could not initialize bot for pipeline [{}] due to "` — was `"...due to [%s]"`
   - `"Error updating automator [{}] due to "` — was `"...due to [%s]"`
   - `"Error migrating app extension [{}] due to "` — was `"...due to [%s]"`
   - `"Error in sending invite to User{}"` — missing space before `{}`
   - `"Error in sending mail for reset password{}"` — missing space before `{}`

   Suggested fix:
   // OpenMetadataConnectionBuilder.java:80
   LOG.warn(
       "Could not initialize bot for pipeline [{}] due to ",
       ingestionPipeline.getPipelineType(),
       e);
   // should be:
   LOG.warn(
       "Could not initialize bot for pipeline [{}]",
       ingestionPipeline.getPipelineType(),
       e);
   
   // UserResource.java:735
   LOG.error("Error in sending invite to User: {}", ex.getMessage());

3. 💡 Quality: Repeated unchecked casts of raw Map in line chart aggregator

   The refactoring removed a single typed local variable `Map<String, MetricFormulaHolder> metricFormulaHolderInternal = metricFormulaHolder` and replaced it with three separate inline unchecked casts `((Map<String, MetricFormulaHolder>) metricFormulaHolder)`. This is more verbose, harder to read, and duplicates the cast logic. The original single-assignment approach was actually cleaner—consider restoring it or fixing the interface to use generics.

   Suggested fix:
   // Restore the typed local variable at the top of the method:
   @SuppressWarnings("unchecked")
   Map<String, MetricFormulaHolder> metricFormulaHolderTyped =
       (Map<String, MetricFormulaHolder>) metricFormulaHolder;
   // Then use metricFormulaHolderTyped throughout

4. ⚠️ Bug: entityIconMapping lost SearchIndex.ML_MODEL_SERVICE key

   The refactoring of `entityIconMapping` from an inline object to a module-level constant removed many duplicate `SearchIndex.*` / `EntityType.*` entries that had identical string values. However, `SearchIndex.ML_MODEL_SERVICE` = `'mlModelService'` (capital M) differs from `EntityType.MLMODEL_SERVICE` = `'mlmodelService'` (lowercase m). The old code had both keys mapping to `MlModelIcon`; the new code only keeps the `EntityType` entry. Any code path that calls `getEntityIcon` with the `SearchIndex.ML_MODEL_SERVICE` value (`'mlModelService'`) will no longer resolve an icon.

   Suggested fix:
   Add the missing entry back to entityIconMapping:
   
     [SearchIndex.ML_MODEL_SERVICE]: MlModelIcon,
   
   Alternatively, audit all removed SearchIndex entries
   against their EntityType counterparts to confirm
   string equality before deduplicating.

5. ⚠️ Bug: useEffect resets name/description on every test-case selection

   The useEffect at line 206-214 in BundleSuiteForm.tsx includes `testCaseSelectionPayload` in its dependency array. Every time the user selects or deselects a test case, `handleTestCaseSelection` calls `setTestCaseSelectionPayload(payload)`, which triggers this effect. The effect then calls `form.setFieldsValue({ name: initialValues.name || '', description: initialValues.description || '', testCaseSelection: testCaseSelectionPayload })`, overwriting whatever the user has typed into the name and description fields with the initial values.
   
   This means: user types a bundle suite name → selects a test case → name field is reset to empty (or initial value). This makes the form unusable when `initialValues` has no name (the common "create new" path).
   
   The fix is to either remove `testCaseSelectionPayload` from the dependency array (since `handleTestCaseSelection` already syncs the form field directly on line 222), or split the effect so form field initialization only runs once on mount.

   Suggested fix:
   useEffect(() => {
     if (initialValues) {
       form.setFieldsValue({
         name: initialValues.name || '',
         description: initialValues.description || '',
         testCaseSelection: testCaseSelectionPayload,
       } as Record<string, unknown>);
     }
     // Only run on mount / when initialValues change
     // testCaseSelectionPayload sync is handled by handleTestCaseSelection
   }, [initialValues, form]);

6. 💡 Quality: Debug console.log left in test utility
   Files: openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts:864, openmetadata-ui/src/main/resources/ui/src/context/LineageProvider/LineageProvider.tsx:1723, openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage/LineageFilters.spec.ts:604

   A `console.log('Expected Row:', expectedRow, parsedData)` statement was added to `verifyColumnLineageInCSV`. This appears to be a debugging aid that was accidentally left in. It will produce noisy output in every test run that exercises CSV lineage verification.

   Suggested fix:
   Remove the console.log statement.

7. 💡 Performance: Unnecessary JSON string round-trip; use valueToTree directly
   Files: openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java:573-574, openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/LineageRepository.java:1495-1496

   The code serializes the response POJO to a JSON string via `pojoToJson()` and then parses it back to a `JsonNode` via `readTree()`. This double conversion is unnecessary since `JsonUtils.valueToTree(response)` converts a POJO directly to a `JsonNode` without the intermediate string allocation and parsing. This pattern appears in both export methods.

   Suggested fix:
   // Replace:
   String jsonResponse = JsonUtils.pojoToJson(response);
   JsonNode rootNode = JsonUtils.readTree(jsonResponse);
   
   // With:
   JsonNode rootNode = JsonUtils.valueToTree(response);

8. 💡 Security: Hardcoded localhost fallback in MCP callback URL resolution

   In `McpCallbackServlet.resolveBaseUrl()`, if both the MCP config and system repository fail to provide a base URL, the method falls back to `http://localhost:8585` (line 124). In production deployments where config is temporarily unavailable (e.g., during startup race conditions), this would cause the OAuth redirect to go to localhost, which would fail silently for end users and could potentially leak auth codes to localhost listeners. The method already logs warnings for the failure cases, but the fallback value is unsafe.

   Suggested fix:
   Consider throwing an IllegalStateException instead of
   falling back to localhost, so the error is surfaced clearly:
   
   throw new IllegalStateException(
       "Cannot resolve base URL from MCP config or system settings. "
       + "Configure openMetadataUrl in system settings.");

9. 💡 Quality: McpExecutionDAO insert methods accept unused bind parameters

   The `insert` and `insertWithoutExtension` methods in `McpExecutionDAO` override the parent `EntityTimeSeriesDAO` signatures but their SQL only uses `:json`. The parameters `entityFQNHash`, `jsonSchema`, and `extension` are accepted but silently ignored. While this works correctly because the `mcp_execution_entity` table only has `id`, `serverId`, `json`, and `timestamp` columns (all generated from JSON), it violates the implicit contract of the parent interface where these parameters are expected to be persisted.
   
   This could cause subtle issues if someone later tries to query by `entityFQNHash` or `extension` expecting them to be stored.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

sonarqubecloud Bot commented Apr 6, 2026

Copy link
Copy Markdown

@sonarqubecloud

sonarqubecloud Bot commented Apr 6, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.12.5 branch.
Please cherry-pick the changes manually.
You can find more details here.

This branch was previously deployed

1 inactive deployment
test — 82fc208b Deployed Apr 6, 2026 by chirag-madlani via playwright-ci-postgresql (2, 6) #40608
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 To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

Lineage - Impact Analysis column level filters are not taking effect

10 participants