diff --git a/.github/workflows/pr-e2e-gate.yaml b/.github/workflows/pr-e2e-gate.yaml index f5da886a74c..243809959bc 100644 --- a/.github/workflows/pr-e2e-gate.yaml +++ b/.github/workflows/pr-e2e-gate.yaml @@ -9,7 +9,11 @@ run-name: >- github.event.pull_request.number, github.event.pull_request.head.sha, github.event.pull_request.base.sha, github.event.action != 'closed') || - format('E2E Gate {0} {1}', github.event_name, github.run_id) }} + github.event_name == 'workflow_run' && + format('E2E Gate coordinate from {0}', + github.event.workflow_run.display_title) || + format('E2E Gate approve PR #{0} head {1} base {2}', + inputs.pr_number, inputs.expected_head_sha, inputs.expected_base_sha) }} on: workflow_run: diff --git a/test/e2e/README.md b/test/e2e/README.md index 815192f13c0..6e7d48a30d5 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -589,6 +589,9 @@ and advisor concurrency groups include that eligibility, so an ignored metadata-edit run cannot cancel an eligible run for the same PR. The trusted controller reads all changed files after eligible PR CI completes and builds the deterministic risk plan. +The controller's Actions run name carries that CI display title so operators +can distinguish simultaneous PR, head, and base identities even when the event +omits pull-request metadata. Runtime families and changes to workflow-wired live tests or their owning helpers select canonical jobs from the trusted `e2e.yaml` inventory independently of advisor output. A workflow-wired live test or owning helper @@ -796,6 +799,8 @@ commit SHA, base SHA, selected jobs and targets, and maintainer then chooses **Run workflow** on `main`, selects `approve-e2e`, and supplies the PR number, recorded head SHA, recorded base SHA, and a specific review reason. +The manual controller run name includes the supplied PR, head, and base +identity for operator coordination. GitHub supplies the triggering actor; the controller requires that account to have current `maintain` or `admin` permission. diff --git a/test/pr-e2e-gate-workflow.test.ts b/test/pr-e2e-gate-workflow.test.ts index 443a369a677..be5fd7627fe 100644 --- a/test/pr-e2e-gate-workflow.test.ts +++ b/test/pr-e2e-gate-workflow.test.ts @@ -20,6 +20,16 @@ const HEAD_SHA = "a".repeat(40); const BASE_SHA = "b".repeat(40); const WORKFLOW_SHA = "d".repeat(40); const TRUSTED_SETUP_NODE_ACTION = "actions/setup-node@820762786026740c76f36085b0efc47a31fe5020"; +const PR_GATE_RUN_NAME = [ + "${{ github.event_name == 'pull_request_target' &&", + "format('E2E Gate PR #{0} head {1} base {2} gate {3}',", + "github.event.pull_request.number, github.event.pull_request.head.sha,", + "github.event.pull_request.base.sha, github.event.action != 'closed') ||", + "github.event_name == 'workflow_run' &&", + "format('E2E Gate coordinate from {0}', github.event.workflow_run.display_title) ||", + "format('E2E Gate approve PR #{0} head {1} base {2}',", + "inputs.pr_number, inputs.expected_head_sha, inputs.expected_base_sha) }}", +].join(" "); type CoordinatorJob = WorkflowJob & { concurrency?: { group: string; queue?: "max"; "cancel-in-progress": boolean }; @@ -276,12 +286,7 @@ describe("PR E2E gate workflow", () => { const observerPollMinutes = 21_480 / 60; expect(workflow.name).toBe("E2E / PR Gate Controller"); - expect(workflow["run-name"]).toContain("E2E Gate PR #{0} head {1} base {2} gate {3}"); - expect(workflow["run-name"]).toContain("github.event.pull_request.number"); - expect(workflow["run-name"]).toContain("github.event.pull_request.head.sha"); - expect(workflow["run-name"]).toContain("github.event.pull_request.base.sha"); - expect(workflow["run-name"]).toContain("github.event.action != 'closed'"); - expect(workflow["run-name"]).not.toContain("github.event.changes.base != null"); + expect(workflow["run-name"]).toBe(PR_GATE_RUN_NAME); expect(workflow.on).toEqual({ workflow_run: { workflows: ["CI / Pull Request"],