Commit 2a82a3f
authored
Switch ran eco gotests version comparison to semver CNF-20904 (#1322)
* cnf/ran: implement SemVer for RAN version gate checks
Replace ad hoc major/minor version checks with github.com/Masterminds/semver/v3.
- Add semver_range.go with IsVersionStringInRange (minimum <= v < exclusive maximum),
including two-segment X.Y maximum as whole minor line; document 4.N.0-0 lower bounds.
- Add table-driven unit tests (document UNIT_TEST=true for local runs without kubeconfig).
- Declare github.com/Masterminds/semver/v3 in the primary go.mod require block.
- Update RAN call sites (GitOps/ZTP, TALM, PTP, power management) to use 4.N.0-0 minimums.
* cnf/ran: address PR 1322 review (semver gates)
- Reject two-segment maximum strings that include a prerelease or build suffix;
propagate NewVersion errors when constructing the implicit upper bound.
- Move IsVersionStringInRange helpers into version.go and remove semver_range.go.
- Treat explicit multi-segment maximum as the exclusive upper bound (half-open
interval); keep plain X.Y shorthand for the next-minor exclusive bound; update
tests plus TALM backup and PTP event-consumer call sites.
* unify semver maximum parsing with minimum
- Add parseSemverGateBound and route minimum/maximum through the same
trim + coerceSemverCore + NewVersion path; drop two-segment maximum shorthand.
- Document that non-empty maximum must be an explicit semver exclusive bound.
- Update version_test table maxima to explicit exclusives (e.g. 4.21.0-0 for the
old "4.20" shorthand); remove the redundant 4.15-rc.1 error case.
Made-with: Cursor
* cnf/ptp: fix ptp-interfaces per CodeRabbit review
- Restore AssertWithTimeout to 3m alongside the 30s stable window for
clock-state Prometheus assertions (45s was too tight for scrape + stabilize).
- Use GetProfileByDaemonName for HA profile lookups so daemon-qualified names
(ConfigName_ProfileName) resolve.
Made-with: Cursor
* chore: satisfy golangci-lint for cnf/ran version (scoped)
- Allow github.com/Masterminds/semver/v3 in .golangci.yml depguard main list.
- Fix lll (wrap version_test package comment), nilnil nolints for empty bounds,
varnamelen (parsedVersion, splitSemverCore param), and wsl spacing.
Made-with: Cursor
* cnf/talm: restore precache Eventually timeout to 30 minutes
Revert the precache status poll duration from 20m to 30m so this line is not altered by the RAN semver workstream. Matches maintainer feedback on #1322.
Made-with: Cursor
* cnf/ran: parse version gate bounds with semver only
Drop coerceSemverCore and related helpers; parse minimum and maximum the same way as the subject version (trimSemverVPrefix + semver.NewVersion). Call sites already pass full semver strings (e.g. X.Y.0-0). Addresses review feedback on #1322.
Made-with: Cursor
* cnf/ran: log unparsable version in IsVersionStringInRange legacy path
When maximum is empty and the subject version is not valid semver, preserve (true, nil) for legacy callers but emit klog.V(ranparam.LogLevel) diagnostics. Addresses CodeRabbit feedback on #1322.
Made-with: Cursor1 parent 4a7d570 commit 2a82a3f
27 files changed
Lines changed: 170 additions & 174 deletions
File tree
- tests/cnf/ran
- gitopsztp/tests
- internal/version
- powermanagement/tests
- ptp
- internal
- consumer
- mustgather
- tests
- talm/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
83 | | - | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
| 318 | + | |
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments