Commit ef3ded9
authored
fix(gateway-contracts): improve forge version checking with range support (#1748)
* fix(gateway-contracts): improve forge version checking with range support
Replace hardcoded list of allowed forge versions with flexible min/max
range check. This makes the script more maintainable and allows any
forge version between 1.3.1 and 1.5.1.
Changes:
- Add 'packaging' library import for version comparison
- Replace ALLOWED_FORGE_VERSIONS list with MIN_FORGE_VERSION and MAX_FORGE_VERSION
- Extract numeric version from forge version string using regex
- Use semantic version comparison instead of string matching
This allows the script to accept any forge version within the specified
range without requiring hardcoded version strings for each patch release.
* refactor(gateway-contracts): use tuple comparison for version checking
Remove external `packaging` dependency in favor of simple tuple
comparison for semver validation. This is cleaner and has zero
external dependencies while correctly handling version comparisons
like 1.10.0 > 1.9.0.
Changes:
- Remove `packaging` library import
- Define MIN/MAX_FORGE_VERSION as tuples instead of strings
- Add simple parse_semver() helper function
- Use direct tuple comparison for version range check
* refactor(gateway-contracts): accept all forge 1.x versions >= 1.3.1
Change version check to accept any forge version >= 1.3.1 and < 2.0.0.
This reduces maintenance burden as new forge releases won't require
updating the script, while still protecting against major version
breaking changes.1 parent b3352e3 commit ef3ded9
1 file changed
+24
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| |||
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
98 | | - | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
| |||
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
107 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
108 | 127 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 128 | + | |
| 129 | + | |
112 | 130 | | |
113 | 131 | | |
114 | 132 | | |
| |||
0 commit comments