Repository navigation
Conversation
Add unit tests for normalizeLegacyDotBetaVersion, parseComparableSemver, comparePrereleaseIdentifiers, and compareComparableSemver functions in src/infra/semver-compare.ts to verify version comparison behavior. Tests cover: - normalizeLegacyDotBetaVersion converts legacy dot-beta format - parseComparableSemver parses standard semver with/without prerelease - comparePrereleaseIdentifiers handles null, empty, numeric, and string identifiers - compareComparableSemver compares major, minor, patch, and prerelease versions
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. This PR is technically coherent, but it repeats an earlier same-scope semver-helper test-only PR that was closed with explicit reviewer guidance to resubmit only with a concrete semver bug or maintainer request. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Keep the prior reviewer decision as the current repository stance: direct semver-helper coverage should come with a concrete regression, linked maintainer request, or maintainer-sponsored follow-up. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Keep the prior reviewer decision as the current repository stance: direct semver-helper coverage should come with a concrete regression, linked maintainer request, or maintainer-sponsored follow-up. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a test coverage PR, not a bug report. The PR body includes a direct helper probe and targeted test output, but no linked semver regression to reproduce. Is this the best way to solve the issue? No for the current repository state. Direct colocated tests are a plausible implementation, but the same test-only proposal was already closed without a concrete regression or maintainer request. Security review: Security review cleared: The diff adds only a colocated Vitest test file and does not change dependencies, scripts, workflows, secrets handling, or runtime code. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 4ecb45bf7729. |
|
closing this test-only PR as a duplicate/low-signal addition. closed PR #58313 already covered this semver helper family more comprehensively and explicitly asked for a concrete regression, linked bug, or maintainer request before resubmitting. this PR has none, and existing update-check/update-channel/ClawHub caller tests already exercise the meaningful behavior. the 25 added tests pass, but they are weaker than #58313 and do not justify another standalone test-only PR. |
What Problem This Solves
The
semver-compare.tsmodule provides semantic version comparison helpers for package and runtime compatibility checks. However, this module lacked unit tests to verify the version comparison logic, which could lead to regressions when the function is modified.Why This Change Was Made
Add unit tests for
normalizeLegacyDotBetaVersion,parseComparableSemver,comparePrereleaseIdentifiers, andcompareComparableSemverfunctions to verify version comparison behavior. This improves test coverage and prevents regressions.Focused tests cover legacy dot-beta normalization, semver parsing, prerelease identifier comparison, and full semver comparison.
User Impact
Semantic version comparison now has comprehensive test coverage, reducing the risk of regressions when the function is modified.
Evidence
Reproducibility: not applicable. This PR adds direct coverage for existing helper behavior rather than reporting a user-visible runtime bug. Source inspection confirms the helper behavior the tests target.
Direct behavior probe:
Targeted test:
Formatting:
Whitespace:
AI-assisted
Prepared with Codex. I reviewed the change, understand the touched code path, and kept the PR focused on the bug described above.