Skip to content

Fixes #36615: resolve bare nested-column description suggestion paths to the child column - #36632

Closed
detail-app[bot] wants to merge 2 commits into
mainfrom
detail/bug-fix/fixes-36615-resolve-bare-nested-column-description-e0f4cf
Closed

detail-app[bot] wants to merge 2 commits into
mainfrom
detail/bug-fix/fixes-36615-resolve-bare-nested-column-description-e0f4cf

Conversation

@detail-app

@detail-app detail-app Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Detail bug report: View on Detail

Describe your changes:

Fixes #36615

When a migrated legacy nested-column description suggestion was approved, the accepted text silently overwrote the parent column's description while the nested child the user intended stayed unchanged — and the operation reported success.

Root cause: FieldPathUtils.parseFieldPath's dot-separator branch treated any trailing 3rd+ segment as a "property" (description/tags). The v2.0.0 suggestion→task migration (MigrationUtil.extractFieldPathFromEntityLink) never appends an explicit .description, so an unquoted nested-column link <#E::table::…::columns::profile.child> migrated to the bare path columns.profile.child. That was mis-parsed as {field=profile, property=child}, and the description walkers ignore property entirely — so the write landed on the parent column profile and reported success. The read path (getFieldDescription) had the identical defect, so the pre-write no-op comparison also read the wrong column.

I worked on this because approving a suggestion is a destructive, versioned write; a silent mis-target here is data corruption that only surfaces later via the column change event.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

The fix is in openmetadata-service/.../FieldPathUtils.java, with two layers:

  1. Parser — the dot branch now treats the trailing segment as a property only when it is a known property (description/tags, in a new KNOWN_FIELD_PROPERTIES set); otherwise the segment folds into fieldName. So columns.profile.child resolves to {field=profile.child, property=description}, matching how the quoted form columns."profile.child" already resolved. The producer (MigrationUtil.extractFieldPathFromEntityLink) is unchanged — both already-migrated rows and future migrations now resolve correctly.
  2. Defense-in-depth — getFieldDescription and setFieldDescription now refuse any path whose parsed property != "description", mirroring the existing resolveSuggestionChangeSummaryField contract. A mismatched path (e.g. a …tags path, or a future mis-parse) can no longer be written/read as a description.

Tests:

Use cases covered

  • Approving a bare-path nested-column description suggestion (columns.profile.personal) writes the nested child and leaves the parent column untouched.
  • Reading the same kind of bare path returns the nested child's description, so the "is this a no-op?" check before a write looks at the right column.
  • A path whose property is tags is refused by both the description write and the description read, instead of writing or returning a description.
  • Existing path shapes (explicit .description/.tags, quoted nested names, :: separators, flat columns, entity-level description) resolve exactly as before. The existing FieldPathUtilsTest cases cover these and still pass.

Unit tests

All new tests are in FieldPathUtilsTest and reuse its nestedTable() fixture.

  • testParseFieldPath_dotSeparator_bareNestedColumn: replaces the old propertyLast test, which pinned the buggy behaviour.
  • testSetFieldDescription_bareNestedPath_writesChildNotParent: the bug repro.
  • testGetFieldDescription_bareNestedPath_readsChildNotParent: the same bug on the read path.
  • testSetFieldDescription_tagsPath_refused and testGetFieldDescription_tagsPath_refused: the two new guards.

All five fail against main's FieldPathUtils and pass with this change. Cases that existing tests already cover (.tags parsing, a missing nested child, deeper nesting) are not repeated. The change is in a pure function, so it is tested at unit level only. The approval wiring around it is already covered by TaskResourceIT.

Backend integration tests

  • No new integration tests. The merge queue runs TaskResourceIT, which exercises FieldPathUtils through task approval.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Built and ran the full local Docker stack via ./docker/run_local_docker.sh -m ui -d mysql (server healthy, no migration NPE). Minted an admin JWT and exercised the suggestion-approval flow end-to-end:

  1. Created a table with STRUCT column profile (description parent-desc) whose nested child child had description child-old.
  2. Created a Suggestion task with the migration's exact payload shape — fieldPath: "columns.profile.child", suggestedValue: "NEW-TEXT" — and approved it. Result: child.description = "NEW-TEXT", profile.description stayed parent-desc. Pre-fix this would have overwritten profile and left child unchanged.
  3. Regression — approved a modern quoted-path suggestion columns::"profile.child"::description; the description landed on the nested child, not the parent.
  4. Regression — approved a bare flat-column suggestion columns.email; the description landed on email.
  5. No-op — approved a bare-path suggestion whose value equalled the child's current description; nothing was overwritten and the parent stayed unchanged.

I did not run the in-process integration tests (TaskResourceIT, TaskChangeEventIT, …). The shared TestSuiteBootstrap aborts before any test runs with Entity.getEntityRelationshipRepository() being null during a v200 task-workflow-seeding migration. I confirmed this is pre-existing and unrelated to this change by stashing the fix and re-running the same command — the unmodified base code hits the identical NPE at the same point. The NPE originates in EntityRepository.getOwners() / v200 TaskWorkflow seeding code, none of which this PR touches (the diff is FieldPathUtils.java + one test file). The production server (with this fix) starts cleanly with no such NPE, which is what enabled the manual end-to-end verification above.

UI screen recording:

Not applicable — backend-only change.

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: I updated the migration scripts or explained why it is not needed. — N/A (no schema changes).
  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). — N/A (backend-only).
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). This description is gone from git log after the squash-merge.
  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.

Automatic Fixes PRs can be configured here.

@detail-app
detail-app Bot requested a review from a team as a code owner October 30, 2026 04:12
@detail-app
detail-app Bot requested review from harshach and removed request for harshach October 30, 2026 04:12
@detail-app
detail-app Bot requested a review from manerow October 30, 2026 04:12
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@detail-app detail-app Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 30, 2026
@detail-app
detail-app Bot force-pushed the detail/bug-fix/fixes-36615-resolve-bare-nested-column-description-e0f4cf branch from cc1108d to 91c7932 Compare October 30, 2026 12:22
@manerow
manerow force-pushed the detail/bug-fix/fixes-36615-resolve-bare-nested-column-description-e0f4cf branch from 91c7932 to c40d33f Compare November 4, 2026 10:24
@manerow

manerow commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Superseded by PR #37051, which removes the field path guessing instead of patching it.

@manerow manerow closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

[Detail Bug] Task approval for migrated nested-column description suggestions overwrites the parent column description

2 participants