Skip to content

Commit cefa667

Browse files
authored
docs: SLA page and unstable for prereleases (#3195)
1 parent d7e2075 commit cefa667

35 files changed

+769
-396
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ debug.log
1010
**/.yarn/*
1111
!**/.yarn/releases
1212
!**/.yarn/plugins
13+
!**/.yarn/patches
1314

1415
.vscode/
1516
.idea/
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/lib/index.js b/lib/index.js
2+
index 483d41fe6e4b52f4d2210452a2f2e528e324a6f3..c8852f31dd5b40b706ac91254ef38f9a4eb7f154 100644
3+
--- a/lib/index.js
4+
+++ b/lib/index.js
5+
@@ -45,10 +45,11 @@ function parseInput (data, queryStart, queryEnd, excludeMaster, projectName) {
6+
Object.keys(data).forEach((v) => {
7+
const version = data[v];
8+
const name = `${projectName} ${v.replace('v', '')}`;
9+
- const current = version.start ? new Date(version.start) : null;
10+
- const active = version.lts ? new Date(version.lts) : null;
11+
- const maint = version.maintenance ? new Date(version.maintenance) : null;
12+
- let end = version.end ? new Date(version.end) : null;
13+
+ const isPreRelease = version.prerelease === true;
14+
+ const current = isPreRelease ? queryStart : version.start ? new Date(version.start) : null;
15+
+ const active = isPreRelease ? queryStart : version.lts ? new Date(version.lts) : null;
16+
+ const maint = isPreRelease ? queryStart : version.maintenance ? new Date(version.maintenance) : null;
17+
+ let end = isPreRelease ? queryEnd : version.end ? new Date(version.end) : null;
18+
19+
if (current === null) {
20+
throw new Error(`missing start in ${version}`);
21+
@@ -60,7 +61,7 @@ function parseInput (data, queryStart, queryEnd, excludeMaster, projectName) {
22+
23+
if (maint !== null) {
24+
if (maint < queryEnd && end > queryStart) {
25+
- output.push({ name, type: 'maintenance', start: maint, end });
26+
+ output.push({ name, type: isPreRelease ? 'unstable' : 'maintenance', start: maint, end });
27+
}
28+
29+
end = maint;
30+
@@ -68,20 +69,20 @@ function parseInput (data, queryStart, queryEnd, excludeMaster, projectName) {
31+
32+
if (active !== null) {
33+
if (active < queryEnd && end > queryStart) {
34+
- output.push({ name, type: 'active', start: active, end });
35+
+ output.push({ name, type: isPreRelease ? 'unstable' : 'active', start: active, end });
36+
}
37+
38+
end = active;
39+
}
40+
41+
if (current < queryEnd && end > queryStart) {
42+
- output.push({ name, type: 'current', start: current, end });
43+
+ output.push({ name, type: isPreRelease ? 'unstable' : 'current', start: current, end });
44+
}
45+
});
46+
47+
if (!excludeMaster) {
48+
output.unshift({
49+
- name: 'Master',
50+
+ name: 'Main',
51+
type: 'unstable',
52+
start: queryStart,
53+
end: queryEnd

config/csharp-lts.png

-20.6 KB
Binary file not shown.

config/dart-lts.png

-18.5 KB
Binary file not shown.

config/go-lts.png

-21.2 KB
Binary file not shown.

config/java-lts.png

-21.7 KB
Binary file not shown.

config/javascript-lts.png

-21.4 KB
Binary file not shown.

config/kotlin-lts.png

-21.4 KB
Binary file not shown.

config/php-lts.png

-20.6 KB
Binary file not shown.

config/python-lts.png

-20.4 KB
Binary file not shown.

config/release.config.json

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,126 +22,132 @@
2222
"name": "algolia-bot",
2323
"email": "[email protected]"
2424
},
25-
"lts": {
25+
"sla": {
2626
"csharp": {
2727
"6.1.17": {
2828
"start": "2024-01-01",
29-
"end": "2024-08-01"
29+
"lts": "2024-01-01",
30+
"end": "2026-08-01"
3031
},
3132
"7.0.0-beta.4": {
3233
"start": "2024-06-13",
33-
"active": "2024-06-13",
34-
"end": "2025-06-13"
34+
"end": "2026-06-13",
35+
"prerelease": true
3536
}
3637
},
3738
"dart": {
38-
"1.11.1": {
39-
"start": "2024-06-12",
40-
"end": "2024-12-12"
41-
},
4239
"1.12.0": {
4340
"start": "2024-06-13",
44-
"active": "2024-06-13",
45-
"end": "2025-06-13"
41+
"lts": "2024-06-13",
42+
"end": "2026-06-13"
4643
}
4744
},
4845
"go": {
4946
"3.31.1": {
5047
"start": "2024-01-01",
51-
"end": "2024-08-01"
48+
"lts": "2024-01-01",
49+
"end": "2026-08-01"
5250
},
5351
"4.0.0-beta.16": {
5452
"start": "2024-06-13",
55-
"active": "2024-06-13",
56-
"end": "2025-06-13"
53+
"end": "2025-06-13",
54+
"prerelease": true
5755
}
5856
},
5957
"java": {
6058
"3.16.9": {
6159
"start": "2024-01-01",
62-
"end": "2024-08-01"
60+
"lts": "2024-01-01",
61+
"end": "2026-08-01"
6362
},
6463
"4.0.0-beta.34": {
6564
"start": "2024-06-13",
66-
"active": "2024-06-13",
67-
"end": "2025-06-13"
65+
"end": "2025-06-13",
66+
"prerelease": true
6867
}
6968
},
7069
"javascript": {
7170
"4.23.3": {
7271
"start": "2024-01-01",
73-
"end": "2024-08-01"
72+
"lts": "2024-01-01",
73+
"end": "2026-08-01"
7474
},
7575
"5.0.0-beta.4": {
7676
"start": "2024-06-13",
77-
"active": "2024-06-13",
78-
"end": "2025-06-13"
77+
"end": "2025-06-13",
78+
"prerelease": true
7979
}
8080
},
8181
"kotlin": {
8282
"2.1.12": {
8383
"start": "2024-01-01",
84-
"end": "2024-08-01"
84+
"lts": "2024-01-01",
85+
"end": "2026-08-01"
8586
},
8687
"3.0.0-beta.29": {
8788
"start": "2024-06-13",
88-
"active": "2024-06-13",
89-
"end": "2025-06-13"
89+
"end": "2025-06-13",
90+
"prerelease": true
9091
}
9192
},
9293
"php": {
9394
"3.4.1": {
9495
"start": "2024-01-01",
95-
"end": "2024-08-01"
96+
"lts": "2024-01-01",
97+
"end": "2026-08-01"
9698
},
9799
"4.0.0-beta.4": {
98100
"start": "2024-06-13",
99-
"active": "2024-06-13",
100-
"end": "2025-06-13"
101+
"end": "2025-06-13",
102+
"prerelease": true
101103
}
102104
},
103105
"python": {
104106
"3.0.0": {
105107
"start": "2024-01-01",
106-
"end": "2024-08-01"
108+
"lts": "2024-01-01",
109+
"end": "2026-08-01"
107110
},
108111
"4.0.0b19": {
109112
"start": "2024-06-13",
110-
"active": "2024-06-13",
111-
"end": "2025-06-13"
113+
"end": "2025-06-13",
114+
"prerelease": true
112115
}
113116
},
114117
"ruby": {
115118
"2.3.4": {
116119
"start": "2024-01-01",
117-
"end": "2024-08-01"
120+
"lts": "2024-01-01",
121+
"end": "2026-08-01"
118122
},
119123
"3.0.0.beta.4": {
120124
"start": "2024-06-13",
121-
"active": "2024-06-13",
122-
"end": "2025-06-13"
125+
"end": "2026-06-13",
126+
"prerelease": true
123127
}
124128
},
125129
"scala": {
126130
"1.45.2": {
127131
"start": "2024-01-01",
128-
"end": "2024-08-01"
132+
"lts": "2024-01-01",
133+
"end": "2026-08-01"
129134
},
130135
"2.0.0-beta.4": {
131136
"start": "2024-06-13",
132-
"active": "2024-06-13",
133-
"end": "2025-06-13"
137+
"end": "2026-06-13",
138+
"prerelease": true
134139
}
135140
},
136141
"swift": {
137142
"8.20.1": {
138143
"start": "2024-01-01",
139-
"end": "2024-08-01"
144+
"lts": "2024-01-01",
145+
"end": "2026-08-01"
140146
},
141147
"9.0.0-beta.4": {
142148
"start": "2024-06-13",
143-
"active": "2024-06-13",
144-
"end": "2025-06-13"
149+
"end": "2026-06-13",
150+
"prerelease": true
145151
}
146152
}
147153
}

config/ruby-lts.png

-21.1 KB
Binary file not shown.

config/scala-lts.png

-21 KB
Binary file not shown.

config/swift-lts.png

-21.3 KB
Binary file not shown.

scripts/cli/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { startTestServer } from '../cts/testServer';
99
import { formatter } from '../formatter.js';
1010
import { generate } from '../generate.js';
1111
import { playground } from '../playground.js';
12-
import { createReleasePR } from '../release/createReleasePR.js';
12+
import { createReleasePR, updateSLA } from '../release/createReleasePR.js';
13+
import type { Versions } from '../release/types.js';
1314
import { snippetsGenerateMany } from '../snippets/generate.js';
1415
import type { Language } from '../types.js';
1516

@@ -202,9 +203,16 @@ program
202203
.option(flags.verbose.flag, flags.verbose.description)
203204
.option('-m, --major', 'triggers a major release for the given language list')
204205
.option('-d, --dry-run', 'does not push anything to GitHub')
205-
.action(async (langArgs: LangArg[], { verbose, major, dryRun }) => {
206+
.option('-gg, --generate-graph', 'only generates the graph')
207+
.action(async (langArgs: LangArg[], { verbose, major, dryRun, generateGraph }) => {
206208
setVerbose(Boolean(verbose));
207209

210+
if (generateGraph) {
211+
await updateSLA({} as Versions, true);
212+
213+
return;
214+
}
215+
208216
if (langArgs.length === 0) {
209217
langArgs = [ALL];
210218
}

scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"fs-extra": "11.2.0",
4747
"js-yaml": "4.1.0",
4848
"knip": "5.20.0",
49-
"lts": "1.2.0",
49+
"lts": "patch:lts@npm%3A1.2.0#~/.yarn/patches/lts-npm-1.2.0-e55f0a54f7.patch",
5050
"micromatch": "4.0.7",
5151
"semver": "7.6.2",
5252
"spinnies": "0.5.1",

0 commit comments

Comments
 (0)