Compare commits

...

3 Commits

Author SHA1 Message Date
Pat Sukprasert 83d0c920fd ci(merge-ready): fire the rerun for same-repo PRs too, not just forks
#792 (same-repo) wedged the same way as #751 (fork): merge-ready's
workflow_run trigger should have fired on the pull_request e2e completion
but GitHub dropped the delivery, so the gate status was never posted.

Generalize the merge-ready-rerun job to dispatch on the same-repo
pull_request run as well as the fork-e2e/pr-<N> push. PR number resolves
from github.event.pull_request.number or the branch; needs.<job>.result !=
'skipped' excludes draft / empty-matrix runs and fork pull_request runs
(read-only token; those reach the gate via the fork-e2e push). Since the
dispatch is an explicit API call rather than a workflow_run event, it
can't be dropped.

Co-authored-by: Isaac
2026-06-19 15:50:40 +08:00
Pat Sukprasert cc47eedf5d ci(merge-ready): also self-dispatch from Integration on fork-e2e push
Integration is a required gate check (required.sh) and runs on the
fork-e2e/** mirror push alongside e2e/e2e-ui. If it finishes last, neither
e2e nor e2e-ui would fire the final all-green dispatch, leaving the PR
wedged. Add the same merge-ready-rerun job to integration.yml so whichever
required suite finishes last reconciles the gate.

Co-authored-by: Isaac
2026-06-19 15:38:21 +08:00
Pat Sukprasert b0442be6b3 ci(merge-ready): self-dispatch the gate from the fork-e2e push
For fork PRs the secret-bearing e2e suite runs as a push on the trusted
fork-e2e/pr-<N> mirror branch, and merge-ready.yml learns it went green
only through a workflow_run / check_suite event. That delivery is brittle
and GitHub dropped it on #751: every real check was green but the required
"Merge Ready" status was never posted, wedging the PR on "Expected --
waiting for status to be reported".

Add a merge-ready-rerun job to e2e.yml and e2e-ui.yml that, on the
fork-e2e/pr-<N> push, dispatches merge-ready.yml directly. This is
in-process, so there is no cross-workflow event to drop. It checks out no
code and is scoped to actions:write only, so fork test code (in the
separate shard jobs) never sees the token; workflow_dispatch via
GITHUB_TOKEN is exempt from the recursion guard, matching how the approval
relay already dispatches fork-e2e-mirror.

Co-authored-by: Isaac
2026-06-19 15:19:49 +08:00
3 changed files with 111 additions and 0 deletions
+37
View File
@@ -365,3 +365,40 @@ jobs:
echo "- 📜 server.log: _no artifact uploaded (glob matched nothing)_"
fi
} >> "$GITHUB_STEP_SUMMARY"
# Explicitly re-dispatch Merge Ready (same-repo PR or fork-e2e push): the
# workflow_run hop is brittle and was dropped on #751/#792. No checkout,
# actions:write only; GITHUB_TOKEN workflow_dispatch is exempt from recursion.
merge-ready-rerun:
name: Merge Ready rerun
needs: e2e-ui
if: >-
always()
&& needs.e2e-ui.result != 'skipped'
&& (
(github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository)
|| (github.event_name == 'push'
&& startsWith(github.ref_name, 'fork-e2e/pr-'))
)
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: write
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
REF_NAME: ${{ github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Re-dispatch Merge Ready
run: |
set -euo pipefail
# same-repo PR -> event number; fork-e2e push -> parse fork-e2e/pr-<N>
PR="${PR_NUMBER:-${REF_NAME##*/pr-}}"
if ! [[ "$PR" =~ ^[0-9]+$ ]]; then
echo "::notice::could not resolve PR number (ref='$REF_NAME'); nothing to do."
exit 0
fi
echo "Re-dispatching merge-ready.yml for PR #$PR after $GITHUB_WORKFLOW."
gh workflow run merge-ready.yml --repo "$REPO" -f pr="$PR"
+37
View File
@@ -273,3 +273,40 @@ jobs:
# `warn` not `ignore`: every shard makes LLM calls, so a missing
# tokens file means the recorder broke.
if-no-files-found: warn
# Explicitly re-dispatch Merge Ready (same-repo PR or fork-e2e push): the
# workflow_run hop is brittle and was dropped on #751/#792. No checkout,
# actions:write only; GITHUB_TOKEN workflow_dispatch is exempt from recursion.
merge-ready-rerun:
name: Merge Ready rerun
needs: e2e
if: >-
always()
&& needs.e2e.result != 'skipped'
&& (
(github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository)
|| (github.event_name == 'push'
&& startsWith(github.ref_name, 'fork-e2e/pr-'))
)
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: write
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
REF_NAME: ${{ github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Re-dispatch Merge Ready
run: |
set -euo pipefail
# same-repo PR -> event number; fork-e2e push -> parse fork-e2e/pr-<N>
PR="${PR_NUMBER:-${REF_NAME##*/pr-}}"
if ! [[ "$PR" =~ ^[0-9]+$ ]]; then
echo "::notice::could not resolve PR number (ref='$REF_NAME'); nothing to do."
exit 0
fi
echo "Re-dispatching merge-ready.yml for PR #$PR after $GITHUB_WORKFLOW."
gh workflow run merge-ready.yml --repo "$REPO" -f pr="$PR"
+37
View File
@@ -221,3 +221,40 @@ jobs:
path: artifacts/
retention-days: 14
if-no-files-found: ignore
# Explicitly re-dispatch Merge Ready (same-repo PR or fork-e2e push): the
# workflow_run hop is brittle and was dropped on #751/#792. No checkout,
# actions:write only; GITHUB_TOKEN workflow_dispatch is exempt from recursion.
merge-ready-rerun:
name: Merge Ready rerun
needs: integration
if: >-
always()
&& needs.integration.result != 'skipped'
&& (
(github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository)
|| (github.event_name == 'push'
&& startsWith(github.ref_name, 'fork-e2e/pr-'))
)
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: write
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
REF_NAME: ${{ github.ref_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Re-dispatch Merge Ready
run: |
set -euo pipefail
# same-repo PR -> event number; fork-e2e push -> parse fork-e2e/pr-<N>
PR="${PR_NUMBER:-${REF_NAME##*/pr-}}"
if ! [[ "$PR" =~ ^[0-9]+$ ]]; then
echo "::notice::could not resolve PR number (ref='$REF_NAME'); nothing to do."
exit 0
fi
echo "Re-dispatching merge-ready.yml for PR #$PR after $GITHUB_WORKFLOW."
gh workflow run merge-ready.yml --repo "$REPO" -f pr="$PR"