Repository navigation
Commit 89964c1
ci(shard-timings-refresh): push and open the refresh PR as the fleet App so it runs CI (#26017)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D4WbEC4Xfs3EygKcaDSqinr)_
Part of #25936. The card stays open for two readings this PR cannot take
before it merges (see "What stays open").
## 维护者速读(草稿)
**改了什么**:每周一自动刷新 Test Core 分片计时数据的
workflow(`shard-timings-refresh.yml`),推分支、开 PR、打标签这三步改用 fleet
App(`objectstack-fleet[bot]`)的身份做。令牌在 runner 上现铸,只对本仓、只给 contents 和
pull-requests 两项写权限,用完即吊销。job 自己的 `GITHUB_TOKEN` 降为只读。
**为什么改**:以前用 Actions 自带的 `GITHUB_TOKEN` 开 PR(仓里没有配
`RELEASE_PUSH_TOKEN`),GitHub 对这种 PR 不启动任何 CI。结果每次刷新 PR
都要有人手动推一下才有检查:#24467 等了十天,今天的 #25960 是席位用中继 `pr_update_branch`
才跑起来的。刷新会改变分片切法,恰恰最需要 CI 读一遍。
**风险与代价(含回滚)**:用的是 fleet-write 已在用的那对组织级凭据(`OS_FLEET_APP_ID` /
`OS_FLEET_PRIVATE_KEY`),不引入 PAT。凭据不可见时这一步直接报红并点名缺哪一半,不会悄悄退回无 CI 的老路。PR
上跑这个 workflow 时照旧是演练,不铸令牌、不读密钥。回滚就是 revert 这一个文件。ui/
的逐文件计时数据集这次没接上(见下文),它由 #25712 第 5 项承接。
**席位意见**:
**你要做的**:本 PR 是 Tier H(`.github/workflows/**`),需要一位 GOVERNED_APPROVERS
批准;批准后席位落地。
## What changed
`.github/workflows/shard-timings-refresh.yml` only (+78 / −24):
- **Two new steps before the write step**, both skipped on
`pull_request` and when the dataset is byte-identical:
- `Check the fleet App credential is visible to this repository` reads
`vars.OS_FLEET_APP_ID` and `secrets.OS_FLEET_PRIVATE_KEY` as booleans
(never printed) and reds with a message naming the missing half.
- `Mint the fleet App token, narrowed to this repository`:
`actions/create-github-app-token@v3`, the same action and credential
pair `fleet-write.yml` mints with, and the route ui/'s refresh took in
objectstack-ai/objectui#13362. The grants are `contents: write` (push
the bot branch) and `pull-requests: write` (open the PR, add
`skip-changeset`). It has no `workflows` grant, because the branch is
cut from the checked-out `main` plus one commit touching only the
dataset.
- **Write step**: `GH_TOKEN` is the minted token on a live run and the
run's read-only token on a `pull_request` dry run, where `outward` hands
it to nothing. A live run with no minted token arrives empty and the
existing `GH_TOKEN:?` guard reds it. `outward gh auth setup-git` points
git at that token for the push. The commit author is now
`objectstack-fleet[bot]`.
- **Job permissions** drop from `contents: write` + `pull-requests:
write` + `actions: read` to `contents: read` + `actions: read`. The
checkout uses `persist-credentials: false` and no longer reads
`RELEASE_PUSH_TOKEN`.
- **PR body**: the "No checks will start on this PR by themselves"
section and its `USED_PAT` switch are gone. It is replaced by one line
saying the PR was opened as the fleet App and runs its own CI (the
card's step 3).
## The measurement this rests on
1. **The root refresh has the card's no-CI defect.** #25960 (2026-10-26
05:47Z) is authored by `github-actions[bot]`, and its body carries the
`USED_PAT != true` section, so `RELEASE_PUSH_TOKEN` is not configured.
It got CI only after a relay `pr_update_branch`. #24467 (2026-10-19) sat
ten days the same way.
2. **The ui/ per-file dataset has no producer.**
`ui/.github/workflows/test-shard-timings-refresh.yml` is nested, so
GitHub never runs it. Root `ci.yml`'s `Test UI (N/16)` passes no timings
reporter and uploads no `test-file-timings-N` artifact, and its own
comment says so: the port belongs to the governance-workflow audit. That
audit is #25712 item 5, which names `test-shard-timings-refresh` among
the workflows to fold into the objectstack counterpart and widen to
`ui/**`. #25712 is in flight under another seat's claim, so this PR does
not build that half. The dataset today:
`ui/scripts/test-shard-timings.json` was measured 2026-10-19T06:37Z over
6 runs and holds 5,547 keys. Of the 5,805 tracked `*.test.*` files under
`ui/` (excluding `e2e/` and `apps/site/`), 290 have no key and are
weighed at the median, and 32 keys name files that no longer exist. That
count is from `git ls-files` and is an upper bound on what vitest
collects.
## Verification
Head `cadda147` (`50d4fffd` plus a merge of `origin/main` `a3e5bfa6`, no
conflict; this PR's diff against `main` is the one file).
- **The write step, driven as written.** Its `run:` block was lifted out
of the YAML and run under `bash -e` in a scratch repository:
- Dry leg (`DRY_RUN=true`, `pull_request`, stand-in `GH_TOKEN`): exit 0.
Every outward act printed `DRY RUN, not executed:`, including `gh auth
setup-git`. The local commit was authored `objectstack-fleet[bot]`,
email `332303061+objectstack-fleet[bot]@users.noreply.github.com`.
- Live leg with an empty `GH_TOKEN` (a run where minting did not
happen): exit 1 at the guard, `GH_TOKEN: is not set; gh would run
unauthenticated. Nothing was pushed.`
- **The credential check, three legs.** Both set: exit 0, and it writes
`repository=objectstack`. App id missing: exit 1. Key missing: exit 1.
- **Derived gates**: `node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack` derived 42 families. All 42 ran
locally with exit 0, including `select-shard-timings-run.mjs
--self-test` (it lifts and runs this workflow's selection step),
`measure-test-shard-timings.mjs --self-test`, `partition-test-shards.mjs
--self-test`, `check-step-collectors`, `check-whole-set-label-write`,
`check-workflow-step-name-quoting` and `check:pm-dispatch-gates` (fast
tier, 1917 cases). `--ran` reconciled: 42 run, 0 NOT MEASURED.
- **This PR's own `pull_request` run of the lane** (the path filter
includes the workflow) executes everything up to and including the write
step's local commit, with the new `env:`. That is the on-runner proof of
the dry leg; read it on the PR's checks.
- `check-governed-merges --branch HEAD`: GOVERNED,
`.github/workflows/**`, Tier H, 102 changed lines.
## What stays open on the card
- **The acceptance reading.** The first live refresh after this lands
must show check runs on its PR within 10 minutes, with no human push.
That is the next Monday cron (2026-11-02 05:30Z), or sooner through a
relay `workflow_dispatch` of `shard-timings-refresh.yml` at `main`.
- **The ui/ dataset half.** #25712 item 5 carries it (fold the ui
refresh into this lane). #25936 remains open until the seat records how
that lands.
## Acceptance notes
- `cut-rc.yml` makes the same "PAT if present, Actions token otherwise"
choice for the release-candidate PR. It is out of scope for this card
and is noted only, not filed.
- No changeset: this PR changes a workflow, which publishes nothing
(`skip-changeset`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_014GRKsjPHqpppQDE1LMetJX
Co-authored-by: Claude <noreply@anthropic.com>1 parent db5fca7 commit 89964c1
1 file changed
Lines changed: 78 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
259 | 262 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 271 | + | |
277 | 272 | | |
278 | 273 | | |
279 | 274 | | |
| |||
710 | 705 | | |
711 | 706 | | |
712 | 707 | | |
713 | | - | |
714 | 708 | | |
715 | 709 | | |
716 | 710 | | |
| |||
907 | 901 | | |
908 | 902 | | |
909 | 903 | | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
918 | 907 | | |
919 | 908 | | |
920 | 909 | | |
| |||
924 | 913 | | |
925 | 914 | | |
926 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
927 | 974 | | |
928 | 975 | | |
929 | 976 | | |
| |||
956 | 1003 | | |
957 | 1004 | | |
958 | 1005 | | |
959 | | - | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
960 | 1011 | | |
961 | 1012 | | |
962 | 1013 | | |
| |||
1004 | 1055 | | |
1005 | 1056 | | |
1006 | 1057 | | |
1007 | | - | |
1008 | | - | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1009 | 1063 | | |
1010 | 1064 | | |
1011 | 1065 | | |
| |||
0 commit comments