Skip to content

Commit 1e7eb3e

Browse files
committed
[swift-snapshot-tool] Fix snapshot filtering for release branches so that we do not include the release tags.
We only bisect on DEVELOPMENT snapshots.
1 parent c87b3c7 commit 1e7eb3e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

utils/swift_snapshot_tool/Sources/swift_snapshot_tool/get_tags.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,10 @@ func getTagsFromSwiftRepo(branch: Branch, dryRun: Bool = false) async throws ->
7777
let allTags = try! decoder.decode([Tag].self, from: await data)
7878
log("[INFO] Finished downloading snapshot information from github.")
7979

80-
let snapshotTagPrefix = "swift-\(branch.rawValue.uppercased())"
81-
8280
// Then filter the tags to just include the specific snapshot branch
8381
// prefix. Add the branch to an aggregate BranchTag.
8482
var filteredTags: [BranchTag] = allTags.filter {
85-
$0.name.starts(with: snapshotTagPrefix)
83+
$0.name.starts(with: branch.tagPrefix)
8684
}.map {
8785
BranchTag(tag: $0, branch: branch)
8886
}

utils/swift_snapshot_tool/Sources/swift_snapshot_tool/github_repository.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,13 @@ enum Branch: String, EnumerableFlag {
4646
case release_5_0 = "5.0"
4747
case release_6_0 = "6.0"
4848
case release_6_2 = "6.2"
49+
50+
var tagPrefix: String {
51+
switch self {
52+
case .development:
53+
"swift-\(rawValue.uppercased())"
54+
default:
55+
"swift-\(rawValue.uppercased())-DEVELOPMENT"
56+
}
57+
}
4958
}

0 commit comments

Comments
 (0)