fix(policy): constrain schema version digits - #108
Closed
Benoît Cortier (CBenoit) wants to merge 1 commit into
Closed
Benoît Cortier (CBenoit) wants to merge 1 commit into
Benoît Cortier (CBenoit) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Benoît Cortier (CBenoit)
September 15, 2026 12:50
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The 19-digit limit rejects runtime-supported 20-digit u64 values and contradicts the documented schema relationship.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Constrains PolicyFormatVersion numeric components across policy schemas and OpenAPI.
Changes:
- Adds digit limits to Rust-generated schema patterns.
- Updates generated JSON/OpenAPI contracts.
- Adds a .NET schema boundary test.
File summaries
| File | Description |
|---|---|
policies/rust/now-policy/src/newtypes.rs |
Defines the constrained schema regex. |
policies/rust/now-policy/schema/devolutions.now-policy.schema.json |
Updates the committed-policy schema. |
policies/rust/now-policy/schema/devolutions.now-policy-draft.schema.json |
Updates the draft-policy schema. |
policies/rust/now-policy-api/openapi/now-policy-api.yaml |
Synchronizes OpenAPI patterns. |
policies/dotnet/Devolutions.Now.Policy.Model.Tests/PolicyTests.cs |
Tests schema rejection at the numeric boundary. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Member
Author
|
Closing as superseded by the clarified contract: runtime readers use u64 components, while the intentionally simple schema may accept larger numeric strings. The merged implementation already has that behavior. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Keeps
PolicyFormatVersionschemas readable while conservatively rejecting impractically large numeric components. Runtime parsing continues to useu64bounds and may therefore be stricter than the schema.