Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
ci: give each diagnostic stress or race-hunt dispatch its own concurrency group
garrytan1344d286145e
diff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex 17219809a7..f0078d3347 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -57,10 +57,12 @@ permissions:# github.ref for push/scheduled runs. Mirrors heavy-tests.yml; frees runners# and stops a stale-SHA run from reporting a flaky failure on an obsolete commit.# Explicit native-only retries use a separate group so full persistence soaks finish.+# Each diagnostic dispatch (race_hunt, stress_*) gets its own group, so one+# replay never cancels another or a full run.# Event parity (docs/TESTING.md#event-parity): the event suffixes only separate# runs that must not cancel each other; they change no job, matrix or parameter.concurrency:- group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'workflow_dispatch' && inputs.native_only == true && '-native-only' || '' }}${{ github.event_name == 'workflow_dispatch' && (inputs.race_hunt == true || inputs.stress_files != '' || inputs.stress_base != '') && '-diagnostic' || '' }}${{ github.event_name == 'schedule' && '-nightly' || '' }}+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'workflow_dispatch' && inputs.native_only == true && '-native-only' || '' }}${{ github.event_name == 'workflow_dispatch' && (inputs.race_hunt == true || inputs.stress_files != '' || inputs.stress_base != '') && format('-diagnostic-{0}', github.run_id) || '' }}${{ github.event_name == 'schedule' && '-nightly' || '' }}cancel-in-progress: truejobs:diff --git a/test/scripts/native-only-workflow.test.ts b/test/scripts/native-only-workflow.test.tsindex a917fa8004..c120855abd 100644--- a/test/scripts/native-only-workflow.test.ts+++ b/test/scripts/native-only-workflow.test.ts@@ -15,7 +15,7 @@ type Diagnostic = { race_hunt?: boolean; stress_files?: string; stress_base?: stfunction context(event: string, flag?: boolean, diagnostic: Diagnostic = {}) {// Dispatch inputs carry their declared defaults; other events have no inputs.const inputs = event === 'workflow_dispatch' ? { native_only: flag, race_hunt: false, stress_files: '', stress_base: '', stress_head: '', ...diagnostic } : {};- return { github: { workflow: 'Test', event_name: event, ref: 'refs/heads/example', event: { pull_request: event === 'pull_request' ? { number: 123 } : {} } },+ return { format: (f: string, ...a: unknown[]) => f.replace(/\{(\d+)\}/g, (_, i) => String(a[Number(i)])), github: { workflow: 'Test', event_name: event, ref: 'refs/heads/example', run_id: '77', event: { pull_request: event === 'pull_request' ? { number: 123 } : {} } },inputs, always: () => true };}function evaluate(expression: string, event: string, flag?: boolean, diagnostic?: Diagnostic): unknown {@@ -61,7 +61,7 @@ describe('native-only CI remains separate from full validation', () => {expect(runs, `${name} under ${input}`).toBe(expected);}expect(template(workflow.jobs['test-status'].name!, 'workflow_dispatch', false, diagnostic)).toBe('full-suite-not-run');- expect(template(workflow.concurrency.group, 'workflow_dispatch', false, diagnostic)).toBe('Test-refs/heads/example-diagnostic');+ expect(template(workflow.concurrency.group, 'workflow_dispatch', false, diagnostic)).toBe('Test-refs/heads/example-diagnostic-77');}// Outside dispatch the gate always runs (and decides "not a PR event" itself); the race hunt runs only on schedule.for (const event of ['push', 'pull_request', 'merge_group', 'schedule']) {