Skip to content

Commit a31d370

Browse files
committed
fix: reduce the number of returned historic minor versions from 5 to 4
1 parent 0863e61 commit a31d370

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/fetch_versions_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import '../tool/fetch_versions.dart';
33

44
void main() {
55
test(
6-
'parseVersions extracts last 6 minor versions, skips 1st, returns 5 + stable/beta',
6+
'parseVersions extracts last 5 minor versions, skips 1st, returns 4 + stable/beta',
77
() {
88
final json = {
99
"releases": [
@@ -71,10 +71,10 @@ void main() {
7171
"3.32.8",
7272
"3.29.3",
7373
"3.27.4",
74-
"3.24.2",
74+
// "3.24.2", // Removed
7575
"stable",
7676
"beta"
7777
]);
78-
expect(versions.length, 7);
78+
expect(versions.length, 6);
7979
});
8080
}

tool/fetch_versions.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ List<String> parseVersions(Map<String, dynamic> json) {
6666
return dateB.compareTo(dateA);
6767
});
6868

69-
// Take the last 6 minor versions
70-
final top6 = sortedByDate.take(6).map((r) => r['version'] as String).toList();
69+
// Take the last 5 minor versions
70+
final top5 = sortedByDate.take(5).map((r) => r['version'] as String).toList();
7171

7272
// Skip the first one (latest stable) to avoid duplication with 'stable' channel
73-
// Return the next 5
74-
final historicVersions = top6.skip(1).toList();
73+
// Return the next 4
74+
final historicVersions = top5.skip(1).toList();
7575

7676
return [...historicVersions, 'stable', 'beta'];
7777
}

0 commit comments

Comments
 (0)