Repository navigation
Commit 009dca3
* Scope hosted Maven pom edits to live markup
WIP: draft PR placeholder.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Scope hosted Maven pom edits to live markup
Hosted Maven rewrites found their edit points with raw text anchors,
so a scan could rewrite a commented-out or plugin <dependency>, put
the Socket repository or pin inside an inactive profile or a
comment, suffix sources/tests/native classifier jars that the patch
server does not serve, and add a second <repositories> or
<dependencyManagement> next to a self-closed or commented one. Each
case exited 0 with redirected=1 while the build stayed unpatched or
broke.
The rewriter now reads the pom through formats::maven::PomScope, the
same scope VEX attests from: comments, CDATA, <build>, <reporting>,
<pluginRepositories>, <distributionManagement> and <profiles> are
never matched or edited, self-closed sections are expanded in place,
and only classifier-less declarations decide literal-vs-pin.
Classifier variants and profile base literals are left alone with
new warnings (redirect_maven_classifier_unsupported,
redirect_maven_profile_dependency_unpatched); an unreadable pom is
skipped with redirect_maven_pom_unreadable. Upstream restore and VEX
discovery follow the same scope so these rewrites round-trip and
attest.
Fixes #259, #262, #342.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Skip GAs declared only in a Maven profile
A GA whose only declaration sits in an inactive profile got a
top-level dependencyManagement pin that is inert exactly when the
profile pulls it in. Skip such a dep with
redirect_maven_profile_dependency_unpatched instead of reporting it
redirected, keeping the existing in-process contract. Self-closed
sections restore to an equivalent empty element, so those goldens
are excluded from the byte-exact restore round trip and covered by
a unit test instead.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Index the pom once for hosted Maven rewrites
Re-reading the pom through PomScope for every patched dependency made
hosted Maven scans slower (scan-performance flagged maven/hosted
+35%, maven/rescan +25%). The rewriter now reads the pom once into a
PomIndex and keeps its offsets in step with its own edits (version
rewrites, repository and dependencyManagement insertions, superseded
repository removal, URL refresh), so a pom with many patched
dependencies is scanned once instead of once per dependency. A
1000-dependency pom rewrites in ~25 ms, down from ~1.7 s before this
PR series. A unit test checks the kept index against a fresh build
after every kind of edit.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Address hosted Maven pom-scope review threads
- maven_index: on a pure insertion, an element end (and a self-closed
element's inner offsets) exactly at the insertion point no longer
shifts, so a <dependencyManagement> inserted before </project> is not
overwritten when a self-closed <repositories/> ending there is expanded.
- Profiles: any versioned declaration inside <profiles> (a ${property}
or another literal, not just the base literal) is reported unpatched,
and the dep is skipped when profiles hold its only versioned
declarations.
- Classifiers: a variant other than sources/javadoc at the patched
release skips the dep instead of pinning the main jar beside it.
- Restore: entry_is_users reads the same live scope as the versioned
count, so a commented, plugin, profile or classifier versionless
sibling no longer makes the authored pin look user-written.
- Rollback: a commented-out socket-patch repository twin no longer
counts as a second repository, nor as a leftover name.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* Withhold Maven VEX when an executable classifier copy is unpatched
A hosted Maven pin is a classifier-less coordinate: it does not retarget a
<classifier> dependency of the same GA, and the grant serves only the main
jar, so a tests or native classifier copy resolves from the next repository
(the public release). VEX discovery grouped deps with classifiers dropped, so
such a pom was still attested as patched.
The pin now stays a ref (list/rollback/remove find it) but is marked
unattested (vex_maven_classifier_unpatched) when a live, non-profile
classifier copy other than sources/javadoc resolves any version but the pin:
its own literal, a classifier-keyed dependencyManagement entry, or none in
the root pom. sources/javadoc copies keep attesting; they never execute.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent ee14e7d commit 009dca3
85 files changed
Lines changed: 3214 additions & 210 deletions
File tree
- crates
- socket-patch-cli
- src/commands
- socket-patch-core
- src
- formats/maven
- patch/redirect
- upstream
- vex/discover
- tests
- fixtures
- redirect/maven/pom
- classifier-only-transitive-main
- expected
- .mvn
- checksums
- input
- classifier-sources-sibling
- expected
- .mvn
- checksums
- input
- comment-dependency
- expected
- .mvn
- checksums
- input
- commented-repositories
- expected
- .mvn
- checksums
- input
- depmgmt-comment
- expected
- .mvn
- checksums
- input
- plugin-dependency
- expected
- .mvn
- checksums
- input
- profile-depmgmt
- expected
- .mvn
- checksums
- input
- profile-literal
- input
- profile-repositories
- expected
- .mvn
- checksums
- input
- self-closed-depmgmt
- expected
- .mvn
- checksums
- input
- self-closed-repositories
- expected
- .mvn
- checksums
- input
- vex-discover-golden
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
254 | 259 | | |
255 | 260 | | |
256 | 261 | | |
| |||
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
264 | 273 | | |
265 | 274 | | |
266 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | 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 | + | |
52 | 176 | | |
53 | 177 | | |
54 | 178 | | |
55 | 179 | | |
56 | 180 | | |
57 | 181 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
74 | 187 | | |
75 | 188 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 189 | + | |
| 190 | + | |
81 | 191 | | |
82 | 192 | | |
83 | 193 | | |
84 | | - | |
| 194 | + | |
85 | 195 | | |
86 | 196 | | |
87 | 197 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 198 | + | |
| 199 | + | |
98 | 200 | | |
99 | 201 | | |
100 | | - | |
101 | 202 | | |
102 | 203 | | |
103 | 204 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
107 | 209 | | |
108 | 210 | | |
109 | 211 | | |
| |||
195 | 297 | | |
196 | 298 | | |
197 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
198 | 344 | | |
199 | 345 | | |
200 | 346 | | |
| |||
0 commit comments