Skip to content

Commit 02c782f

Browse files
t3dotggclaude
andcommitted
fix(release): small releases get short notes, and an older first note keeps its version label
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent f16a67f commit 02c782f

3 files changed

Lines changed: 29 additions & 11 deletions

File tree

‎apps/web/src/components/sidebar/SidebarUpdateReleaseNotes.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function SidebarUpdateReleaseNotes({
104104
if (releaseNote.intro !== undefined) {
105105
return (
106106
<section className={index > 0 ? "mt-4" : undefined} key={releaseNote.version}>
107-
{index > 0 ? (
107+
{releaseNote.version !== state.availableVersion ? (
108108
<h3 className="mb-1 text-xs leading-4 font-medium text-muted-foreground">
109109
{releaseNote.releasedAt
110110
? `${releaseNote.version} · ${formatReleaseAge(releaseNote.releasedAt)}`

‎scripts/generate-release-notes.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { assert, it } from "@effect/vitest";
22

3+
import * as Option from "effect/Option";
4+
35
import {
46
countContributors,
57
isReleaseNoteCommit,
8+
summaryText,
69
type PullRequest,
710
} from "./generate-release-notes.ts";
811

@@ -49,3 +52,14 @@ it("leaves mobile-only scopes out and keeps shared ones", () => {
4952
assert.equal(isReleaseNoteCommit({ subject, authorName: "" }), kept, subject);
5053
}
5154
});
55+
56+
it("uses model text only from a completed response", () => {
57+
const output = [
58+
{ type: "message", content: [{ type: "output_text", text: " ## Highlights\nX " }] },
59+
];
60+
assert.deepStrictEqual(
61+
summaryText({ status: "completed", output }),
62+
Option.some("## Highlights\nX"),
63+
);
64+
assert.deepStrictEqual(summaryText({ status: "incomplete", output }), Option.none());
65+
});

‎scripts/generate-release-notes.ts‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ You get the commit subjects merged since the last release, oldest first. Most en
2929
Output Markdown in exactly this shape and nothing else:
3030
3131
## Highlights
32-
2 to 4 short sentences. Name only the new features a user would care about most. Each feature gets a few words that make the benefit clear, not a description of how it works or where the button is.
32+
Up to 4 short sentences. Name only the new features a user would care about most. If no new feature matters to users, write one sentence about the most important fix. Each feature gets a few words that make the benefit clear, not a description of how it works or where the button is.
3333
3434
## Fixes
35-
- 5 to 10 bullets, one fix each, under 10 words, ending with the PR number like (#123).
35+
- Up to 10 bullets, one fix each, under 10 words, ending with the PR number like (#123). Fewer is fine. Never pad.
3636
- Each bullet names what was broken and says it works now. A user who hit the bug should recognize it.
3737
- Only list fixes from fix commits. New abilities go in Highlights or nowhere. Say "again" only if the commit says it.
3838
@@ -261,6 +261,17 @@ const readFullChangelog = Effect.fn("generateReleaseNotes.readFullChangelog")(fu
261261
return (yield* decodeJson(GeneratedNotes)(response)).body;
262262
});
263263

264+
export function summaryText(response: typeof SummaryResponse.Type): Option.Option<string> {
265+
// An incomplete response can carry partial text; publishing it would cut the notes short.
266+
if (response.status !== "completed") return Option.none();
267+
const text = response.output
268+
.flatMap((item) => item.content ?? [])
269+
.flatMap((part) => (part.type === "output_text" && part.text ? [part.text] : []))
270+
.join("")
271+
.trim();
272+
return text === "" ? Option.none() : Option.some(text);
273+
}
274+
264275
const summarize = Effect.fn("generateReleaseNotes.summarize")(function* (input: string) {
265276
const apiKey = yield* Config.Redacted("OPENAI_API_KEY");
266277
const httpClient = yield* HttpClient.HttpClient;
@@ -285,14 +296,7 @@ const summarize = Effect.fn("generateReleaseNotes.summarize")(function* (input:
285296
outputTokens: response.usage?.output_tokens,
286297
}),
287298
);
288-
// An incomplete response can carry partial text; publishing it would cut the notes short.
289-
if (response.status !== "completed") return Option.none<string>();
290-
const text = response.output
291-
.flatMap((item) => item.content ?? [])
292-
.flatMap((part) => (part.type === "output_text" && part.text ? [part.text] : []))
293-
.join("")
294-
.trim();
295-
return text === "" ? Option.none<string>() : Option.some(text);
299+
return summaryText(response);
296300
});
297301

298302
const command = Command.make(

0 commit comments

Comments
 (0)