Commit 71a2a3e
committed
review(#1318): address PR feedback (findings 1, 2, 3, 4, 6, 8)
Finding 1 — Kotlin Multiplatform fixture: bump
`org.jetbrains.kotlin.multiplatform` from 1.9.25 (officially supports
Gradle 6.8.3-8.6) to 2.1.0 (supports Gradle 9.x). CI installs Gradle
9.2.1 so the old plugin version would fail. Smoke-tested locally.
Finding 2 — `handle-create-new-scan.mts`: rename
`filterToCdxSpdxAndFactsFiles` → `filterToCdxSpdxOnly`. The
"AndFactsFiles" branch in the function was dead at the only call site
because the caller had already stripped `.socket.facts.json` from the
input. Dropped the basename check from the function body; semantics
unchanged.
Finding 3 — Aggregator's `node.children` read now happens under
`synchronized(nodes)` to mirror the writers in each
`socketFactsCollect` doLast. Task dependencies via
`aggregator.dependsOn(collector)` already establish a happens-before
edge, but explicit synchronization makes the contract local and
removes any implicit reliance on Gradle's task-graph memory
visibility semantics. The aggregator snapshots into plain List/Map
values first, then builds the JSON outside the critical section.
Finding 4 — `convert-gradle-to-facts.mts`: replace
`output.stdout.replace(regex, callback)`-for-side-effects pattern
with `Array.from(stdout.matchAll(regex), m => m[1])`. Reads more
directly.
Finding 6 — Cross-reference comments at both
`ext.SOCKET_FACTS_FILENAME` (Groovy) and `DOT_SOCKET_DOT_FACTS_JSON`
(TS) noting that the two values are intentionally duplicated (Groovy
can't import a TS constant) and must be kept in sync.
Finding 8 — When the Gradle script's `components.isEmpty()` branch
fires (no resolvable dependencies in the build), the TS wrapper no
longer prints a bare "Reported exports:" header followed by nothing.
It now suppresses the header when `matchAll` returns zero exports,
and surfaces the `[socket-facts] no resolvable dependencies` skip
message from Gradle stdout if present so the user understands why
the file wasn't written.
Not changed (replies posted separately):
- Finding 5: `.toLowerCase()` IS load-bearing on case-insensitive
filesystems (macOS HFS+, Windows). The constant is lowercase; the
input might not be. Keeping the normalization.
- Finding 7: function ordering left to match the existing
`convert_gradle_to_maven.mts` pattern — consistency with precedent
wins over the literal CLAUDE.md rule here.1 parent d6a49f7 commit 71a2a3e
5 files changed
Lines changed: 57 additions & 25 deletions
File tree
- src
- commands
- manifest
- scan
- test/fixtures/commands/manifest/gradle-facts/kotlin-multiplatform
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
84 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
85 | 98 | | |
86 | 99 | | |
87 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| |||
266 | 270 | | |
267 | 271 | | |
268 | 272 | | |
269 | | - | |
270 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
271 | 290 | | |
272 | 291 | | |
273 | 292 | | |
| |||
290 | 309 | | |
291 | 310 | | |
292 | 311 | | |
293 | | - | |
| 312 | + | |
294 | 313 | | |
295 | 314 | | |
296 | | - | |
| 315 | + | |
297 | 316 | | |
298 | 317 | | |
299 | | - | |
300 | | - | |
| 318 | + | |
| 319 | + | |
301 | 320 | | |
302 | 321 | | |
303 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
64 | 58 | | |
65 | 59 | | |
66 | 60 | | |
| |||
270 | 264 | | |
271 | 265 | | |
272 | 266 | | |
273 | | - | |
| 267 | + | |
274 | 268 | | |
275 | 269 | | |
276 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
202 | 206 | | |
203 | 207 | | |
204 | 208 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
0 commit comments