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
2 changes: 1 addition & 1 deletion .repokeeper.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# repokeeper configuration: https://github.com/vannt-dev/repokeeper
schema: 1
standard: 1.4.1
standard: 1.4.2
platform: github
stacks:
- node
Expand Down
2 changes: 1 addition & 1 deletion .repokeeper/lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lockVersion": 1,
"standard": "1.4.1",
"standard": "1.4.2",
"entries": [
{
"id": "block:.gitattributes#editorconfig",
Expand Down
16 changes: 16 additions & 0 deletions src/platforms/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ for id in $ids; do gh api -X POST "repos/$GITHUB_REPOSITORY/actions/runs/$id/app
`;

const RELEASE_PLEASE_SCHEMA = "https://github.com/ghraw/googleapis/release-please/main/schemas/config.json";
// release-please's own php sections (src/strategies/php.ts) with chore hidden, as every other strategy has it
const PHP_CHANGELOG_SECTIONS = [
{ type: "feat", section: "Features" },
{ type: "fix", section: "Bug Fixes" },
{ type: "perf", section: "Performance Improvements" },
{ type: "revert", section: "Reverts" },
{ type: "chore", section: "Miscellaneous Chores", hidden: true },
{ type: "docs", section: "Documentation", hidden: true },
{ type: "style", section: "Styles", hidden: true },
{ type: "refactor", section: "Code Refactoring", hidden: true },
{ type: "test", section: "Tests", hidden: true },
{ type: "build", section: "Build System", hidden: true },
{ type: "ci", section: "Continuous Integration", hidden: true },
];
const json = (value: unknown) => `${JSON.stringify(value, null, 2)}\n`;

export const githubPlatform: PlatformAdapter = {
Expand Down Expand Up @@ -187,6 +201,8 @@ export const githubPlatform: PlatformAdapter = {
...(release.versionFile ? { "version-file": release.versionFile } : {}),
// Without it a pom at a release version first gets a pull request that only bumps to -SNAPSHOT
...(release.type === "maven" ? { "skip-snapshot": true } : {}),
// release-please's php strategy shows chore commits, which makes each one releasable on its own
...(release.type === "php" ? { "changelog-sections": PHP_CHANGELOG_SECTIONS } : {}),
// release-please makes a repository's first release 1.0.0 unless told otherwise; a release tag means
// there was one, even when a version file release-please never bumps still reads 0.0.0
...(seed === "0.0.0" && !ctx.repo.releasedVersion ? { "initial-version": "0.1.0" } : {}),
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const PACKAGE_VERSION: string = (
).version;

/** The standard this build of repokeeper applies. Bump it whenever generated output changes. */
export const STANDARD_VERSION = "1.4.1";
export const STANDARD_VERSION = "1.4.2";

export const TOOL_VERSIONS = {
lefthook: "2.1.14",
Expand Down
20 changes: 20 additions & 0 deletions test/modules-non-node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,23 @@ describe("maven releases", () => {
expect(pkg("simple")).not.toHaveProperty("skip-snapshot");
});
});

describe("php releases", () => {
const pkg = (type: "php" | "node") => {
const outputs = releaseModule.outputs(
makeContext({ stacks: [nodeResolved({ release: { type, version: "1.0.0" } })] }),
);
return JSON.parse(file(outputs, "release-please-config.json").content).packages["."];
};

it("hide chore commits, which release-please's php strategy otherwise releases on their own", () => {
const sections = pkg("php")["changelog-sections"] as { type: string; hidden?: boolean }[];

expect(sections.find((s) => s.type === "chore")).toMatchObject({ hidden: true });
expect(sections.filter((s) => !s.hidden).map((s) => s.type)).toEqual(["feat", "fix", "perf", "revert"]);
});

it("leave the changelog sections to release-please for other release types", () => {
expect(pkg("node")).not.toHaveProperty("changelog-sections");
});
});
Loading