Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,18 @@ jobs:
test "${#tests[@]}" -gt 0
printf '%s\n' "${tests[@]}"
bun test "${tests[@]}"
# CI's `API spec` holds every deprecation's sunset to 365 days after the release that first
# serves it, and for a deprecation no release has served yet that day is this one's, known only
# now. So it runs again here, on the day this release is published, before anything is tagged:
# v1.2.8 shipped two sunsets 364 days out, and main's checks failed from the moment it was out.
- name: The published releases
if: steps.decide.outputs.full_checks == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release list --repo "$GITHUB_REPOSITORY" --limit 1000 --exclude-drafts --json tagName,publishedAt,isPrerelease > "$RUNNER_TEMP/releases.json"
- name: The 12-month support window holds on the day this is published
if: steps.decide.outputs.full_checks == 'false'
run: bun scripts/support-window.ts check --releases "$RUNNER_TEMP/releases.json"

# The same checks CI runs, against the commit being published, unless `gate` found the release
# commit is the release files on a commit main's CI passed. This or that run is the gate: nothing is
Expand Down
4 changes: 2 additions & 2 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8523,7 +8523,7 @@ paths:
in: query
deprecated: true
x-deprecation-date: '2026-12-01'
x-sunset: '2027-12-01'
x-sunset: '2027-12-02'
description: 'Deprecated: send the actions in a body with readBotApp (POST /api/v2/organizations/{organizationId}/bots/{botId}/apps/{appId}/read) instead. Fifty actions of 300 characters make an address longer than proxies carry. Actions of the app the Bot needs, written <app id>/<action name>, at most 50. One the app doesn''t offer is left out.'
style: form
explode: false
Expand Down Expand Up @@ -23169,7 +23169,7 @@ paths:
summary: Read the titles of a person's recordings (deprecated)
deprecated: true
x-deprecation-date: '2026-12-01'
x-sunset: '2027-12-01'
x-sunset: '2027-12-02'
description: 'Deprecated: send the ids in a body with readRecordingTitles (POST /api/v2/organizations/{organizationId}/people/{personId}/recording-titles/read) instead, so no list of ids rides in the address. Return the title of each recording named, by the id the backend gives it, so a proposal''s evidence can name the recordings it was learned from. A recording that isn''t the person''s is left out. The person themselves or an administrator may read them.'
x-openbot-singleton: true
security:
Expand Down
2 changes: 1 addition & 1 deletion api/openapi/bot-grants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ paths:
in: query
deprecated: true
x-deprecation-date: 2026-12-01
x-sunset: 2027-12-01
x-sunset: 2027-12-02
description: >-
Deprecated: send the actions in a body with readBotApp (POST
/api/v2/organizations/{organizationId}/bots/{botId}/apps/{appId}/read)
Expand Down
2 changes: 1 addition & 1 deletion api/openapi/learning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ paths:
summary: Read the titles of a person's recordings (deprecated)
deprecated: true
x-deprecation-date: 2026-12-01
x-sunset: 2027-12-01
x-sunset: 2027-12-02
description: >-
Deprecated: send the ids in a body with readRecordingTitles (POST
/api/v2/organizations/{organizationId}/people/{personId}/recording-titles/read)
Expand Down
7 changes: 5 additions & 2 deletions scripts/ci-changes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ describe("a release PR", () => {
"tests/release-policy.test.ts",
];

test("of only the release files runs the lint and the tests that read them", () => {
test("of only the release files runs the lint, the tests that read them, and the API spec's support window", () => {
const decision = decide(
"ci",
RELEASE,
Expand All @@ -1120,7 +1120,10 @@ describe("a release PR", () => {
},
}),
);
expect(running(decision)).toEqual(["partial", "static"]);
// `API spec` too: its support window counts a new deprecation from the release, so a sunset too
// close to it fails here rather than on main once it is published (v1.2.8 skipped it, and two
// sunsets 364 days after v1.2.8 failed main's checks after the release).
expect(running(decision)).toEqual(["api", "partial", "static"]);
expect(decision.tests).toEqual(RELEASE_TESTS);
});

Expand Down
11 changes: 9 additions & 2 deletions scripts/ci-changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
* - A release PR: labelled `release`, from this repository's `release/publish/v*` branch, changing
* only the release files, each version file only by its version (scripts/release-ci-gate.ts says
* which). Only the checks the release gate itself re-runs on such a commit run: `format, lint,
* types`, and the tests that read CHANGELOG.md or release-policy.json.
* types`, the tests that read CHANGELOG.md or release-policy.json, and `API spec`, whose
* support window counts a new deprecation's days from the release.
*
* main's own run of a commit the merge queue merged runs none of CI's checks again: the queue's run
* tested that very commit, so it skips them and names that run (decideMainPush), keeping only the
Expand Down Expand Up @@ -720,11 +721,17 @@ function releaseDecision(
webkitTests: [],
desktopBrowserTests: [],
reasons: [
"A release PR changing only the release files: only the checks publishing re-runs on it run.",
"A release PR changing only the release files: only the checks publishing re-runs on it run, and the API spec's support window, which counts from the release.",
],
};
if (workflow === "ci") {
run.static = true;
// The 12-month support window (`API spec`, scripts/support-window.ts) depends on the version
// the release PR sets: once it is newer than every release, a deprecation no release has served
// yet is counted from today, the day this release is about to serve it. On any other PR such a
// deprecation is held only to having a sunset, so this is the first run that counts its days.
// v1.2.8's skipped it, and two sunsets 364 days after its release failed main once it was out.
run.api = true;
decision.tests = deps
.mentions(RELEASE_FILES_READ_BY_TESTS)
.filter(isBunTest)
Expand Down
36 changes: 24 additions & 12 deletions scripts/release-note-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const RELEASE_2648: PullRequestFacts = {
const SPEC = () =>
Bun.YAML.parse(readFileSync(join(ROOT, "api/openapi.yaml"), "utf8"));

/** The real spec as it was before #2654: its two deprecations (2026-12-01) not yet marked. */
function before2654(): unknown {
/** The real spec with each of #2654's two deprecation marks (deprecated 2026-12-01) changed. */
function with2654Marks(change: (record: Record<string, unknown>) => void) {
const spec = SPEC();
const walk = (node: unknown) => {
if (Array.isArray(node)) {
Expand All @@ -73,20 +73,32 @@ function before2654(): unknown {
}
if (typeof node !== "object" || node === null) return;
const record = node as Record<string, unknown>;
if (
record["x-deprecation-date"] === "2026-12-01" &&
record["x-sunset"] === "2027-12-01"
) {
delete record.deprecated;
delete record["x-deprecation-date"];
delete record["x-sunset"];
}
if (record["x-deprecation-date"] === "2026-12-01") change(record);
for (const value of Object.values(record)) walk(value);
};
walk(spec);
return spec;
}

/** The real spec as it was before #2654: its two deprecations not yet marked. */
function before2654(): unknown {
return with2654Marks((record) => {
delete record.deprecated;
delete record["x-deprecation-date"];
delete record["x-sunset"];
});
}

/**
* The real spec as #2654 left it: its two deprecations with the sunset its note named, 2027-12-01.
* They moved a day later once v1.2.8 served them, to a full 365 days after that release.
*/
function as2654LeftIt(): unknown {
return with2654Marks((record) => {
record["x-sunset"] = "2027-12-01";
});
}

describe("a release note", () => {
test("is read from under ## Changelog, comments and Windows line ends taken out", () => {
const body = `## What this changes\r\n\r\nA fix.\r\n\r\n## Changelog\r\n\r\n<!-- Template help. -->\r\n${NOTE_2654.replace(/\n/g, "\r\n")}\r\n## Proof\r\n\r\nRan it.`;
Expand Down Expand Up @@ -177,7 +189,7 @@ describe("the release note check", () => {
files: PR_2654.files.filter((file) => file !== "CHANGELOG.md"),
};
expect(
releaseNoteProblems(pr, addedDeprecations(before2654(), SPEC())),
releaseNoteProblems(pr, addedDeprecations(before2654(), as2654LeftIt())),
).toEqual([]);
});

Expand Down Expand Up @@ -232,7 +244,7 @@ describe("the release note check", () => {
});

test("a new deprecation must be named in the note, with its sunset", () => {
const added = addedDeprecations(before2654(), SPEC());
const added = addedDeprecations(before2654(), as2654LeftIt());
expect(added.map((element) => element.key).sort()).toEqual([
"GET /api/v2/organizations/{organizationId}/bots/{botId}/apps/{appId} query actions",
"GET /api/v2/organizations/{organizationId}/people/{personId}/recording-titles",
Expand Down
14 changes: 9 additions & 5 deletions shared/tests/api-deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,17 @@ describe("a builder's marks", () => {
expect(
missingFromChangelog(table, CHANGELOG).map((element) => element.key),
).toContain(`PATCH ${ROUTINE}`);
// Every element listed with its own sunset, the real spec's own deprecations included: the
// changelog on main is written only by the release, so it can't be what lists those.
const listed = [
CHANGELOG,
...keys(table).map((key) =>
key.includes("query view")
? ` - \`${key}\`: no longer read. Sunset 2027-12-01.`
: ` - \`${key}\`: use something else. Sunset 2027-11-17.`,
),
...table.operations
.flatMap((operation) => operation.elements)
.map(({ key, sunset }) =>
key.includes("query view")
? ` - \`${key}\`: no longer read. Sunset ${sunset}.`
: ` - \`${key}\`: use something else. Sunset ${sunset}.`,
),
].join("\n");
expect(missingFromChangelog(table, listed)).toEqual([]);
// The right key with the wrong date is not listed.
Expand Down
Loading