Skip to content

Show how each workflow run's approval was decided (backport 2.1 #37729) - #37864

Merged
yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-37729
Nov 16, 2026
Merged

yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-37729

Conversation

@yan-3005

@yan-3005 yan-3005 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #37729 to 2.1. Each workflow run records how its approval steps were decided, and the UI shows it:

  • The execution history shows, under each run's status, who approved, rejected or partially approved the step, an administrator who published without review, or that the workflow approved it itself and why.
  • Hovering an entity's status badge says how the current status was set: who approved or rejected it, the workflow that set it (after whose change, or on its schedule), or the person who set it by hand. It uses the core Tooltip with a new opt-in light variant.
  • The glossary term's Workflow History card shows the decision under its approval step.

No migration: the decision is recorded from the approval task's completion validator, which every deployed workflow already calls, so existing workflows record decisions as soon as the server is upgraded.

#37729 is still in review; any change made there will be applied here too.

Backport details

Conflicts

  • None. The patch is Show how each workflow run's approval was decided #37729's own changes (git diff <merge-base with main>..<head>), 64 files, applied with git apply --3way. impact-map.generated.json was regenerated on 2.1 instead of patched.
  • 42 of the 64 files come out byte-identical to Show how each workflow run's approval was decided #37729's head, including every Java file and the core Tooltip. The other 22 differ only because 2.1's own content surrounds the change: the 21 locale files (all 14 new keys present in every locale, files sorted and valid) and DataAssetsHeader (passes the entity to the badge as on main).

Tests run on this branch

  • Build:
    • mvn install -DskipTests -pl openmetadata-service -am: BUILD SUCCESS.
    • mvn install -DskipTests -pl openmetadata-integration-tests -am: BUILD SUCCESS, so the changed WorkflowDefinitionResourceIT compiles.
    • mvn spotless:check on openmetadata-service and openmetadata-integration-tests: clean.
  • Unit tests: ApprovalOutcomeRecorderTest, ApprovalTaskCompletionValidatorTest, UserApprovalTaskTest, ChangeSelectionTest, ChangeRequestServiceTest, WorkflowInstanceRepositoryTest, IngestionPipelineMigrationEntryPointTest. 96 run, 0 failures, 0 errors.
  • plan_local_java_tests.py --check-branch and check_decision_records.py are clean.
  • Not run locally: UI Jest and checkstyle (the UI node_modules were removed to free disk), and integration tests. CI runs them; on main they passed at Show how each workflow run's approval was decided #37729's head (Jest 21/21 for the badge, 79/79 header and badge suites, Playwright 5/5, integration tests MySQL and Postgres).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

Fix the status tooltip's approval matching and satisfy the tooltip style-map requirement before merging.

Findings

  1. P1 Old approval explains new review ▶
  2. P2 Decisions have no step names ▶
  3. P2 Tooltip styles skip shared sorting ▶

Summary

Records approval decisions in each run's variables.approvals and shows them in execution history, glossary history, and status tooltips.

  • Workflow runs record who decided each approval step and why.
  • Workflow histories show who decided each recorded approval step.
  • Entity status badges explain who or what set the current status.

The decision record accepted by Ram Narayan Balaji explicitly documents the ten-run lookup limit, timing limits, folded version timestamps, and lack of historical backfill. Those known limits were not reported as separate findings.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Approval completes] --> B[Completion validator]
  B --> C[After commit]
  C --> D[Append variables.approvals]
  D --> E[Execution and glossary history]
  F[Hover status badge] --> G[Read entity versions]
  G --> H[Find nearby workflow runs]
  D --> H
  H --> I[Show status explanation]
Loading

Reviews (1) · Last reviewed commit: "Show how each workflow run's approval wa..." · Reviewed by Greptile

Each workflow run records how its approval steps were decided, and the UI
shows it in the execution history, the glossary term's Workflow History card,
and a light tooltip on the entity status badge. The decision is recorded from
the approval task's completion validator, so no migration is needed.
@yan-3005
yan-3005 requested review from a team as code owners November 16, 2026 09:00
@yan-3005
yan-3005 requested review from chirag-madlani and removed request for a team November 16, 2026 09:00
@yan-3005 yan-3005 added UI UI specific issues backend labels Nov 16, 2026
@yan-3005
yan-3005 requested review from TeddyCr and removed request for a team November 16, 2026 09:00
@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.

@gitar-bot

gitar-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Recording approval decisions and correlating them with entity status changes could misattribute reviewers or show misleading approval provenance.

Adds per-run approval decision records to workflow history, shows who approved, rejected, or auto-approved each step in the execution history, and surfaces decision details in entity status badge tooltips and the glossary term Workflow History card. No issues found.

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

Comment on lines +133 to +136
const run =
settingRuns.find((candidate) => outcomeAt(candidate, at)) ??
settingRuns.find(({ startedAt }) => (startedAt ?? 0) <= at) ??
settingRuns[0];

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.

P1 Old approval explains new review

If a reviewer approves a term and another user edits it within five seconds, findRunAt can select the previous run's approval instead of the new run that wrote In Review. The previous run still passes ranAt, and its approval makes it win over the new run waiting for review. The badge then says “Approved by …” while approval is still pending.

Check that the decision belongs to this status change before preferring it. Otherwise, show the workflow without an approval claim.

data-testid={`workflow-approval-outcome-${record.id}`}
key={outcome.id}
size="text-xs">
{t(message.key, { user: message.users })}

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.

P2 Decisions have no step names

The new outcome lines omit outcome.node. A run with several approval steps shows “Approved by …” or “Rejected by …” without saying which step each person decided. Include the step name beside each outcome so readers can tell the decisions apart.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +41 to +44
const VARIANT_STYLES: Record<
TooltipVariant,
{ surface: string; title: string; description: string; arrow: string }
> = {

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.

P2 Tooltip styles skip shared sorting

The new VARIANT_STYLES map uses a plain object. The component-library guide requires sortCx({}) for style variant maps so Tailwind classes get shared sorting and editor support. Wrap this map in sortCx while keeping its type. This repository requirement must be satisfied before merging.

Context Used: openmetadata-ui-core-components/CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@yan-3005
yan-3005 merged commit a198bc7 into 2.1 Nov 16, 2026
60 of 67 checks passed
@yan-3005
yan-3005 deleted the backport/2.1/pr-37729 branch November 16, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants