Commit 5fee8d1
fix(quality): clear the dev SonarCloud reliability findings blocking the gate (#2604)
* fix(quality): clear the dev SonarCloud reliability findings blocking the gate
dev's SonarCloud quality gate has been failing on `new_reliability_rating = C`
(threshold A) across several runs, which fails the `Coverage and SonarCloud`
job and, through it, the fail-closed `ci` aggregate. Five findings drive it;
all five are analyzer artifacts against correct code, so each is resolved by
restating the same behavior in a shape the analyzer can follow rather than by
changing semantics.
typescript:S4822 (4x) — "promise inside a try". Four call sites share one
deliberate, commented pattern: a `try` containing only a promise-returning call
guards a SYNCHRONOUS throw from a non-conforming implementation, while the
rejection is handled just after the block. Sonar sees only the floating promise.
Each now builds the chain (including its `.catch`) inside the `try`:
- deps.ts `reconcileTaskWorkspacesAtStartup` and registerSw.ts
`cleanupDevServiceWorkers`/`registerSw` swallow both failure modes by design,
so attaching `.catch` at the call site is exactly equivalent — and drops a
now-redundant `pending` local plus its `ReturnType<...>` annotation.
- opencodeRuntimeComposition.ts `startFacadeExecution` must NOT swallow the
rejection: the awaiting request path maps it to 502/408 and settles the tool.
It gets a no-op `.catch` tap instead, which does not consume the rejection for
that path (it still observes it via `raceAbort`) and additionally suppresses an
unhandled-rejection warning on the abort path, where the caller can stop
awaiting before the facade settles.
javascript:S3403 (1x) — `options.policy === "production"` reported as always
false in verify-portable-runtime-signing.mjs. "production" is a real member of
PORTABLE_VERIFICATION_POLICIES; the comparison is reachable. The all-`undefined`
object literal in parseArgs pinned every property's inferred type to `undefined`,
so the analyzer read every later value comparison as impossible. parseArgs now
declares the three locals and assembles the object on return.
No behavior change intended. Verified locally: typecheck, lint, format:check,
keiko-ui install suite (59), scripts suite (1794) all green. The 6 failures in
codingAutonomyQaMatrix.test.ts under a path-filtered server run reproduce
identically with these changes stashed — pre-existing, filter-context only.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(quality): cover verify-portable-runtime-signing argument parsing
Restating `parseArgs` in the previous commit put its lines into SonarCloud's
new-code window, where they were measured and found entirely uncovered: this
script had no test file at all, which drove the PR's new-code coverage to 39.1%
against an 80% threshold.
Exports `parseArgs` behind the `@internal` marker the repo already uses for
test-only seams (see deps.ts) and adds eight direct unit tests. A direct import
rather than a spawned subprocess is deliberate: subprocess-driven script tests
report 0% v8 coverage against the vitest parent, so they would not have moved
the measurement.
Cases: every supported policy returned verbatim (a regression pin for the
javascript:S3403 fix — the previous all-`undefined` options literal made
`options.policy === "production"` read as statically impossible), the optional
verification input, order independence, and all six fail-closed paths (missing
manifest, missing policy, unsupported policy, unsupported argument, flag without
a value, empty flag value). `fail()` ends the process, so `process.exit` is
trapped through a throw, matching release-script-lcov-mapping.test.mjs.
The signing script's argument validation was untested until now, independent of
the gate.
Verified locally: lint, format:check, check:knip, and the full scripts suite
(95 files, 1802 tests) green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(quality): parameterize the parseArgs fail-closed cases (S5976)
SonarCloud flagged three of the six fail-closed cases as structurally identical
(javascript:S5976). They differ only in the argv they feed, so they collapse into
one it.each table without losing a case or its label.
Verified: 8 tests still pass, eslint and prettier clean on the file.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 2bbc8af commit 5fee8d1
5 files changed
Lines changed: 132 additions & 64 deletions
File tree
- packages
- keiko-server/src
- coding-runtime
- keiko-ui/src/app/components/desktop/install
- scripts
- __tests__
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
| |||
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1080 | 1083 | | |
1081 | 1084 | | |
1082 | 1085 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1688 | 1688 | | |
1689 | 1689 | | |
1690 | 1690 | | |
1691 | | - | |
1692 | | - | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
1696 | 1698 | | |
1697 | | - | |
| 1699 | + | |
1698 | 1700 | | |
1699 | | - | |
1700 | 1701 | | |
1701 | 1702 | | |
1702 | | - | |
1703 | 1703 | | |
1704 | 1704 | | |
1705 | 1705 | | |
| |||
Lines changed: 34 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
122 | 136 | | |
123 | | - | |
124 | 137 | | |
125 | 138 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
163 | 168 | | |
164 | | - | |
165 | 169 | | |
166 | 170 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | 171 | | |
Lines changed: 64 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
31 | | - | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | | - | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
41 | | - | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | | - | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
0 commit comments