Repository navigation
Acknowledge an incident from the test case last-run banner - #33809
Conversation
The last-run banner's incident strip could only link out to the incident. Acknowledging a new incident meant leaving the page for the Incident tab. Add an Acknowledge action to the strip, shown only while the incident is New and the user holds EditStatus on the test case. It transitions the incident through the task-first endpoint and republishes the refreshed resolution status, so the strip and the header's Incident Status chip both update without refetching the page. useTestCaseIncidentHeader grows a shared applyIncidentTransition helper; the assignee handler now routes through it instead of repeating the transition-then-read-back sequence. The banner is also aligned with the design prototype it was built from: the status tint moves to the banner container so the incident strip can sit a shade lighter over it, the status tile and headline grow to the mock's scale, the accent bar uses the 600 palette step the mock specifies, the incident id renders monospace and separate from its title, and the New chip turns red while the Acknowledge button takes the run status' colour. The strip's row is centred rather than top-aligned.
❌ 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 |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
| Count | Rule |
|---|---|
| 6 | openmetadata-imports/no-lower-layer-page-imports |
| 2 | openmetadata-imports/review-sequential-api-calls |
| 1 | no-restricted-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/DataQuality/IncidentManager/IncidentManagerPageHeader/useTestCaseIncidentHeader.ts:30: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/DataQuality/IncidentManager/IncidentManagerPageHeader/useTestCaseIncidentHeader.ts:49:3 |
no-restricted-imports |
'getPrioritizedEditPermission' import from '../../../../utils/PermissionsUtils' is restricted from being used by a pattern. getPrioritizedEditPermission/getPrio |
| 🟡 | src/components/DataQuality/IncidentManager/IncidentManagerPageHeader/useTestCaseIncidentHeader.ts:226:27 |
openmetadata-imports/review-sequential-api-calls |
Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent |
| 🟡 | src/components/DataQuality/IncidentManager/TestCaseStatus/InlineTestCaseIncidentStatus.component.tsx:37: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/DataQuality/IncidentManager/TestCaseStatus/InlineTestCaseIncidentStatus.component.tsx:296:27 |
openmetadata-imports/review-sequential-api-calls |
Review these sequential API requests. If they are independent, start them together with Promise.all/Promise.allSettled; keep sequencing only when data-dependent |
| 🟡 | src/components/observability/TestCaseDetail/TestCaseDetail.tsx:33: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/observability/TestCaseDetail/TestCaseDetail.tsx: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. |
| 🟡 | src/components/observability/TestCaseDetail/TestCaseDetail.tsx:35: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/observability/TestCaseDetail/TestCaseDetail.tsx:40: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…r applied Address two review findings on the acknowledge flow: - A read-back that fails or returns nothing left the header on the old status even though the transition had landed, so the banner invited the user to repeat it. The expected status per transition is now applied as a fallback, and a failed transition no longer looks the same as a failed read-back. - The Playwright poll scanned an unfiltered incident window whose default page holds 10 rows, so a parallel worker's incidents could hide this test's own. It now filters by test case FQN server-side.
…ition ids for acknowledge The Acknowledge button was a secondary Button recoloured from outside: an important outline override for its border and an inner span for its label. Core Button already ships secondary-destructive, -warning, -success and -brand, which carry border, text, hover, loading and disabled states, so each status now names one of those instead. Transition ids were spelled out at five call sites across two files. They are the workflow's own edge names rather than the resolution status they produce, so they live in one typed constant beside the incident REST types. Typing the read-back fallback against that union also drops the empty-string index it needed. Also drops the prefix prop ExpandableBannerText no longer has a caller for, memoizes handleAssigneeUpdate alongside its siblings, and replaces the status badge's raw white with the semantic background token so it follows dark mode.
Code Review ✅ Approved🟡 Medium risk · Adds a permission-gated action for changing incident status through the existing API. Adds an Acknowledge action to the test-case last-run incident strip, gated to OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|



Describe your changes:
Fixes open-metadata/openmetadata-collate#6111
TCD-5, part of epic open-metadata/openmetadata-collate#6074.
The last-run banner already showed an open incident — its id, title and status chip — but the only way to acknowledge one was to leave the page for the Incident tab. This adds Acknowledge to the incident strip, and aligns the strip's styling with the design prototype.
Demo
Type of change:
High-level design:
One transition path, read back before it is published.
transitionIncidentreturns the task, not theTestCaseResolutionStatusthe header renders, soapplyIncidentTransitioninuseTestCaseIncidentHeaderre-reads the incident withgetListTestCaseIncidentByStateId(stateId)and publishes the refreshed status through the existingonIncidentStatusUpdate. Both consumers of the hook — the strip and the header chip — update from that one write, with no page refetch.handleAcknowledgeIncidentis a one-line binding of that helper to{ transitionId: 'ack' }; the helper is generic so the remaining transitions (assign, resolve) are a second binding rather than a second implementation.Permission. The button renders only when the status is
Newand the caller hasEditStatus, read viagetPrioritizedEditPermission(permission, Operation.EditStatus)— the same gate the Incident tab uses. Passed down ashasEditStatusPermissionfromTestCaseDetailandIncidentManagerDetailPage.Styling now matches the prototype. The status tint moved from the summary block to the banner container so the incident strip can carry its own wash (
tw:bg-primary/55); the strip row is vertically centred (tw:lg:items-center); the accent border steps to the600token; the incident id is split from the title so the id keeps its mono treatment;Newis red rather than grey; and the id separator is a hyphen (INC-9), not an en dash.Tests:
Use cases covered
Newincident shows Acknowledge on the banner's incident strip.Acknowledged, updates the strip chip and the page-header chip, and hides the button — no page refetch.Newstatuses (Ack,Assigned,Resolved).EditStatuspermission.Unit tests
IncidentManagerPageHeader/TestCaseLastRunBanner.test.tsx,IncidentManagerPageHeader/useTestCaseIncidentHeader.test.tsxjest src/components/DataQuality/IncidentManager/IncidentManagerPageHeader→ 42 passed, 4 suitesIncidentDetails.component.tsxandTestCaseLastRunBanner.constants.ts100%,useTestCaseIncidentHeader.ts90.37%.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
playwright/e2e/Features/DataQuality/TestCaseDetailsPage.spec.ts— new describeTest Case Details Page - Incident strip, testacknowledges the incident from the failed run banner. Seeds a failed run, pollstestCaseIncidentStatusuntil the incident opens, asserts theNewchip, clicks Acknowledge againstPOST /api/v1/tasks/{id}/resolve, then assertsAcknowledgedon the strip,Ackon the header chip, and the button hidden.4 passed (2.2m).Manual testing performed
yarn startagainst a local backend, AI app mode on./test-case/sample_data.ecommerce_db.shopify.dim_address.diff_columns— a test case with aNewincident.INC-<n>, its title, a redNewchip and Acknowledge.Acknowledged, the page-header chip becomesAck, the button disappears, no reload.getComputedStyleon both; remaining deltas are design-token quantisation (radius 14→12, tile 44→40, 13px→12px), not layout.UI screen recording / screenshots:
TODO: attaching the recording before marking this ready for review.
Checklist:
Fixesabove.🤖 Generated with Claude Code
The PR appears safe to merge; no outstanding correctness, security, or repository-rule violations remain.
Summary
This PR adds permission-gated incident acknowledgement to the test-case last-run banner and keeps the banner and header status synchronized after the transition.
Diagram
sequenceDiagram actor User participant Banner as Last-run banner participant Hook as Incident header hook participant TaskAPI as Task transition API participant IncidentAPI as Incident status API participant UI as Banner and header state User->>Banner: Click Acknowledge Banner->>Hook: handleAcknowledgeIncident() Hook->>TaskAPI: transitionIncident(stateId, ack) TaskAPI-->>Hook: Transition accepted Hook->>IncidentAPI: Read updated incident status alt Readback succeeds IncidentAPI-->>Hook: Authoritative Ack status Hook->>UI: Publish refreshed status else Readback fails or is empty Hook->>UI: Publish Ack fallback end UI-->>User: Show acknowledged state and hide actionReviews (11) · Last reviewed commit: "refactor(incidents): use core Button sta..."