Commit f1fb66d
authored
Collapse UpgradeDockerImageVersion cartesian via ChangeFrom capture (#1060)
`getRecipeList()` previously emitted one `ChangeFrom` per (image,
oldVersion, suffix) triple because `ChangeFrom.newTag` was a literal
string with no template support. ~35 hard-coded suffixes × 10 image
families × (version - 8) version steps produced 3,150 children per
invocation at version=17 and 5,950 at version=25.
`ChangeFrom` now supports glob `*` capture and `$N` backref substitution
in its new* fields. Replace the suffix enumeration with a single
`oldTag = "<oldVersion>*"` + `newTag = "<version>$1"` recipe per
(image, oldVersion) pair. `$1` carries whatever follows the old version
digits (may be empty, `-jdk-alpine`, `-jre-noble`, or any arbitrary
suffix), so the rewrite preserves the full OS/jdk/jre variant without
enumerating it in advance.
Per-invocation child count drops from ~3,150 -> ~90 at version=17
(35x), and from ~5,950 -> ~170 at version=25. Add two parameterized
test cases exercising an exotic suffix that previously only survived
the now-removed wildcard fallback (and lost its suffix).1 parent 38caf16 commit f1fb66d
2 files changed
Lines changed: 20 additions & 54 deletions
File tree
- src
- main/java/org/openrewrite/java/migrate
- test/java/org/openrewrite/java/migrate
Lines changed: 17 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
39 | | - | |
| 46 | + | |
| 47 | + | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
44 | | - | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
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 | | - | |
| 55 | + | |
81 | 56 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
97 | 61 | | |
98 | | - | |
99 | | - | |
100 | | - | |
| 62 | + | |
| 63 | + | |
101 | 64 | | |
102 | 65 | | |
103 | 66 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
0 commit comments