Skip to content

Commit ecbfa33

Browse files
authored
docs: remove SLA stuff (#3308)
1 parent 6ece109 commit ecbfa33

25 files changed

+97
-2166
lines changed

.yarn/patches/lts-npm-1.2.0-e55f0a54f7.patch

Lines changed: 0 additions & 53 deletions
This file was deleted.

scripts/ci/actions/restore-artifacts/builddir/index.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/ci/actions/restore-artifacts/builddir/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/ci/codegen/pushToAlgoliaDoc.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,9 @@ async function pushToAlgoliaDoc(): Promise<void> {
4444
await run(`git checkout -B ${targetBranch}`, { cwd: tempGitDir });
4545

4646
const pathToSpecs = toAbsolutePath(`${tempGitDir}/app_data/api/specs`);
47-
const pathToImages = toAbsolutePath(`${tempGitDir}/assets/images/api`);
4847
await run(`cp ${toAbsolutePath('specs/bundled/*.doc.yml')} ${pathToSpecs}`);
4948
await run(`cp ${toAbsolutePath('config/release.config.json')} ${pathToSpecs}`);
5049
await run(`cp ${toAbsolutePath('website/src/generated/*.json')} ${pathToSpecs}`);
51-
await run(
52-
`mkdir -p ${pathToImages} && cp ${toAbsolutePath('website/static/img/*-sla.png')} ${pathToImages}`,
53-
);
5450

5551
if ((await getNbGitDiff({ head: null, cwd: tempGitDir })) === 0) {
5652
console.log(`❎ Skipping push docs because there is no change.`);
@@ -77,7 +73,7 @@ async function pushToAlgoliaDoc(): Promise<void> {
7773
title: message,
7874
body: [
7975
'This PR is automatically created by https://github.com/algolia/api-clients-automation',
80-
'It contains the latest released OpenAPI specs, the release SLA dates and PNGs, and the generated code snippets.',
76+
'It contains the latest released OpenAPI specs, the release version support dates, and the generated code snippets.',
8177
].join('\n\n'),
8278
base: 'master',
8379
head: targetBranch,

scripts/cli/index.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ 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, updateSLA } from '../release/createReleasePR.js';
13-
import type { Versions } from '../release/types.js';
12+
import { createReleasePR } from '../release/createReleasePR.js';
1413
import { snippetsGenerateMany } from '../snippets/generate.js';
1514
import { buildSpecs } from '../specs';
1615
import type { Language } from '../types.js';
@@ -214,16 +213,9 @@ program
214213
undefined,
215214
)
216215
.option('-d, --dry-run', 'does not push anything to GitHub')
217-
.option('-gg, --generate-graph', 'only generates the graph')
218-
.action(async (langArgs: LangArg[], { verbose, releaseType, dryRun, generateGraph }) => {
216+
.action(async (langArgs: LangArg[], { verbose, releaseType, dryRun }) => {
219217
setVerbose(Boolean(verbose));
220218

221-
if (generateGraph) {
222-
await updateSLA({} as Versions, true);
223-
224-
return;
225-
}
226-
227219
if (langArgs.length === 0) {
228220
langArgs = [ALL];
229221
}

scripts/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"fs-extra": "11.2.0",
4646
"js-yaml": "4.1.0",
4747
"knip": "5.23.2",
48-
"lts": "patch:lts@npm%3A1.2.0#~/.yarn/patches/lts-npm-1.2.0-e55f0a54f7.patch",
4948
"micromatch": "4.0.7",
5049
"semver": "7.6.2",
5150
"spinnies": "0.5.1",

scripts/release/createReleasePR.ts

Lines changed: 39 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import fsp from 'fs/promises';
33

44
import chalk from 'chalk';
55
import dotenv from 'dotenv';
6-
import lts from 'lts';
76
import semver from 'semver';
87

98
import generationCommitText from '../ci/codegen/text.js';
@@ -402,60 +401,57 @@ async function prepareGitEnvironment(): Promise<void> {
402401

403402
// updates the release.config.json file for the sla field, which contains a release history of start and end date support
404403
// inspired by node: https://github.com/nodejs/Release/blob/main/schedule.json, following https://github.com/nodejs/release#release-schedule, leveraging https://github.com/nodejs/lts-schedule
405-
export async function updateSLA(versions: Versions, graphOnly?: boolean): Promise<void> {
404+
export async function updateSLA(versions: Versions): Promise<void> {
406405
const start = new Date();
407406
const end = new Date(new Date().setMonth(new Date().getMonth() + 24));
408407

409408
let queryStart = start;
410409
let queryEnd = end;
411410

412411
for (const [lang, supportedVersions] of Object.entries(fullReleaseConfig.sla)) {
413-
if (!graphOnly) {
414-
const next = versions[lang].next;
415-
const current = versions[lang].current;
412+
const next = versions[lang].next;
413+
const current = versions[lang].current;
416414

417-
// no ongoing release for this client, nothing changes
418-
if (!next || current === next) {
419-
continue;
420-
}
415+
// no ongoing release for this client, nothing changes
416+
if (!next || current === next) {
417+
continue;
418+
}
419+
420+
// update the previously supported SLA version fields
421+
if (current in supportedVersions) {
422+
const nextMinor = next.match(/.+\.(.+)\..*/);
423+
const currentMinor = current.match(/.+\.(.+)\..*/);
421424

422-
// update the previously supported SLA version fields
423-
if (current in supportedVersions) {
424-
const nextMinor = next.match(/.+\.(.+)\..*/);
425-
const currentMinor = current.match(/.+\.(.+)\..*/);
426-
427-
if (!currentMinor || !nextMinor) {
428-
throw new Error(`unable to determine minor versions: ${currentMinor}, ${nextMinor}`);
429-
}
430-
431-
// if it's not a major release, and we are on the same minor, we remove the current
432-
// patch because we support SLA at minor level
433-
if (versions[lang].releaseType !== 'major' && currentMinor[1] === nextMinor[1]) {
434-
delete supportedVersions[current];
435-
// if it's a major or not the same minor, it means we release a new latest versions, so the
436-
// current SLA goes in maintenance mode
437-
} else {
438-
delete supportedVersions[current].lts;
439-
440-
// any other release cases make the previous version enter in maintenance
441-
supportedVersions[current].maintenance = start.toISOString().split('T')[0];
442-
}
425+
if (!currentMinor || !nextMinor) {
426+
throw new Error(`unable to determine minor versions: ${currentMinor}, ${nextMinor}`);
443427
}
444428

445-
// we don't support SLA for pre-releases, so we will:
446-
// - set them as `prerelease`
447-
// - not the set `lts` field, the gen script will set the as `unstable`
448-
const isPreRelease =
449-
next.match(preReleaseRegExp) !== null || semver.prerelease(next) !== null;
450-
451-
supportedVersions[next] = {
452-
start: start.toISOString().split('T')[0],
453-
lts: isPreRelease ? undefined : start.toISOString().split('T')[0],
454-
end: end.toISOString().split('T')[0],
455-
prerelease: isPreRelease,
456-
};
429+
// if it's not a major release, and we are on the same minor, we remove the current
430+
// patch because we support SLA at minor level
431+
if (versions[lang].releaseType !== 'major' && currentMinor[1] === nextMinor[1]) {
432+
delete supportedVersions[current];
433+
// if it's a major or not the same minor, it means we release a new latest versions, so the
434+
// current SLA goes in maintenance mode
435+
} else {
436+
delete supportedVersions[current].lts;
437+
438+
// any other release cases make the previous version enter in maintenance
439+
supportedVersions[current].maintenance = start.toISOString().split('T')[0];
440+
}
457441
}
458442

443+
// we don't support SLA for pre-releases, so we will:
444+
// - set them as `prerelease`
445+
// - not the set `lts` field, the gen script will set the as `unstable`
446+
const isPreRelease = next.match(preReleaseRegExp) !== null || semver.prerelease(next) !== null;
447+
448+
supportedVersions[next] = {
449+
start: start.toISOString().split('T')[0],
450+
lts: isPreRelease ? undefined : start.toISOString().split('T')[0],
451+
end: end.toISOString().split('T')[0],
452+
prerelease: isPreRelease,
453+
};
454+
459455
// define the boundaries of the graph by searching for older and newest dates
460456
for (const [supportedVersion, dates] of Object.entries(supportedVersions)) {
461457
// delete maintenance versions that are not supported anymore
@@ -475,14 +471,6 @@ export async function updateSLA(versions: Versions, graphOnly?: boolean): Promis
475471
queryEnd = versionEnd;
476472
}
477473
}
478-
479-
lts.create({
480-
queryStart,
481-
queryEnd,
482-
png: toAbsolutePath(`website/static/img/${lang}-sla.png`),
483-
data: supportedVersions,
484-
projectName: '',
485-
});
486474
}
487475

488476
await fsp.writeFile(
@@ -514,7 +502,7 @@ export async function createReleasePR({
514502
releaseType,
515503
});
516504

517-
await updateSLA(versions, false);
505+
await updateSLA(versions);
518506

519507
const versionChanges = getVersionChangesText(versions);
520508

website/docs/clients/service-level-agreement.mdx

Lines changed: 0 additions & 21 deletions
This file was deleted.

website/docs/contributing/CI/overview.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
The CI runs on Github Actions and tries to be as efficient as possible by only running the required steps based on the changes.
44
To achieve this, it's using a combination of caches and artifacts, with [matrix jobs](https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs) to run only certain languages.
55

6-
![CI Overview](/img/full-ci.png)
7-
86
## Note on JavaScript
97

108
JavaScript CI is highly specialized and contains many differences with the other clients, so it has it's own dedicated steps.

website/docs/contributing/release-process.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,3 @@ You need approval from a member of the [`@algolia/api-clients-automation`](https
4040
After a full CI run, a release commit will be sent to every repository and spread changes to their `next` branch.
4141

4242
Each language repository should have their own release process, and should run only when the latest commit starts with `chore: release`. By doing so, we have a way to just update the repository, for example READMEs, without having to release.
43-
44-
## SLA graph
45-
46-
In order to generate the SLA graphs ([available here](/docs/clients/service-level-agreement)), we leverage the open-source Node.js tools:
47-
- [JSON input format file](https://github.com/nodejs/Release/blob/main/schedule.json)
48-
- [script](https://github.com/nodejs/lts-schedule)
49-
50-
The source of truth data lives in [the release config file](https://github.com/algolia/api-clients-automation/blob/main/config/release.config.json), under the `lts` field.
51-
52-
### Patch `lts` package
53-
54-
The [`lts`](https://github.com/nodejs/lts-schedule) package has been patched (with `yarn patch lts`, see diff in `.yarn/patches`), if you edit the patch, make sure to run `yarn patch-commit -s /path/to/your/patch/folder` in order to update the lock.
55-
56-
### Generate
57-
58-
```bash
59-
apic release -gg
60-
```

0 commit comments

Comments
 (0)