Skip to content

fix(ui): store the user name in Updated by workflow rules - #35998

Merged
anuj-kumary merged 2 commits into
mainfrom
anuj-kumary/updatedby-display-name-match
Oct 23, 2026
Merged

anuj-kumary merged 2 commits into
mainfrom
anuj-kumary/updatedby-display-name-match

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Reported via customer support ticket 21780. There is no GitHub issue.

In the governance workflow editor, the Updated by rule in a Check Condition node (checkEntityAttributesTask) never matched. The user dropdown searched on displayName.keyword and didn't map the option value, so the saved rule held the display label:

{"==":[{"var":"updatedBy"},"aaron johnson"]}

Entities store updatedBy as the user name (aaron_johnson0, amaka.osakwe), so the comparison was always false. When the customer PATCHed the workflow definition with usernames, the rule worked.

This fix makes updatedBy use sourceFieldOptionType, the same way the Owners and Reviewers fields next to it already do. The dropdown still shows displayName, but the stored value is now name.

name is used rather than fullyQualifiedName because a username with a dot gets quoted in its FQN ("amaka.osakwe"), and that would never equal the raw updatedBy value.

Existing workflows: rules saved before this fix still hold the display name. Users need to re-pick the user in the rule and save. There's no migration because display names aren't unique and can't be reliably mapped back to usernames.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Picking a user in an "Updated by" rule shows the display name and stores the user name.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: src/utils/JSONLogicSearchClassBase.test.ts. The new test runs the real autocomplete against a mocked search response and asserts the option { title: 'aaron johnson', value: 'aaron_johnson0' }. It fails without the fix, and all 29 tests in the file pass with it.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not added. The change is a field-config value covered by the unit test above.

Manual testing performed

Not run locally. The bad payload was reproduced on release-2-0 by validating a workflow with an Updated by rule; see the support ticket.

UI screen recording:

Not applicable — standalone bug fix to a rule-builder field config; no UI change is visible (the dropdown labels are unchanged).

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> (no GitHub issue — support ticket)
  • 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.
  • 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.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Changes the Updated by dropdown to show displayName while storing the user’s raw name.

  • Updated by rules save the user name while showing the display name.

Reviews (1) · Last reviewed commit: "Merge branch 'main' into anuj-kumary/upd..." · Reviewed by Greptile

…kflow rules

The Check Entity Attributes rule builder searched users on displayName.keyword
without mapping the option value, so the saved jsonLogic compared updatedBy
against the display label. Entities store updatedBy as the user name, so the
rule never matched. Show displayName, store name, as Owners/Reviewers do.
@anuj-kumary
anuj-kumary requested a review from a team as a code owner October 22, 2026 15:28
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

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

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@anuj-kumary anuj-kumary self-assigned this Oct 22, 2026
@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Oct 22, 2026
@github-actions github-actions Bot added the UI UI specific issues label Oct 22, 2026
@anuj-kumary
anuj-kumary enabled auto-merge October 22, 2026 15:31
@gitar-bot

gitar-bot Bot commented Oct 22, 2026 •

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

🟡 Medium risk · Changing Updated by rules to store usernames fixes new matches, but previously saved display-name rules may still fail until users reselect users.

Switches the Updated by rule field to store the user name instead of the display label, so rules now match entities' updatedBy values; the dropdown still shows displayName. One open suggestion: users who share a display name collapse into a single bucket, so only one of their usernames can be selected. Consider aggregating on name.keyword and keeping displayName as the label.

✅ 1 closed
Closed: Edge Case: Users sharing a display name collapse to one selectable username

📄 openmetadata-ui/src/main/resources/ui/src/utils/JSONLogicSearchClassBase.ts:563-572
The autocomplete still groups results by displayName.keyword, and parseBucketsData takes the name from only the first top hit in each bucket (hits.hits[0]._source). If two users have the same display name (the PR description itself says display names aren't unique), they end up in one bucket, so only one of their usernames can be picked. A rule for the other user can't be built from the dropdown. If the field aggregates on name.keyword and keeps displayName as the label (through sourceFields/sourceFieldOptionType), each user gets one bucket and their own option.

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

@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 79%
79.13% (128360/162209) 65.55% (45083/68772) 68.55% (25707/37497)

@sonarqubecloud

Copy link
Copy Markdown

@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-22T19:36:18Z)

Blocked the queue: playwright-summary

@anuj-kumary
anuj-kumary added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 3b193c1 Oct 23, 2026
91 of 94 checks passed
@anuj-kumary
anuj-kumary deleted the anuj-kumary/updatedby-display-name-match branch October 23, 2026 03:37
anuj-kumary added a commit that referenced this pull request Oct 23, 2026
…kflow rules (#35998) (#36056)

The Check Entity Attributes rule builder searched users on displayName.keyword
without mapping the option value, so the saved jsonLogic compared updatedBy
against the display label. Entities store updatedBy as the user name, so the
rule never matched. Show displayName, store name, as Owners/Reviewers do.

(cherry picked from commit 3b193c1)
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants