fix: make GitHub releases canonical for release-please (#295)

This commit is contained in:
Trevin Chow
2026-03-17 18:40:51 -07:00
committed by GitHub
parent f508a3f759
commit 78971c9027
13 changed files with 155 additions and 462 deletions

View File

@@ -0,0 +1,39 @@
import { describe, expect, test } from "bun:test"
import { validateReleasePleaseConfig } from "../src/release/config"
describe("release-please config validation", () => {
test("rejects upward-relative changelog paths", () => {
const errors = validateReleasePleaseConfig({
packages: {
".": {
"changelog-path": "CHANGELOG.md",
},
"plugins/compound-engineering": {
"changelog-path": "../../CHANGELOG.md",
},
},
})
expect(errors).toHaveLength(1)
expect(errors[0]).toContain('Package "plugins/compound-engineering"')
expect(errors[0]).toContain("../../CHANGELOG.md")
})
test("allows package-local changelog paths and skipped changelogs", () => {
const errors = validateReleasePleaseConfig({
packages: {
".": {
"changelog-path": "CHANGELOG.md",
},
"plugins/compound-engineering": {
"skip-changelog": true,
},
".claude-plugin": {
"changelog-path": "CHANGELOG.md",
},
},
})
expect(errors).toEqual([])
})
})

View File

@@ -1,5 +1,5 @@
import { describe, expect, test } from "bun:test"
import { buildCompoundEngineeringDescription, renderChangelogEntry } from "../src/release/metadata"
import { buildCompoundEngineeringDescription } from "../src/release/metadata"
describe("release metadata", () => {
test("builds the current compound-engineering manifest description from repo counts", async () => {
@@ -8,16 +8,4 @@ describe("release metadata", () => {
"AI-powered development tools. 29 agents, 44 skills, 1 MCP server for code review, research, design, and workflow automation.",
)
})
test("renders root changelog entries with component-version headings", () => {
const entry = renderChangelogEntry("compound-engineering", "2.43.0", "2026-04-10", {
Features: ["Add release preview"],
Fixes: ["Correct changelog rendering"],
})
expect(entry).toContain("## compound-engineering v2.43.0 - 2026-04-10")
expect(entry).toContain("### Features")
expect(entry).toContain("- Add release preview")
expect(entry).toContain("### Fixes")
})
})