Skip to content

Commit 2a30085

Browse files
authored
fix(scripts): sla update date (#3492)
1 parent 0f68a41 commit 2a30085

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

scripts/release/__tests__/sla.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@ describe('generateLanguageSLA', () => {
119119
const end = new Date(start);
120120
end.setFullYear(start.getFullYear() + 2);
121121

122+
it('same version as active version', () => {
123+
generateLanguageSLA([
124+
"1.2.4 Thu Dec 28 15:48:25 2023 +0000",
125+
], 'dart', {next: "1.2.4", current: "1.2.4", releaseType: "minor"})
126+
127+
expect(fullReleaseConfig.sla.dart).toEqual({
128+
"1.2.4": {
129+
"releaseDate": "2023-12-28",
130+
"supportStatus":"active",
131+
}
132+
})
133+
});
134+
122135
it('new major: sets the new release as active, sets the last tag as maintenance', () => {
123136
generateLanguageSLA([
124137
"1.2.4 Thu Dec 28 15:48:25 2023 +0000",

scripts/release/sla.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export function generateLanguageSLA(tags: string[], lang: Language, version: Ver
151151
}
152152

153153
// if there's no release planned, or if the release is a pre-release, then the latest tagged version is the active one
154-
if (!version?.next || isPreRelease(version?.next)) {
154+
if (!version?.next || isPreRelease(version?.next) || version?.next === prevTagVersion) {
155155
fullReleaseConfig.sla[lang][prevTagVersion].supportStatus = 'active';
156156

157157
return;

0 commit comments

Comments
 (0)