You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhance address space handling to accept numeric CIDR masks - #4734
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds support in the API for requesting auto-assigned address spaces using numeric CIDR prefix lengths (as strings), extending beyond the existing small/medium/large presets while keeping backwards compatibility.
Changes:
Extend address space allocation logic to accept numeric CIDR masks (string values) and validate allowed ranges.
Add repository tests for numeric CIDR prefix requests.
Update workspace authoring documentation and the project changelog to describe the new behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
Bundled address-space-consuming workspace services still do not expose address_space_size, preventing validated requests from selecting smaller service subnets.
This PR adds numeric CIDR allocation, but it does not fully implement #3431.
Verified against commit 0908820e4ac405d2829e8963cd3b92ecae15e109:
The base, unrestricted and airlock-import-review workspace schemas offer numeric selections from /16 to /24. They do not expose the smaller workspace size requested in Smallest workspace address space #3431.
The bundled Azure ML, Databricks and OHDSI service schemas do not define address_space_size. Passing "27" to their production schema validation is rejected with Unevaluated properties are not allowed ('address_space_size' was unexpected), before the allocator runs.
The allocator supports /16 to /29 for service templates that explicitly expose the property, as described in the template-author documentation.
The smaller workspace and bundled service support should remain follow-up work under #3431. I am removing its closing reference from this PR description, while retaining the reference to #4733 for numeric CIDR allocation.
Local validation passed: 892 API tests, changed-file Python lint, the three workspace schemas, and allocation checks for all masks from /16 to /29. Extended validation has been requested for this commit. The existing extended tests use small, so they provide provisioning regression coverage but do not establish live numeric-CIDR behaviour.
The changelog-only update in 2d9319a7 created a new PR head that needs the required smoke-check status. It only adds the component versions to the changelog; the implementation is unchanged from 0908820e.
I will merge this PR into main only after the extended tests pass. This command waives the required check on the changelog commit; it does not mean that the extended tests have passed.
Reject overlong decimal input before integer conversion
api_app/db/repositories/workspaces.py:233
isdecimal() does not bound the input length. In the Python 3.12 API runtime, a string containing more than 4,300 decimal digits passes this check but int(address_space_size) raises ValueError; for workspace-service allocation this occurs outside the route's ValueError handler, so malformed input returns a 500 instead of the intended 422. Reject overlong numeric strings before conversion (or match the explicit allowed strings).
The changes since that tested commit are the changelog version details and the latest merge from main. This command waives the required check on the new merge commit; the passing test results above apply to 0908820e.
We also removed Resolves #3431 from the PR description because smaller workspace sizing and CIDR selectors in the bundled workspace services remain follow-up work. Resolves #4733 is retained for the numeric CIDR allocation capability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #4733
What is being addressed
Currently IP ranges are allocated based on t-shirt sizing s/m/l this introduces CIDR ranges to allow more granular subnet allocation
How is this addressed