This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
Commit cf24190
ci(test-shard-timings-refresh): push and open the refresh pull request as the fleet App so it runs CI (#13362)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4Uu2XCfGL2rwSd3BXynetsBjb)_
Clause-②: no
Metadata-protocol: none
Part of #13349 (step 2). Step 1, the one-time landing of #13028, is on
that pull request.
## 维护者速读(草稿)
- **改了什么:** 每周刷新分片耗时的 workflow,推分支和开 PR 不再用 Actions 自带的 token,改为在 runner
上用 fleet App(`objectstack-fleet[bot]`)临时铸一个 token:只对 objectui 一个仓、只给
contents / pull-requests / workflows 写权限,job 结束即吊销。job 自己的 token 降为只读。文档
`ci-cd-pipeline.md` 同步改写那一节,并在密钥表里登记这对组织级凭据。
- **为什么改:** Actions token 发出的事件 GitHub 不触发 CI,所以刷新 PR 每周都拿不到
CI,只能等人推一下。#13028 从 10-19 等到 10-23,这期间分片不均 1.3–1.8 倍,拖慢每一张 PR。
- **风险与代价(含回滚):** objectui 的一个 workflow 步骤开始读组织密钥
`OS_FLEET_PRIVATE_KEY`,这是唯一新增的信任面;PR 跑(含 fork)不铸
token、不读密钥。凭据对本仓不可见时,周一那次 run 会红并写明原因,不会悄悄退回旧 token。回滚就是 revert 这一个提交。
- **席位意见:**
- **你要做的:** 确认组织密钥 `OS_FLEET_PRIVATE_KEY` 与变量 `OS_FLEET_APP_ID` 对
objectui 可见,并确认 #5397 对 App token 的否决只管 release PR;两点都同意就批准本 PR。
## What changed
`.github/workflows/test-shard-timings-refresh.yml`:
- New step `Check the fleet App credential is visible to this
repository`: reads `vars.OS_FLEET_APP_ID != ''` and
`secrets.OS_FLEET_PRIVATE_KEY != ''` as booleans (nothing printed) and
goes red with a message naming the missing one. It also writes the
token's one repository name.
- New step `Mint the fleet App token, narrowed to this repository`:
`actions/create-github-app-token@v3` (the same action and credential
pair objectstack's `fleet-write.yml` mints with), `repositories` = this
repository only, `permission-contents`, `permission-pull-requests` and
`permission-workflows` write. The last is there because the weekly
force-push moves the branch from last week's base to today's `main`,
across whatever workflow files landed in between, which GitHub refuses
for an App token without it; the workflow writes no workflow file.
- `Open or update the refresh pull request` now uses that token (`gh
auth setup-git` for the push), commits as `objectstack-fleet[bot]`, and
its pull request body says the PR runs its own CI instead of asking for
a human push.
- The job's `GITHUB_TOKEN` drops from `contents: write` +
`pull-requests: write` to `contents: read` (plus the existing `actions:
read`); checkout no longer persists a credential.
- Both new steps share the existing `github.event_name !=
'pull_request'` guard, so a pull-request run (including a fork's) never
reads the App secret.
- The header's "The cost it carries, stated" section is rewritten as
"Whose identity opens the pull request, and why", carrying the #5397 /
#13349 reasoning and the two prohibitions (no personal access token, no
fallback to `GITHUB_TOKEN`).
`content/docs/guide/ci-cd-pipeline.md`: the workflow's section, its
inventory row, and the secrets table.
No changeset: `node scripts/check-changeset-presence.mjs` says no
released package's source or contract moved.
## Governing text
- The ruling recorded on #13349 (Sales, 2026-10-23, option A), and the
two maintainer confirmations it asks for there: the organization
credential's visibility to this repository, and #5397's rejection read
as scoped to the release pull request.
- objectui#5397 (no personal access token in automation): kept.
## Verification
At head `c543446`, exit codes captured before any pipe:
- `pnpm exec vitest run scripts/__tests__` :: exit 0 (190 files passed,
2 skipped; 5727 tests passed)
- `node scripts/check-action-ref-convention.mjs` :: exit 0 (14 distinct
refs, 0 off-convention)
- `pnpm run check:control-bytes` / `check:doc-fences` /
`docs:check-links` / `check:new-line-citations` :: exit 0 each
- `node scripts/check-changeset-presence.mjs` :: exit 0 (no changeset
owed)
- YAML parses.
Not observable before merge, stated plainly: the mint, the push and the
pull request open only on `schedule` / `workflow_dispatch` on `main`.
The first proof is a `workflow_dispatch` of this workflow after merge
(or the Monday 06:47 UTC run): the refresh PR should show check runs
within minutes with no human push. The `workflows: write` need on a
force-push across workflow-file changes is GitHub's documented App-token
behaviour, not measured here.
## Acceptance notes
- #13028's run on its synced head (`17b3796`, a full-suite PR run) put
the 16 test legs at 6.7 to 11.9 minutes of wall clock, about 1.8x. The
card's ≤1.2x reading belongs to the first full battery on `main` after
#13028 lands; the card session reads it and reports on #13349.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Cr2pnminvpXPZAG6sKgzgN)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Cr2pnminvpXPZAG6sKgzgN
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3688e5c commit cf24190
2 files changed
Lines changed: 99 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
49 | 73 | | |
50 | 74 | | |
51 | 75 | | |
| |||
71 | 95 | | |
72 | 96 | | |
73 | 97 | | |
74 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
75 | 104 | | |
76 | 105 | | |
77 | 106 | | |
| |||
103 | 132 | | |
104 | 133 | | |
105 | 134 | | |
| 135 | + | |
| 136 | + | |
106 | 137 | | |
107 | | - | |
108 | | - | |
| 138 | + | |
109 | 139 | | |
110 | 140 | | |
111 | 141 | | |
| 142 | + | |
| 143 | + | |
112 | 144 | | |
113 | 145 | | |
| 146 | + | |
| 147 | + | |
114 | 148 | | |
115 | 149 | | |
116 | 150 | | |
| |||
158 | 192 | | |
159 | 193 | | |
160 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
161 | 226 | | |
162 | | - | |
| 227 | + | |
163 | 228 | | |
164 | | - | |
| 229 | + | |
165 | 230 | | |
166 | 231 | | |
167 | 232 | | |
168 | 233 | | |
169 | 234 | | |
170 | 235 | | |
171 | | - | |
172 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
173 | 239 | | |
174 | 240 | | |
175 | 241 | | |
| |||
179 | 245 | | |
180 | 246 | | |
181 | 247 | | |
182 | | - | |
| 248 | + | |
183 | 249 | | |
184 | 250 | | |
185 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
2997 | 2997 | | |
2998 | 2998 | | |
2999 | 2999 | | |
3000 | | - | |
3001 | | - | |
3002 | | - | |
3003 | | - | |
3004 | | - | |
| 3000 | + | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
| 3009 | + | |
| 3010 | + | |
3005 | 3011 | | |
3006 | 3012 | | |
3007 | | - | |
3008 | | - | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
3009 | 3016 | | |
3010 | 3017 | | |
3011 | 3018 | | |
| |||
3456 | 3463 | | |
3457 | 3464 | | |
3458 | 3465 | | |
| 3466 | + | |
3459 | 3467 | | |
3460 | 3468 | | |
3461 | 3469 | | |
| |||
0 commit comments