Skip to content

Fixes #36615: one format for task field paths - #37051

Merged
manerow merged 18 commits into
mainfrom
fix/36615-task-field-path-format
Nov 5, 2026
Merged

manerow merged 18 commits into
mainfrom
fix/36615-task-field-path-format

Conversation

@manerow

@manerow manerow commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #36615

Problem

Approving a suggestion for a nested column could write the new description onto its parent column, leave the nested column unchanged, and still report success (#36615).

Why it happened

Description, tag and suggestion tasks name the field they change with a string, fieldPath, and nothing owned its format. Five formats ended up stored:

Written by Example
UI, description tasks columns::"profile.child"::description
UI, tag tasks columns."profile.child"
2.0.0 upgrade columns.profile.child
AI suggestions columns.profile.child.description
API callers anything

Six places parsed these strings by hand, and each one guessed when the last part (description or tags) was missing. One guess read columns.profile.child as "column profile, property child".

What this PR changes

  • One format. A task's field path is <container>.<field names>.<description|tags>, for example columns.profile.child.description. description or tags alone means the entity itself. A field whose own name contains a dot is quoted, as in FQNs: columns."order.id".tags. It is the same key the entity's change history already uses. The rule is recorded in docs/decisions/.
  • One parser. EntityFieldPath is the only server code that reads a path. The hand-written parsers are removed, along with an unused SuggestionHandler.
  • One key writer. EntityFieldPath.childKey is also how every entity updater writes a child field's change key, so a task's path and the change its approval records are the same string. Pipeline tasks and ML features skipped the quoting, so a name with a dot got a different key; they now quote like columns and schema fields. The change summary's cleanup for removed fields, and three unused EntityUtil key helpers with another shape, used their own builders; the cleanup now uses the same one and the helpers are removed.
  • Checked against the entity. When a task is filed, when its path is edited, and when it is approved, the path must name a real field of the entity that carries the property. Otherwise the server returns a 400. Description tasks get the same check tag tasks already had.
  • A task without a path is about the entity itself, and the server stores description or tags written out.
  • Existing data is migrated. A 2.1.0 data step rewrites every stored description, tag and suggestion task into the new format. When the entity still exists, the entity decides what an ambiguous old path meant. This step is the only code that still reads the old formats. It works on the stored JSON with plain SQL and keeps its own copy of the 2.1.0 format, so later changes to the server's classes cannot change what an upgrade from 2.0 writes.
  • UI. One builder and one parser replace the old helpers, so the task pages, task detail and suggestions all read and write the same format.

What users will notice

How it was tested

  • New unit tests for the path type, the task checks and the migration (one row per old format), plus the existing task suites.
  • TaskResourceIT and ChangeSummaryResourceIT on MySQL, including new tests for a bad path when filing and when editing.
  • The migration on real 2.0.7 MySQL and Postgres databases with tasks in each old format: 13 of 13 converted correctly on both. A forced second run changed nothing.
  • UI: Jest tests for the new builder and parser, and the existing task page tests.
  • PipelineResourceIT and MlModelResourceIT each change the description of a task or feature whose name contains a dot, and check the history records it under the quoted key (tasks."extract.load".description). They fail if either updater goes back to joining names by hand.

Not in this PR

Replaces PR #36632, which patched the parser's guess instead of removing it. 2.1 only; nothing is backported.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 15 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), 15 warning(s) across 8 changed file(s).

Count Rule
9 react-hooks/exhaustive-deps
5 openmetadata-imports/no-lower-layer-page-imports
1 openmetadata-imports/no-api-calls-in-iteration
All findings
Location Rule Message
🟡 src/components/ActivityFeed/TaskFeedCard/TaskFeedCardFromTask.component.tsx:46:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/ActivityFeed/TaskFeedCard/TaskFeedCardFromTask.component.tsx:47:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/ActivityFeed/TaskFeedCard/TaskFeedCardFromTask.component.tsx:193:9 react-hooks/exhaustive-deps The 'handleTaskLinkClick' function makes the dependencies of useMemo Hook (at line 233) change on every render. Move it inside the useMemo callback. Alternative
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:73:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:74:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:753:9 react-hooks/exhaustive-deps The 'updateTaskData' function makes the dependencies of useCallback Hook (at line 861) change on every render. To fix this, wrap the definition of 'updateTaskDa
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:1325:6 react-hooks/exhaustive-deps React Hook useMemo has unnecessary dependencies: 'onTaskDropdownClick', 'taskHandler.approvedValue', and 'taskHandler.rejectedValue'. Either exclude them or rem
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:1360:6 react-hooks/exhaustive-deps React Hook useMemo has unnecessary dependencies: 'isPartOfAssigneeTeam' and 'task'. Either exclude them or remove the dependency array.
🟡 src/components/Entity/Task/TaskTab/TaskTabNew.component.tsx:1423:6 react-hooks/exhaustive-deps React Hook useMemo has unnecessary dependencies: 'onTaskResolve' and 'task'. Either exclude them or remove the dependency array.
🟡 src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx:189:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'getTaskAbout'. Either include it or remove the dependency array.
🟡 src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx:183:6 react-hooks/exhaustive-deps React Hook useEffect has a missing dependency: 'getFieldPath'. Either include it or remove the dependency array.
🟡 src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx:214:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'getDescription' and 'getTaskAbout'. Either include them or remove the dependency array.
🟡 src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx:222:6 react-hooks/exhaustive-deps React Hook useEffect has missing dependencies: 'getFieldPath' and 'getTags'. Either include them or remove the dependency array.
🟡 src/rest/suggestionsAPI.ts:247:11 openmetadata-imports/no-api-calls-in-iteration Avoid issuing one API request per item. Fetch at the data owner, use a bulk endpoint, or use useQueries with an intentional concurrency policy.
🟡 src/utils/TaskFieldUtils.ts:34:1 openmetadata-imports/no-lower-layer-page-imports Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here.

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

make ui-checkstyle-changed

@manerow
manerow marked this pull request as ready for review November 4, 2026 12:49
@manerow
manerow requested review from a team as code owners November 4, 2026 12:49
@github-actions

github-actions Bot commented Nov 4, 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 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

✅ Generated Sources Auto-Updated

The generated TypeScript types (src/generated/) and dereferenced JSON
schemas (src/jsons/, public/jsons/) have been automatically updated
based on JSON schema changes in this PR.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 81%
81.38% (138420/170074) 68.43% (49868/72869) 71.47% (28026/39213)

@manerow
manerow force-pushed the fix/36615-task-field-path-format branch from 5b08fac to 3df0c0a Compare November 4, 2026 15:54
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@gitar-bot

gitar-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🔴 High risk · The 2.1 migration rewrites stored task paths and rejects legacy API formats, which could leave existing callers unable to file or edit tasks.

Replaces the five stored task field path formats with one <container>.<field names>.<description|tags> format, backed by a single EntityFieldPath parser and child key writer, and adds a 2.1.0 migration to rewrite existing tasks. The dotted-name change-key fix in Pipeline and MlModel was resolved, and no open issues remain.

✅ 1 closed
✅ Quality: Dotted-name change-key fix in Pipeline/MlModel now has no regression test

📄 openmetadata-service/src/test/java/org/openmetadata/service/util/EntityFieldPathTest.java:133-141 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/ChangeSummaryResourceIT.java 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:1141 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:1175 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:1193 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/MlModelRepository.java:627 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/MlModelRepository.java:675 📄 docs/decisions/2026-11-04-task-field-paths-use-the-change-key-format.md:37-38
This commit deletes ChangeSummaryResourceIT.applyingASuggestion_recordsTheChangeUnderTheTaskPath, which ran once per entity type (including pipeline and mlFeatures."user.age".description). It was the only test checking that approving a task records its change under exactly the task's path. Its replacement, childKey_isTheKeyAPathAndAnEntityUpdaterBothWrite in EntityFieldPathTest.java:134-141, only checks what EntityFieldPath.childKey returns. It still passes if PipelineRepository (lines 1141/1175/1193) or MlModelRepository (lines 627/675) go back to joining names without quotes. That unquoted joining is the bug this PR says it fixes. Searching the IT and service test trees finds no other test that uses a quoted tasks."…" or mlFeatures."…" key. That leaves the accepted record's claim untested: "the same string is the change-summary key, so the two cannot drift". The description's "How it was tested" section also still lists the per-entity ITs. Fix: keep at least the pipeline and ML-model cases of the deleted IT, or add a test at the repository level. It should update a task or feature whose name contains a dot and assert that the stored ChangeDescription key equals EntityFieldPath.parse(path).toString().

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

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@manerow
manerow merged commit 3889365 into main Nov 5, 2026
72 of 75 checks passed
@manerow
manerow deleted the fix/36615-task-field-path-format branch November 5, 2026 15:04
mohityadav766 pushed a commit that referenced this pull request Nov 13, 2026
…e service-connection wipe, the parallel-lane timeout (#37725)

* test(it): fix 13 integration tests main has failed since merges skipped ITs

Each test was broken by a later PR whose behaviour change is intended and
recorded, but merged without the integration lanes running:

- IncidentGroupsIT x3, MetricMigrationIT: the 2.1.0 incident backfill now
  requires a testCase parentOf row (#37054); seed it like the write path does.
- TeamResourceIT x2: only admins add team roles (ADR 2026-10-30) and every
  CSV row needs EDIT_ALL on its own team (ADR 2026-11-02).
- DomainMoveApprovalAuthorizationIT, DomainReassignmentAuthorizationIT: a
  JSON Patch on the document root is refused with 400 (ADR 2026-11-03).
- AIContextMcpIT: a metric child the caller cannot view is dropped
  (ADR 2026-10-31); amend the 2026-10-29 record that said otherwise.
- OntologyDraftQueryIT: the release scope needs an active release first.
- TaskResourceIT: field paths end in tags/description (#37051).
- OntologyBulkIT: the two glossaries of one test shared a name.
- DataContractResourceIT x2: unknown imported fields are carried as
  source metadata, and an imported numeric-unsafe rule is stored as an
  embedded custom rule (ADR 2026-11-09).

* test(it): address self-review on the main IT fixes

Tighten the DataContract export assertion to the exporter's message, drop
the TeamResourceIT Javadoc clause the removed step proved, and note in the
metric ADR amendment that the VIEW_ALL expression filter has no caller in
the suite that can reach it.

* fix: keep a service's connection on a PUT that omits it; unblock the IT lanes

- ServiceEntityRepository: a PUT without `connection` now keeps the stored
  connection, as #32920 and issue #29494 intend and
  DatabaseServiceResourceIT.put_updateWithoutConnection_preservesExistingConnection_200
  asserts. Each generated service types its own setter, so the stored
  connection is copied in place through its JSON form. Stored ciphertext and
  vault references pass through storage unchanged
  (ADR 2026-10-29 service-connection-secrets-are-written-only-during-storage).
- NativeOntologyEveryPackInstallIT moves to the global-state lane. Its
  @isolated 11-15 minute install of every pack pushed the parallel lane past
  its 65 minute budget; the global-state lane runs beside it with headroom and
  every pack still installs on each merge (ADR 2026-11-06).
- DataProductDeleteRaceIT matches lock waiters by table on MySQL too: a run
  waited the full minute on a blocked statement that did not carry the data
  product's id.

* fix: an approval-held PUT without a connection must not clear it either

The approval gate staged a PUT that omits `connection` as `connection: null`,
so approving it would still delete the credentials. Services now declare
`connection` and `serviceAttributes` as fields a PUT keeps, matching the
updater. Records the decision and its security reasoning in
ADR 2026-11-13-a-put-that-omits-a-service-connection-keeps-the-stored-one.

SecretsManagerNullSecretIT covers both paths against the in-memory vault: a
direct PUT keeps the connection and its vault secrets, and a held PUT stages
no connection op (fails without the override). DataProductDeleteRaceIT moves
to the serial global-state lane and matches whole table names, so no other
test's lock wait can stand in for its own.

* docs(adr): state what an omitted connection lost before the fix, as tested

A red run of the old updater shows the service row losing its connection
while the vault entries were still present right after the PUT, so the record
no longer claims the vault entries were deleted.
yan-3005 added a commit that referenced this pull request Nov 16, 2026
…ipe (backport 2.1 #37725) (#37850)

* Fix every integration-test failure on main: 14 stale/broken tests, the service-connection wipe, the parallel-lane timeout (#37725)

* test(it): fix 13 integration tests main has failed since merges skipped ITs

Each test was broken by a later PR whose behaviour change is intended and
recorded, but merged without the integration lanes running:

- IncidentGroupsIT x3, MetricMigrationIT: the 2.1.0 incident backfill now
  requires a testCase parentOf row (#37054); seed it like the write path does.
- TeamResourceIT x2: only admins add team roles (ADR 2026-10-30) and every
  CSV row needs EDIT_ALL on its own team (ADR 2026-11-02).
- DomainMoveApprovalAuthorizationIT, DomainReassignmentAuthorizationIT: a
  JSON Patch on the document root is refused with 400 (ADR 2026-11-03).
- AIContextMcpIT: a metric child the caller cannot view is dropped
  (ADR 2026-10-31); amend the 2026-10-29 record that said otherwise.
- OntologyDraftQueryIT: the release scope needs an active release first.
- TaskResourceIT: field paths end in tags/description (#37051).
- OntologyBulkIT: the two glossaries of one test shared a name.
- DataContractResourceIT x2: unknown imported fields are carried as
  source metadata, and an imported numeric-unsafe rule is stored as an
  embedded custom rule (ADR 2026-11-09).

* test(it): address self-review on the main IT fixes

Tighten the DataContract export assertion to the exporter's message, drop
the TeamResourceIT Javadoc clause the removed step proved, and note in the
metric ADR amendment that the VIEW_ALL expression filter has no caller in
the suite that can reach it.

* fix: keep a service's connection on a PUT that omits it; unblock the IT lanes

- ServiceEntityRepository: a PUT without `connection` now keeps the stored
  connection, as #32920 and issue #29494 intend and
  DatabaseServiceResourceIT.put_updateWithoutConnection_preservesExistingConnection_200
  asserts. Each generated service types its own setter, so the stored
  connection is copied in place through its JSON form. Stored ciphertext and
  vault references pass through storage unchanged
  (ADR 2026-10-29 service-connection-secrets-are-written-only-during-storage).
- NativeOntologyEveryPackInstallIT moves to the global-state lane. Its
  @isolated 11-15 minute install of every pack pushed the parallel lane past
  its 65 minute budget; the global-state lane runs beside it with headroom and
  every pack still installs on each merge (ADR 2026-11-06).
- DataProductDeleteRaceIT matches lock waiters by table on MySQL too: a run
  waited the full minute on a blocked statement that did not carry the data
  product's id.

* fix: an approval-held PUT without a connection must not clear it either

The approval gate staged a PUT that omits `connection` as `connection: null`,
so approving it would still delete the credentials. Services now declare
`connection` and `serviceAttributes` as fields a PUT keeps, matching the
updater. Records the decision and its security reasoning in
ADR 2026-11-13-a-put-that-omits-a-service-connection-keeps-the-stored-one.

SecretsManagerNullSecretIT covers both paths against the in-memory vault: a
direct PUT keeps the connection and its vault secrets, and a held PUT stages
no connection op (fails without the override). DataProductDeleteRaceIT moves
to the serial global-state lane and matches whole table names, so no other
test's lock wait can stand in for its own.

* docs(adr): state what an omitted connection lost before the fix, as tested

A red run of the old updater shows the service row losing its connection
while the vault entries were still present right after the PUT, so the record
no longer claims the vault entries were deleted.

(cherry picked from commit a634c55)

* test(it): read MySQL lock waits from performance_schema in DataProductDeleteRaceIT

On CI the innodb_trx statement text never matched the blocked statements,
so each race step only ended when a request hit MySQL's 50s lock-wait
timeout, and one step outlived the 60s wait. data_lock_waits joined to
data_locks names the table each blocked transaction waits on, independent
of the statement text. Locally the three races now take 1.7-3.8s on MySQL
instead of about 50s.
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.

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

2 participants