Validate format of event stream version CLI argument when passed #1231
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.
This adds validation of the user-specified
--event-stream-version
(or--experimental-event-stream-version
) command-line arguments when they are passed, to ensure they have a valid format.Motivation:
Currently, these flags only accept integers like
0
,1
, etc. But I am moving towards making the entry point and event stream versions align with the Swift version, rather than having an independent versioning scheme which users must look up or keep track of. Once this effort is finished, in order to use the event stream format included in (for example) Swift 6.3, a user would pass--event-stream-version 6.3
.In swiftlang/swift-package-manager#8944, I recently landed a SwiftPM change which will permit any arbitrary string for these arguments, and this means we need to begin validating the format of supported versions within the testing library. In a subsequent PR, I plan to introduce support for non-integer versions, at which point having some existing validation logic will be even more valuable.
Checklist: