Skip to content

Validate format of event stream version CLI argument when passed #1231

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

Conversation

stmontgomery
Copy link
Contributor

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:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

@stmontgomery stmontgomery added this to the Swift 6.x (main) milestone Jul 17, 2025
@stmontgomery stmontgomery self-assigned this Jul 17, 2025
@stmontgomery stmontgomery added the documentation 📚 Improvements or additions to documentation label Jul 17, 2025
@stmontgomery stmontgomery added enhancement New feature or request swiftpm-integration 📦 Swift Package Manager integration command-line experience ⌨️ enhancements to the command line interface labels Jul 17, 2025
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@suzannaratcliff suzannaratcliff self-requested a review July 17, 2025 16:40
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery merged commit ac4f8da into swiftlang:main Jul 17, 2025
3 checks passed
@stmontgomery stmontgomery deleted the invalid-event-stream-version branch July 17, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-line experience ⌨️ enhancements to the command line interface documentation 📚 Improvements or additions to documentation enhancement New feature or request swiftpm-integration 📦 Swift Package Manager integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants