Skip to content

Conversation

@pheus
Copy link
Contributor

@pheus pheus commented Oct 17, 2025

Fixes: #20610

Correct an off‑by‑one in VLANGroup._total_vlan_ids by computing lengths with half‑open [lo, hi) semantics during save(). Removes the +1, adds a test and includes a data migration to backfill existing _total_vlan_ids.

No schema changes.

@jeremystretch jeremystretch marked this pull request as ready for review October 17, 2025 12:50
@jeremystretch jeremystretch requested review from a team and bctiemann and removed request for a team October 17, 2025 12:50
@pheus
Copy link
Contributor Author

pheus commented Oct 27, 2025

Thanks for all the release work!
If it’s still feasible, could this be included in v4.4.5? It fixes a regression I introduced in v4.4.3 (#20610) that miscounts _total_vlan_ids. I’m sorry for the slip.

No pressure if the window has closed. I completely understand. I can rebase or adjust anything right away if that helps.

Thanks again for your time and for everything you do.

@jeremystretch jeremystretch self-requested a review October 27, 2025 21:00
@jeremystretch
Copy link
Member

I'll try to review this tomorrow ahead of the v4.4.5 release if @bctiemann hasn't had a chance yet.

@jeremystretch jeremystretch removed the request for review from bctiemann October 28, 2025 12:38
Adjust VLAN ID range calculation to use half‑open intervals for
consistency. Add a test to validate `_total_vlan_ids`.

Fixes netbox-community#20610
@pheus pheus force-pushed the 20610-vlangroup-total-vlan-ids-off-by-one branch from 369cd6a to 05fd14a Compare October 28, 2025 13:12
@pheus pheus requested a review from jeremystretch October 28, 2025 13:18
@pheus
Copy link
Contributor Author

pheus commented Oct 28, 2025

Thanks for the thoughtful review!
I’ve rebased and switched the migration to use bulk_update() as suggested. Please take another look when you have a moment. Happy to adjust anything further.

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pheus!

@jeremystretch jeremystretch merged commit afc62b6 into netbox-community:main Oct 28, 2025
7 checks passed
@pheus pheus deleted the 20610-vlangroup-total-vlan-ids-off-by-one branch October 28, 2025 17:24
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.

VLAN Group utilization is not being calculated correctly

2 participants