Skip to content

Conversation

pheus
Copy link
Contributor

@pheus pheus commented Oct 2, 2025

Fixes: #20471

Summary

Normalize integer range handling to use half‑open intervals [lower, upper) across the app. Inclusive inputs are still accepted (forms/CSV/API) but are converted to a canonical half‑open form on save and serialization. This yields stable pre/post snapshots and prevents spurious change log entries when saving an unchanged VLANGroup.

Changes

  • Canonicalize all NumericRange values for VLANGroup.vid_ranges to [lo, hi) in forms, serializers, and utilities.
  • Ensure change‑logging compares normalized values to avoid no‑op diffs.
  • Update tests for round‑trip stability and “no new changelog on no‑op save.”

Notes

  • No database schema changes.
  • Backward‑compatible: existing data remains valid; user‑facing behavior is unchanged.

Changes NumericRange boundaries to use half-open intervals
[lower, upper). Updates logic in data utilities, and corresponding tests
to reflect this standard. Ensures consistency across range handling and
validation outputs.

Fixes netbox-community#20471
@pheus pheus force-pushed the 20471-update-numericrange-handling-using-half-open-intervals branch from 33148f3 to 3a755ee Compare October 2, 2025 21:22
@pheus pheus marked this pull request as ready for review October 2, 2025 21:37
@jnovinger jnovinger requested review from a team and arthanson and removed request for a team October 4, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saving a VLANGroup without changes creates a new changelog entry
1 participant