Repository navigation
Commit 9212035
test(cli): pin the Setup Integrations merged order to each contributor's priority (#28336)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao7HnHZJorpia6QZ5CZ4pABw)_
Fixes #28260
Refs #27238
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:新增一个测试,钉住 Setup → Integrations
分组里五个入口的顺序(Webhooks/Datasources → Connect an Agent → Connector
Credentials → Cloud Connection),顺序从各插件真实的 `priority`
读出;另在真实运行的服务上走通了「安装应用 → 缺凭据 → 跳过 → 去凭据页填写 → 连接器无需重启即就绪」的全过程,记录贴在卡上。
- **为什么改**:#28200 的契约复审留了两条应修项:S1 要求在真实环境证明凭据闭环,S2
要求防止以后有人改一个数字就悄悄打乱管理员看到的菜单顺序。
- **风险与回滚**:只加一个测试文件,不动任何产品代码,不发布任何包;回滚即删除该文件。
-
**先看**:`packages/cli/test/setup-integrations-order.pin.test.ts`(顺序断言与优先级读取两段)。
- **两分钟验证**:`pnpm --filter @objectstack/cli exec vitest run --project
unit test/setup-integrations-order.pin.test.ts`,预期 1 passed;把 Connect an
Agent 与 Connector Credentials 的 priority 对调后重建,同一命令变红。
- **需要你做的**:无,席位落地。
## What changes
One new test file,
`packages/cli/test/setup-integrations-order.pin.test.ts` (S2 of the
contract review on #28200). It composes the real Setup app shell and the
five packages that contribute into `group_integrations`, folds them
through the real `SchemaRegistry`, and asserts:
- the merged order, tier by tier: `nav_webhooks` / `nav_http_deliveries`
/ `nav_datasources` (one priority, compared as a set because the fold's
stable sort leaves that tie to registration order), then
`nav_connect_agent`, then `nav_connector_credentials`, then
`nav_cloud_connection`;
- the priorities behind that order, **read from the contributions
themselves** (no priority literal appears in the test): each tier shares
one priority and every tier sorts strictly before the next, with the
failure message naming the package that declares each side;
- that nothing else contributes into the group, so a new entry is a
deliberate edit of this pin.
`@objectstack/plugin-webhooks` and `@objectstack/service-datasource`
register their contribution from `init()`, so they are booted on a
context serving only the `manifest` service, the same way
`packages/cli/scripts/check-app-nav-i18n.mjs` boots them. The file uses
`SchemaRegistry` directly (no `new ObjectQL(`), so it classifies into
the `unit` tier.
S1 (the live round trip) changes no file. Its record is posted on
#28260.
## Tests
- `pnpm --filter @objectstack/cli exec vitest run --project unit
test/setup-integrations-order.pin.test.ts
test/connect-agent-both-halves-wire.pin.test.ts
test/vitest-tiers-partition.test.ts` at `98931dde`: 3 files, 25 tests
passed.
- Ablation (one-time, not kept): swapped the two priorities in source
(`connector-credentials-ui.ts` 120 to 110, `connect-ui.ts` 110 to 120)
with `scripts/ablation-replace.mjs`, rebuilt both packages,
`ablation-dist-preflight.mjs` saw both markers in `dist/`, and the pin
went red on the tier assertion (`expected Set{
'nav_connector_credentials' } to deeply equal Set{ 'nav_connect_agent'
}`). Restore proven (blob equals HEAD, `git diff HEAD` empty), both
packages rebuilt, `--absent` preflight clean, pin green again.
- `pnpm --filter @objectstack/cli exec vitest run --project unit
--maxWorkers=2` at `98931dde`: 358 files, 5136 tests passed. The
`integration` tier is declared to CI (the diff touches no
integration-tier file or spawn entry).
- `pnpm --filter @objectstack/cli typecheck` (tsc plus
`check:test-typecheck`): exit 0.
## Acceptance notes
- **S1 ran on a probe package, not on HotCRM.** HotCRM declares no
connector at all: `git grep -il credentialRef origin/main` over
`objectstack-ai/hotcrm` at `a598256` returns nothing, and its own
`content/docs/guides/integrations.mdx` says "`src/` carries no connector
metadata of any kind". The Slack connector the decision card #27230
cites is a roadmap line in that page, so installing HotCRM would list no
reference. The probe package (`com.example.slackprobe`) declares one
`rest` connector whose bearer token is `credentialRef: SLACK_BOT_TOKEN`.
- **The marketplace catalog was a local stand-in.** This container's
proxy refuses `cloud.objectos.ai` and `marketplace.objectos.ai` (CONNECT
403), so the dev stack read its catalog through
`OS_MARKETPLACE_PUBLIC_BASE_URL` pointed at a local server serving the
snapshot shape (`packages.json`, `packages/ID.json`,
`packages/ID/versions/latest/manifest.json`). Everything after that (the
Console package page, `POST /api/v1/marketplace/install-local`, the
credential step, the Setup page, the credential door, the automation
service) is the real stack.
- The live Setup sidebar served the Integrations group in exactly the
order this pin holds: Webhooks, HTTP Deliveries, Datasources, Connect an
Agent, Connector Credentials, Cloud Connection.
- Observation, not filed: the Connector Credentials page's "Last
changed" column shows the raw user id (`… by
aPIvyNcbsR4QACN8KHZlCylmhRIImV7v`) rather than a name. carrier: none.
## Verification
<details><summary>Derived gates: 48 derived, 48 run, all exit 0
(reconciled at 98931dd)</summary>
`node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran …`: "48 derived famil(ies) accounted for — 48 run, 0
NOT-MEASURED". `check-plugin-teardown-shape.mjs --self-test` first
answered exit 3 (its fixture commit absent from the shallow clone);
after `git fetch origin 621a487
--depth=1` it passed (48 cases). `node scripts/check-sdui-manifest.mjs`:
exit 0. The record is `28260-gates-ran-98931dde.list` in the seat's out
folder.
</details>
<details><summary>S1 live round trip (summary; the full record is on
#28260)</summary>
`pnpm dev -- --fresh -p 38517` (showcase), no connector env var set
(`SLACK_BOT_TOKEN` unset), catalog stand-in on 38518. Install from the
Console package page: `POST /api/v1/marketplace/install-local`
`{"packageId":"slack_probe"}` answered 200 with `credentialRefs: [{ref:
SLACK_BOT_TOKEN, status: missing}]`; the step listed `SLACK_BOT_TOKEN ·
slack_probe_api`; Skip showed "Skipped for now" with a link to
`/_console/apps/com.objectstack.setup/component/automation/connector-credentials`;
on that page `PUT …/credential-refs/SLACK_BOT_TOKEN` answered `status:
set, source: object` with the connector `state: ready`; `GET
/api/v1/automation/connectors` lists `slack_probe_api` `ready` with
action `request`. Server pid 15400 before and after. The value appeared
in no response body, no DOM text, no input after save, no reloaded page
and no server log line.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qiby1xTh1tChY988SHhX)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent ab0c5df commit 9212035
1 file changed
Lines changed: 181 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 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 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
0 commit comments