Skip to content
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

Support "swift-" prefix when parsing release snapshot selectors #77

Merged
merged 1 commit into from Oct 14, 2023

Conversation

patrickfreed
Copy link
Collaborator

Closes #69

@@ -334,7 +334,7 @@ struct StableReleaseParser: ToolchainSelectorParser {
/// - a.b-SNAPSHOT
struct ReleaseSnapshotParser: ToolchainSelectorParser {
static let regex: Regex<(Substring, Substring, Substring, Substring?)> =
try! Regex("^([0-9]+)\\.([0-9]+)-(?:snapshot|DEVELOPMENT-SNAPSHOT|SNAPSHOT)(?:-([0-9]{4}-[0-9]{2}-[0-9]{2}))?(?:-a)?$")
try! Regex("^(?:swift-)?([0-9]+)\\.([0-9]+)-(?:snapshot|DEVELOPMENT-SNAPSHOT|SNAPSHOT)(?:-([0-9]{4}-[0-9]{2}-[0-9]{2}))?(?:-a)?$")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ease of implementation and maximum flexibility, I didn't bother creating separate regexes to only allow the prefix when using DEVELOPMENT-SNAPSHOT rather than the swiftly canonical name, so selectors like "swift-5.7-snapshot" are allowed.

@patrickfreed patrickfreed linked an issue Oct 14, 2023 that may be closed by this pull request
@patrickfreed patrickfreed merged commit 86dff27 into swift-server:main Oct 14, 2023
5 of 6 checks passed
patrickfreed added a commit to patrickfreed/swiftly that referenced this pull request Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure swiftly can parse tags from apple/swift repository
2 participants