You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit caf5b79
Browse filesBrowse the repository at this point in the historyBrowse files
ci(shard-timings): give the write-back step every variable it expands, and rehearse it on pull_request
The step that pushes the refresh branch and opens the PR expanded RUN_COUNT
and RUNS in its commit message under set -u, but its env: exported only
GH_TOKEN, RUN_ID and HEAD_SHA, so the scheduled refresh died at git commit
after the dataset had been computed. Export all four generate outputs, as
the compose step already does.
The pull_request dry run was a separate, mutually exclusive step, so the
script that writes never ran before a merge. Fold the two into one step
that runs on every event with one env: block; the branch, add and commit
run for real on the runner, and every act that leaves it (git push,
gh pr create, gh pr view, the label write and read-back) goes through a
single outward() switch driven by DRY_RUN. A variable missing from env:
now reds the pull_request run that dropped it. The script refuses a
DRY_RUN other than true/false, and refuses false on a pull_request run.
Claude-Session: https://claude.ai/code/session_013RDBh5DqXd2xnLwvHLgLFr
Co-authored-by: Claude <noreply@anthropic.com>
echo "::error::DRY_RUN must be 'true' or 'false', got '$DRY_RUN'. Nothing was pushed."
686
+
exit 1
687
+
;;
688
+
esac
689
+
if [ "$GITHUB_EVENT_NAME" = 'pull_request' ] && [ "$DRY_RUN" != 'true' ]; then
690
+
echo "::error::DRY_RUN is '$DRY_RUN' on a pull_request run. A pull_request run of this lane never pushes a branch, opens a PR or writes a label. Nothing was pushed."
691
+
exit 1
692
+
fi
693
+
694
+
# outward [--stand-in TEXT] COMMAND...
695
+
# The one dry-run switch. Live, it runs COMMAND. Dry, it prints COMMAND
696
+
# to the log instead, and prints TEXT on stdout where the live call's
697
+
# output would have been, so every line after it runs on a value of
-m "chore(ci): refresh the Test Core shard-timings dataset" \
653
722
-m "Regenerated by .github/workflows/shard-timings-refresh.yml from the test-core-run-summary artifacts of $RUN_COUNT accumulated run(s) ($RUNS), newest $RUN_ID at $HEAD_SHA. Generated, never hand-edited."
654
-
git push origin "$BRANCH"
723
+
outward git push origin "$BRANCH"
655
724
656
-
PR_URL=$(gh pr create --base main --head "$BRANCH" \
outward gh api --method POST "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" \
667
737
-f "labels[]=skip-changeset" > /dev/null
668
738
669
739
# Read back, because an additive write is necessary and not sufficient:
670
740
# a concurrent whole-set PUT from another workflow can still strip the
671
741
# label after a successful POST. `skip-changeset` is this PR's exemption
672
742
# from the changeset gate — it publishes nothing — so losing it turns
673
743
# the gate red on a PR that legitimately has no changeset.
674
-
if gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" --jq '.[].name' \
744
+
if outward --stand-in skip-changeset gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" --jq '.[].name' \
675
745
| grep -qxF 'skip-changeset'; then
676
-
echo "skip-changeset confirmed on PR #$PR_NUMBER."
746
+
echo "${DRY_TAG}skip-changeset confirmed on PR #$PR_NUMBER."
677
747
else
678
748
echo "::warning::skip-changeset did not survive the write on PR #$PR_NUMBER (a concurrent whole-set label PUT strips it). Re-applying once."
679
-
gh api --method POST "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" \
749
+
outward gh api --method POST "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" \
680
750
-f "labels[]=skip-changeset" > /dev/null
681
-
gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" --jq '.[].name' \
751
+
outward gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/labels" --jq '.[].name' \
682
752
| grep -qxF 'skip-changeset' \
683
753
|| echo "::error::skip-changeset is still absent from PR #$PR_NUMBER; the changeset gate will demand a changeset this PR legitimately has none of. Apply the label by hand."
684
754
fi
685
755
686
-
# The dry-run half of the `pull_request` posture. Everything above ran for
687
-
# real; this renders the body that WOULD have been posted, so a reviewer of
688
-
# a change to this lane sees the actual output rather than the diff of the
689
-
# code that produces it.
690
-
- name: Dry run — the pull request this would have opened
0 commit comments