Repository navigation
Show how each workflow run's approval was decided (backport 2.1 #37729) - #37864
Conversation
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.
❌ PR checklist incompleteThis 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 |
Code Review ✅ Approved 🟡 Medium riskRecording 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. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| const run = | ||
| settingRuns.find((candidate) => outcomeAt(candidate, at)) ?? | ||
| settingRuns.find(({ startedAt }) => (startedAt ?? 0) <= at) ?? | ||
| settingRuns[0]; |
There was a problem hiding this comment.
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 })} |
There was a problem hiding this comment.
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!
| const VARIANT_STYLES: Record< | ||
| TooltipVariant, | ||
| { surface: string; title: string; description: string; arrow: string } | ||
| > = { |
There was a problem hiding this comment.
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!
Backport of #37729 to 2.1. Each workflow run records how its approval steps were decided, and the UI shows it:
Tooltipwith a new opt-inlightvariant.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
git diff <merge-base with main>..<head>), 64 files, applied withgit apply --3way.impact-map.generated.jsonwas regenerated on 2.1 instead of patched.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) andDataAssetsHeader(passes the entity to the badge as on main).Tests run on this branch
mvn install -DskipTests -pl openmetadata-service -am: BUILD SUCCESS.mvn install -DskipTests -pl openmetadata-integration-tests -am: BUILD SUCCESS, so the changedWorkflowDefinitionResourceITcompiles.mvn spotless:checkonopenmetadata-serviceandopenmetadata-integration-tests: clean.ApprovalOutcomeRecorderTest,ApprovalTaskCompletionValidatorTest,UserApprovalTaskTest,ChangeSelectionTest,ChangeRequestServiceTest,WorkflowInstanceRepositoryTest,IngestionPipelineMigrationEntryPointTest. 96 run, 0 failures, 0 errors.plan_local_java_tests.py --check-branchandcheck_decision_records.pyare clean.node_moduleswere 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
Fix the status tooltip's approval matching and satisfy the tooltip style-map requirement before merging.
Findings
Summary
Records approval decisions in each run's
variables.approvalsand shows them in execution history, glossary history, and status tooltips.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]Reviews (1) · Last reviewed commit: "Show how each workflow run's approval wa..." · Reviewed by Greptile