Files
wehub-resource-sync bf2343b7e4
Integration Tests - MySQL + Elasticsearch / Detect Changes (push) Has been cancelled
Integration Tests - MySQL + Elasticsearch / integration-tests-mysql-elasticsearch (push) Has been cancelled
Integration Tests - PostgreSQL + Elasticsearch + Redis / Detect Changes (push) Has been cancelled
Integration Tests - PostgreSQL + Elasticsearch + Redis / integration-tests-postgres-elasticsearch-redis (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / Detect Changes (push) Has been cancelled
Integration Tests - PostgreSQL + OpenSearch / integration-tests-postgres-opensearch (push) Has been cancelled
Java Checkstyle / java-checkstyle (push) Has been cancelled
Maven Collate Tests / maven-collate-ci (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests-status (push) Has been cancelled
Publish Package to Maven Central Repository / publish-maven-packages (push) Has been cancelled
OpenMetadata Service Unit Tests / Detect Changes (push) Has been cancelled
OpenMetadata Service Unit Tests / openmetadata-service-unit-tests (push) Has been cancelled
OpenMetadata Service Unit Tests / k8s_operator-unit-tests (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:35:45 +08:00

77 lines
3.0 KiB
Markdown

# Incident Auto-Close on Test Pass
> **Slice 2 of 3** — Incident Manager → Governance Workflows Migration
> **Depends on**: [incident-lifecycle-workflow](../incident-lifecycle-workflow/proposal.md) (Slice 1)
> **Enables**: Nothing (independent feature)
> **ADR**: [adr-incident-manager-governance-workflows.md](../../../adr-incident-manager-governance-workflows.md)
---
## What Ships
When a previously-failing test case passes, the system automatically resolves the open incident (reason: `AutoResolved`) and closes its associated task. No human intervention required.
This fixes the **#1 gap** in today's incident manager — `setTestCaseResultIncidentId()` sets `incidentId = null` when a test succeeds but never resolves the incident or closes its task. Incidents stay open indefinitely even after the underlying issue is fixed.
**User-visible changes:**
- Test passes → open incident auto-resolves → task disappears from feed
- Resolution reason: `AutoResolved` (distinct from manual resolution)
- Configurable: users can add conditions, side effects, or disable via governance workflow UI
---
## What We Build
### ResolveIncidentTask Node
New automated task (`nodeType: automatedTask`, `nodeSubType: resolveIncidentTask`) that resolves the open incident for a given test case.
**ResolveIncidentImpl:**
1. Get test case FQN from workflow variables (`relatedEntity`)
2. Query for latest incident status
3. If unresolved → create Resolved record (reason: `AutoResolved`)
4. Close associated Thread task via repository
5. Repository's fire-and-forget terminates the lifecycle process (wired in Slice 1)
**User-facing config:**
```json
{
"type": "automatedTask",
"subType": "resolveIncidentTask",
"config": { "reason": "AutoResolved" }
}
```
### Schema Changes
- `resolved.json`: Add `AutoResolved` to `TestCaseFailureReasonType` enum
- `nodeSubType.json`: Add `resolveIncidentTask`
- New `resolveIncidentTask.json` node definition
### Auto-Close Workflow Definition
Default **auto-close-incident-on-test-pass** workflow, ships enabled:
```
Trigger: TestCase ENTITY_UPDATED, filter: testCaseStatus == Success
Flow: [Start] → [ResolveIncidentTask] → [End]
Config: reason: "AutoResolved"
```
Short-lived, fire-and-forget — no long-lived state, no wait, no timers.
---
## Out of Scope
| Feature | Deferred to | Why |
|---------|-------------|-----|
| TTL / stale incident expiration | Slice 3 | Different mechanism (boundary timer) |
| Conditional auto-close rules | Future | Users can add `checkEntityAttributesTask` themselves |
| Post-close notifications | Future | Users can append `sinkTask` to the workflow |
---
## Why This Depends on Slice 1
`ResolveIncidentImpl` calls the repository to resolve → repository fire-and-forget terminates the lifecycle process. Without Slice 1, there's no lifecycle process to terminate. The resolution itself would still work (repository code is unchanged), but the architecture is cleaner with the lifecycle process in place — auto-close naturally terminates it.