525 warn on mismatch between app and schema versions#1196
Conversation
|
Thank you for the submission! We'll review it asap |
@waldekmastykarz , fixed. So schema version format is never a pre-release version. |
|
Cool! Thank you for such a quick turnaround. Will check asap. Preparing for a conference next week so might not be immediate. |
|
@dotnet-policy-service agree |
There was a problem hiding this comment.
Pull Request Overview
This PR centralizes semantic version comparison and adds schema version validation across proxy components to warn on mismatches between the application and JSON schema versions.
- Moved and unified
CompareSemVerand introducedNormalizeVersioninProxyUtils. - Added
ValidateSchemaVersioncalls in loaders, plugin handlers, and notification logic. - Updated snippet and release version handling to use normalized versions.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| dev-proxy/UpdateNotification.cs | Normalize product version and use centralized CompareSemVer |
| dev-proxy/PluginLoader.cs | Extract $schema URL and validate its version |
| dev-proxy/CommandHandlers/ConfigNewCommandHandler.cs | Use NormalizeVersion for snippet URL |
| dev-proxy-abstractions/ProxyUtils.cs | Added ValidateSchemaVersion, relocated CompareSemVer, implemented NormalizeVersion |
| dev-proxy-abstractions/BaseProxyPlugin.cs | Invoke ValidateSchemaVersion before JSON schema validation |
| dev-proxy-abstractions/BaseLoader.cs | Extract schema element, call ValidateSchemaVersion, then validate JSON |
Comments suppressed due to low confidence (1)
dev-proxy-abstractions/ProxyUtils.cs:522
- There are no existing unit tests for the new
ValidateSchemaVersionlogic; consider adding tests for valid URLs, mismatched versions, invalid URLs, and empty inputs.
public static void ValidateSchemaVersion(string schemaUrl, ILogger logger)
waldekmastykarz
left a comment
There was a problem hiding this comment.
Nice job, and keen eye on the extra fixes. Let's update a few things and we'll get it in.
|
Marked the PR as draft so that we don't merge it accidentally |
…heme warning if current is beta version
waldekmastykarz
left a comment
There was a problem hiding this comment.
Awesome! No further comments
#525