Skip to content

Closed #9763: Treat IP ranges as fully populated #19064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 9, 2025

Conversation

jeremystretch
Copy link
Member

@jeremystretch jeremystretch commented Apr 2, 2025

Fixes: #9763

  • Add a mark_populated boolean field to the IPRange model
  • Replace the add_available_ipaddresses() utility function with annotate_ip_space()
  • Introduce the AvailableIPSpace data class to represent unallocated space between two real IP objects
  • Extend the get_child_ranges() method the Prefix model to allow passing filters

Note: Calling get_available_ips() on a prefix with mark_utilized=True no longer automatically returns an empty IPSet. This is a deviation from the current behavior that, while not explicitly addressed in the FR, is necessary to ensure the consistent treatment of both prefixes and IP ranges.

@jeremystretch jeremystretch marked this pull request as ready for review April 3, 2025 16:50
@jeremystretch jeremystretch requested review from a team and arthanson and removed request for a team April 3, 2025 16:50
Copy link
Collaborator

@arthanson arthanson left a comment

Choose a reason for hiding this comment

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

I think there should be a test_filteresets.IPRangeTestCase testing for mark_populated, there should be one for mark_utilized as well, not sure why the test verifier isn't picking up those filter test missing?

There is also the case where you can initially have mark_populated off, then add an IP Address to it, then edit it and make mark_populated True. In this case you can delete the IP Address but you can no longer edit it. Not sure if we want to dis-allow setting the flag if you already have IP addresses created under the range?

@jeremystretch
Copy link
Member Author

There is also the case where you can initially have mark_populated off, then add an IP Address to it, then edit it and make mark_populated True. In this case you can delete the IP Address but you can no longer edit it. Not sure if we want to dis-allow setting the flag if you already have IP addresses created under the range?

IMO it makes sense to disallow editing the IP address, but let's see what feedback we get during the beta.

@jeremystretch jeremystretch requested a review from arthanson April 8, 2025 15:20
@arthanson arthanson merged commit f8f2ad1 into feature Apr 9, 2025
6 checks passed
@jeremystretch jeremystretch deleted the 9763-reserved-ip-ranges branch April 9, 2025 14:34
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.

2 participants