Skip to content

Commit 7d8d999

Browse files
Show parent-close-policy badge on child lineage entries
Child workflow lineage entries on the run-detail screen now render a badge derived from the new parent_close_policy_outcome / parent_close_policy fields on each child entry: an applied policy shows "Closed by parent (cancelled|terminated)" with the recorded reason as the tooltip, a failed enforcement shows "Parent-close policy failed" with the error text, an abandon snapshot on a still-open child shows "Abandoned by parent on close", and a non-abandon snapshot on a still-running parent shows the standing policy operators should expect on parent close. Continue-as-new entries are unaffected. Built bundle refreshed.
1 parent 47d6111 commit 7d8d999

3 files changed

Lines changed: 81 additions & 2 deletions

File tree

public/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"/app.js": "/app.js?id=3100d3d35935440be2f117f7bf63b05b",
2+
"/app.js": "/app.js?id=c144ad7f39cca91fb3ea4bb9a923411e",
33
"/app-dark.css": "/app-dark.css?id=525cb983f9bc1a2e58ffad67a5b5309c",
44
"/app.css": "/app.css?id=e4c41d7a9ff1ef3e68de8cbec886a315",
55
"/img/favicon.png": "/img/favicon.png?id=7c006241b093796d6abfa3049df93a59",

resources/js/screens/flows/flow.vue

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,13 @@
561561
<span v-if="entry.status">
562562
- {{ entry.status }}<span v-if="entry.status_bucket"> / {{ entry.status_bucket }}</span>
563563
</span>
564+
<span
565+
v-if="parentClosePolicyBadge(entry)"
566+
:class="parentClosePolicyBadge(entry).class"
567+
:title="parentClosePolicyBadge(entry).title"
568+
>
569+
{{ parentClosePolicyBadge(entry).label }}
570+
</span>
564571
<div
565572
v-for="detail in lineageIdentityRows(entry)"
566573
:key="entry.key + '-' + detail"
@@ -4210,8 +4217,13 @@ export default {
42104217
status: link.status,
42114218
status_bucket: link.status_bucket,
42124219
child_call_id: link.child_call_id || null,
4220+
link_type: link.link_type || null,
42134221
history_authority: link.history_authority || null,
42144222
diagnostic_only: link.diagnostic_only === true,
4223+
parent_close_policy: link.parent_close_policy || null,
4224+
parent_close_policy_outcome: link.parent_close_policy_outcome || null,
4225+
parent_close_policy_reason: link.parent_close_policy_reason || null,
4226+
parent_close_policy_error: link.parent_close_policy_error || null,
42154227
}))
42164228
42174229
return [...parents, ...continued]
@@ -4230,6 +4242,73 @@ export default {
42304242
return direction === 'parent' ? 'Parent' : 'Child'
42314243
},
42324244
4245+
parentClosePolicyBadge(entry) {
4246+
if (!entry || entry.link_type === 'continue_as_new') {
4247+
return null
4248+
}
4249+
4250+
const outcome = entry.parent_close_policy_outcome || null
4251+
const policy = entry.parent_close_policy || null
4252+
4253+
if (!policy && !outcome) {
4254+
return null
4255+
}
4256+
4257+
const policyLabel = this.parentClosePolicyLabel(policy)
4258+
4259+
if (outcome === 'applied') {
4260+
const action = policy === 'terminate' ? 'terminated' : 'cancelled'
4261+
4262+
return {
4263+
class: 'badge badge-warning ml-1',
4264+
label: 'Closed by parent (' + action + ')',
4265+
title: entry.parent_close_policy_reason
4266+
|| ('Parent-close policy ' + policyLabel + ' was applied to this child.'),
4267+
}
4268+
}
4269+
4270+
if (outcome === 'failed') {
4271+
return {
4272+
class: 'badge badge-danger ml-1',
4273+
label: 'Parent-close policy failed (' + policyLabel + ')',
4274+
title: entry.parent_close_policy_error
4275+
|| entry.parent_close_policy_reason
4276+
|| 'Parent attempted to apply close policy but the command was rejected.',
4277+
}
4278+
}
4279+
4280+
// Policy snapshotted on the link but the parent has not (yet) fired
4281+
// a close-policy event for this child — show the operator the
4282+
// standing policy so they can distinguish "open under abandon"
4283+
// from "will be cancelled/terminated when parent closes".
4284+
if (policy === 'abandon') {
4285+
return {
4286+
class: 'badge badge-secondary ml-1',
4287+
label: 'Abandoned by parent on close',
4288+
title: 'Parent-close policy is abandon; this child will keep running independently when the parent closes.',
4289+
}
4290+
}
4291+
4292+
return {
4293+
class: 'badge badge-info ml-1',
4294+
label: 'Parent-close policy: ' + policyLabel,
4295+
title: 'When the parent closes, this child will be ' + (policy === 'terminate' ? 'terminated' : 'cancelled') + '.',
4296+
}
4297+
},
4298+
4299+
parentClosePolicyLabel(policy) {
4300+
switch (policy) {
4301+
case 'request_cancel':
4302+
return 'cancel'
4303+
case 'terminate':
4304+
return 'terminate'
4305+
case 'abandon':
4306+
return 'abandon'
4307+
default:
4308+
return policy || 'unknown'
4309+
}
4310+
},
4311+
42334312
async issueCommand(commandType) {
42344313
if (commandType === 'query') {
42354314
const result = await this.promptForQueryCommand(true)

0 commit comments

Comments
 (0)