Repository navigation
Commit 1c5b177
fix(service-automation): a stored connector's configuration fault never stops the platform starting (#28729)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XPL1bcTnVyoZPzisVsEVors)_
Fixes #28698
Clause-②: no — no accepted value and no public surface changes: the same
stored definitions are refused as before; a start now carries on past
them instead of stopping.
Metadata-protocol: none
## 维护者速读
- 改了什么:环境里保存的连接器(元数据门 / Studio 保存的,环境级或 authored
包内)若配置后来失效,平台启动时只记录并跳过它,与运行中遇到同样问题时的处理完全一致;宿主自己声明的连接器和已安装包的连接器出错仍然阻止启动。
- 为什么改:一条存储的连接器定义失效(例如提供它 provider
的插件被移除)会让整个环境无法再启动,而运行时同样的问题只跳过该连接器;这是可用性问题,不是数据问题。
- 风险与回滚:只改 `plugin.ts`
启动连接器协调中的一个判断:错误归属于存储条目时走已有的软路径(同一条日志记录,无新记录形状)。回滚即还原该提交;宿主条目的失败语义未变,有对照测试钉住。
- 先看:`packages/services/service-automation/src/plugin.ts`(`fail` 的
`stored` 参数及各调用点)、`src/connector-materialization.test.ts` 新的 #28698
一节、`packages/qa/dogfood/test/stored-connector-package-ref-restart.dogfood.test.ts`。
- 两分钟验证:`pnpm --filter @objectstack/service-automation exec vitest run
src/connector-materialization.test.ts`,预期 102/102 通过(含 5 类故障各一对「存储条目跳过 /
宿主条目失败」)。
- 需要你做的:无,席位落地。
## What changes
- **Stored connectors no longer stop a start.** A provider-bound
connector saved in the environment that later stops being valid is now
handled at start exactly as it is while the platform runs: the same log
record, that connector not served, the host's own connectors beside it
serving. This covers every configuration fault the start meets on a
stored connector: a provider no installed plugin offers, a host
credential resolver that throws, a retry policy its schema refuses, a
name a plugin connector already holds, a configuration its provider
refuses, and a duplicate of a name the host declares. PR #28671 made one
of these (a refused package-relative ref) behave this way; this PR
widens that same path to the rest. There is no second skip path and no
new record.
- **Host-declared and installed entries keep failing loudly.** A
connector the host's stack declares, and an installed package's
(#28534's `installed` / `unrecorded` readings), still stop the start on
a configuration fault. Which entries count as stored is the classifier
PR #28671 introduced, unchanged.
- **Code.** In `reconcileDeclaredConnectors`, the reconcile's `fail`
reporter takes a third argument, `stored`; at start it throws only when
that is false. Each fault site passes the entry's reading. The per-entry
flag PR #28671 used for the ref refusal is removed, because the ref
refusal is now one stored fault among the others and reaches the same
`fail` call. The package readers are read once at the top of the run
(they were read a few lines later before), so the duplicate check can
use them.
- **Out of scope.** A stored row that takes a name a plugin connector
registers later in the start is a separate card.
- Changeset: `patch` for `@objectstack/service-automation`.
## Tests
- **Restart (dogfood).**
`stored-connector-package-ref-restart.dogfood.test.ts` now also carries
a stored connector whose provider no installed plugin offers, beside the
existing refused-ref rows and the inline control. After a restart the
platform starts, the row is not listed and the start's record names it,
and the inline control and the showcase's own connectors list `ready`.
Red on base `0be4c8a5` (6 failed, 1 passed), green at head (7/7).
- **Unit (`connector-materialization.test.ts`, new `#28698` section).**
For each of five faults (unknown provider, invalid `retryConfig`,
throwing credential resolver, plugin-held name, provider-refused
config): a stored entry lets the start finish, is skipped with its
record, and the host's entry beside it serves; and a control where the
host's own entry with the same fault still fails the start. Plus a
stored duplicate of the host's name (skipped, host serves), two host
entries of one name (fails), and an installed package's entry with an
unknown provider (fails, #28534 unchanged). The #28594 control "an
unknown provider still fails the boot" now uses a host entry filed as
declared, since a stored one with that fault is exactly what this PR
makes soft.
<details><summary>Ablations (each restored, blob equals HEAD, marker
absent from dist after restore)</summary>
- One fault site reverted to fatal (the unknown-provider report): unit
`1 failed | 101 passed` (the stored unknown-provider case); restart
dogfood `6 failed | 1 passed`.
- The whole widening reverted (`fail` throws at start for every entry):
unit `12 failed | 90 passed` (the five stored faults, the stored
duplicate, and the six #28594 stored-ref cases); restart dogfood `6
failed | 1 passed`. Every host control stays green under both.
</details>
## Acceptance notes
- Which of these faults a stored row can actually carry was measured on
the showcase before the change; the readings are with the seat. A retry
policy the schema refuses is refused at save (`422 INVALID_METADATA`),
so it is covered by the unit test only. A name saved twice
(environment-wide and in an authored package) lists once and does not
reach the duplicate check from stored rows; the duplicate case is
unit-covered. The showcase has no credential resolver that throws; that
case is unit-covered.
- `check:dual-build-cjs-loads` answered exit 3 (prerequisite: a full
build) and is NOT MEASURED locally; CI is the record.
- Overlap: open PR #28693 touches `plugin.ts` with a comment around the
flow contenders, far from this hunk.
## Verification
At head `f76068ce`:
<details><summary>Package and file runs</summary>
- `@objectstack/service-automation`: `typecheck` exit 0; `test`: Test
Files 251 passed (251), Tests 3210 passed (3210).
- `connector-materialization.test.ts`: Tests 102 passed (102).
- dogfood `stored-connector-package-ref-restart` +
`stored-connector-package-ref`: Test Files 2 passed (2), Tests 14 passed
(14), after rebuilding `@objectstack/service-automation`.
</details>
<details><summary>Derived gates</summary>
`dispatch-gates --ran`: 65 derived, 64 run, 1 NOT-MEASURED
(`check:dual-build-cjs-loads`, exit 3), 0 unrun. Every other family exit
0.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5oQNecNsthbZA1bZTp)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 256c86b commit 1c5b177
4 files changed
Lines changed: 220 additions & 56 deletions
File tree
- .changeset
- packages
- qa/dogfood/test
- services/service-automation/src
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | | - | |
27 | | - | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| 54 | + | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| |||
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
| |||
175 | 185 | | |
176 | 186 | | |
177 | 187 | | |
| 188 | + | |
178 | 189 | | |
179 | 190 | | |
180 | 191 | | |
| |||
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
195 | 213 | | |
196 | 214 | | |
197 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1043 | 1043 | | |
| 1044 | + | |
1044 | 1045 | | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
| 1046 | + | |
1048 | 1047 | | |
1049 | | - | |
| 1048 | + | |
1050 | 1049 | | |
1051 | 1050 | | |
1052 | 1051 | | |
| |||
1085 | 1084 | | |
1086 | 1085 | | |
1087 | 1086 | | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
1088 | 1220 | | |
1089 | 1221 | | |
1090 | 1222 | | |
| |||
0 commit comments