From e562ee21c8820d99007604cd930022816ce6c76c Mon Sep 17 00:00:00 2001 From: cyw Date: Thu, 12 Sep 2024 00:34:25 +0800 Subject: [PATCH 01/12] fix: fix comment at release pr is ugly (#2348) Co-authored-by: Jeff Ching --- src/manifest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/manifest.ts b/src/manifest.ts index 10ac85748..341e7ff85 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -1240,7 +1240,7 @@ export class Manifest { const releaseList = githubReleases .map(({tagName, url}) => `- [${tagName}](${url})`) .join('\n'); - const comment = `:robot: Created releases:\n${releaseList}\n:sunflower:`; + const comment = `🤖 Created releases:\n\n${releaseList}\n\n:sunflower:`; await this.github.commentOnIssue(comment, pullRequest.number); } From 050cf93f272e76f0fc7a408fc9e85ab02321459c Mon Sep 17 00:00:00 2001 From: cyw Date: Thu, 12 Sep 2024 00:44:46 +0800 Subject: [PATCH 02/12] fix: add missing generic updaters in to release please config schema extraFiles (#2344) Co-authored-by: Jeff Ching --- schemas/config.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/schemas/config.json b/schemas/config.json index 2477278a5..80056c466 100644 --- a/schemas/config.json +++ b/schemas/config.json @@ -188,6 +188,25 @@ } }, "required": ["type", "path"] + }, + { + "description": "An extra arbitrary file that includes release-please generic updater's annotation.", + "type": "object", + "properties": { + "type": { + "description": "The file format type.", + "enum": ["generic"] + }, + "path": { + "description": "The path to the file.", + "type": "string" + }, + "glob": { + "description": "Whether to treat the path as a glob. Defaults to `false`.", + "type": "boolean" + } + }, + "required": ["type", "path"] } ] } From a41d13787b6676b73c87b9e03ff952289928c0fd Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Wed, 11 Sep 2024 12:48:31 -0400 Subject: [PATCH 03/12] fix: don't escape html tags inside of inline code in release notes (#2367) Co-authored-by: Jeff Ching --- __snapshots__/default-changelog-notes.js | 9 +++++++++ src/changelog-notes/default.ts | 4 +++- test/changelog-notes/default-changelog-notes.ts | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/__snapshots__/default-changelog-notes.js b/__snapshots__/default-changelog-notes.js index 1116f347e..0ebca5644 100644 --- a/__snapshots__/default-changelog-notes.js +++ b/__snapshots__/default-changelog-notes.js @@ -153,6 +153,15 @@ exports['DefaultChangelogNotes buildNotes with commit parsing should handle html * render all imagesets as <picture> ([383fb14](https://github.com/googleapis/java-asset/commit/383fb14708ae91f7bb7e64bf0bacab38)) ` +exports['DefaultChangelogNotes buildNotes with commit parsing should handle html tags as inline code 1'] = ` +## [1.2.3](https://github.com/googleapis/java-asset/compare/v1.2.2...v1.2.3) (1983-10-10) + + +### Features + +* render all imagesets as <picture> \`\` \`\` \`\` \`\` ([82fcfaf](https://github.com/googleapis/java-asset/commit/82fcfaf039487566a6e2d49a215afe09)) +` + exports['DefaultChangelogNotes buildNotes with commit parsing should handle inline bug links 1'] = ` ## [1.2.3](https://github.com/googleapis/java-asset/compare/v1.2.2...v1.2.3) (1983-10-10) diff --git a/src/changelog-notes/default.ts b/src/changelog-notes/default.ts index 49405aa08..e3e47f6b6 100644 --- a/src/changelog-notes/default.ts +++ b/src/changelog-notes/default.ts @@ -123,5 +123,7 @@ function replaceIssueLink( } function htmlEscape(message: string): string { - return message.replace('<', '<').replace('>', '>'); + return message.replace(/``[^`].*[^`]``|`[^`]*`|<|>/g, match => + match.length > 1 ? match : match === '<' ? '<' : '>' + ); } diff --git a/test/changelog-notes/default-changelog-notes.ts b/test/changelog-notes/default-changelog-notes.ts index e78e48d10..ffb9baa9d 100644 --- a/test/changelog-notes/default-changelog-notes.ts +++ b/test/changelog-notes/default-changelog-notes.ts @@ -276,6 +276,20 @@ describe('DefaultChangelogNotes', () => { expect(notes).to.is.string; safeSnapshot(notes); }); + it('should handle html tags as inline code', async () => { + const commits = [ + buildMockCommit( + 'feat: render all imagesets as `` `` `` ``' + ), + ]; + const changelogNotes = new DefaultChangelogNotes(); + const notes = await changelogNotes.buildNotes( + parseConventionalCommits(commits), + notesOptions + ); + expect(notes).to.is.string; + safeSnapshot(notes); + }); // it('ignores reverted commits', async () => { // const commits = [buildCommitFromFixture('multiple-messages')]; // const changelogNotes = new DefaultChangelogNotes(); From eb968c8cbbf666355b87612e3bb704e1611e1747 Mon Sep 17 00:00:00 2001 From: Ketil <477141+mysteq@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:57:12 +0200 Subject: [PATCH 04/12] fix: respect signoff in manifest config (#2334) Signed-off-by: Ketil Gjerde <477141+mysteq@users.noreply.github.com> Co-authored-by: Jeff Ching --- schemas/config.json | 5 +++++ src/manifest.ts | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/schemas/config.json b/schemas/config.json index 80056c466..e47aae6df 100644 --- a/schemas/config.json +++ b/schemas/config.json @@ -396,6 +396,10 @@ ] } }, + "signoff": { + "description": "Text to be used as Signed-off-by in the commit.", + "type": "string" + }, "group-pull-request-title-pattern": { "description": "When grouping multiple release pull requests use this pattern for the title.", "type": "string" @@ -431,6 +435,7 @@ "last-release-sha": true, "always-link-local": true, "plugins": true, + "signoff": true, "group-pull-request-title-pattern": true, "release-search-depth": true, "commit-search-depth": true, diff --git a/src/manifest.ts b/src/manifest.ts index 341e7ff85..ec227dc6c 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -121,7 +121,6 @@ export interface ReleaserConfig { releaseLabels?: string[]; extraLabels?: string[]; initialVersion?: string; - signoff?: string; // Changelog options changelogSections?: ChangelogSection[]; @@ -161,7 +160,6 @@ interface ReleaserConfigJson { 'changelog-sections'?: ChangelogSection[]; 'release-as'?: string; 'skip-github-release'?: boolean; - signoff?: string; draft?: boolean; prerelease?: boolean; 'draft-pull-request'?: boolean; @@ -255,6 +253,7 @@ export interface ManifestConfig extends ReleaserConfigJson { 'last-release-sha'?: string; 'always-link-local'?: boolean; plugins?: PluginType[]; + signoff?: string; 'group-pull-request-title-pattern'?: string; 'release-search-depth'?: number; 'commit-search-depth'?: number; @@ -1372,7 +1371,6 @@ function extractReleaserConfig( skipSnapshot: config['skip-snapshot'], initialVersion: config['initial-version'], excludePaths: config['exclude-paths'], - signoff: config['signoff'], }; } @@ -1417,6 +1415,7 @@ async function parseConfig( separatePullRequests: config['separate-pull-requests'], groupPullRequestTitlePattern: config['group-pull-request-title-pattern'], plugins: config['plugins'], + signoff: config['signoff'], labels: configLabel?.split(','), releaseLabels: configReleaseLabel?.split(','), snapshotLabels: configSnapshotLabel?.split(','), From acc3242b1e35349ada51e0d41a66e8fad29000f6 Mon Sep 17 00:00:00 2001 From: 0xdbe <23268141+0xdbe@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:02:15 +0200 Subject: [PATCH 05/12] fix: GenericJSON updater uses regex to find version in matching entry (#2253) Co-authored-by: Jeff Ching --- __snapshots__/generic-json.js | 11 ++++++++ src/updaters/generic-json.ts | 15 +++++++++-- .../fixtures/renovate-shared-preset.json | 7 +++++ test/updaters/generic-json.ts | 27 +++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 test/updaters/fixtures/renovate-shared-preset.json diff --git a/__snapshots__/generic-json.js b/__snapshots__/generic-json.js index 7bc725d39..78d6383ef 100644 --- a/__snapshots__/generic-json.js +++ b/__snapshots__/generic-json.js @@ -46,3 +46,14 @@ exports['GenericJson updateContent updates matching entry 1'] = ` } ` + +exports['GenericJson updateContent updates substring in matching entry 1'] = ` +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>abc/foo:xyz/sub#2.3.4", + "github>abc/bar:xyz/sub#2.3.4" + ] +} + +` diff --git a/src/updaters/generic-json.ts b/src/updaters/generic-json.ts index 64d7355c9..95e822b29 100644 --- a/src/updaters/generic-json.ts +++ b/src/updaters/generic-json.ts @@ -18,6 +18,9 @@ import * as jp from 'jsonpath'; import {jsonStringify} from '../util/json-stringify'; import {logger as defaultLogger, Logger} from '../util/logger'; +const VERSION_REGEX = + /(?\d+)\.(?\d+)\.(?\d+)(-(?[\w.]+))?(\+(?[-\w.]+))?/; + export class GenericJson implements Updater { readonly jsonpath: string; readonly version: Version; @@ -33,8 +36,16 @@ export class GenericJson implements Updater { */ updateContent(content: string, logger: Logger = defaultLogger): string { const data = JSON.parse(content); - const nodes = jp.apply(data, this.jsonpath, _val => { - return this.version.toString(); + const nodes = jp.apply(data, this.jsonpath, value => { + if (typeof value !== 'string') { + logger.warn(`No string in ${this.jsonpath}. Skipping.`); + return value; + } + if (!value.match(VERSION_REGEX)) { + logger.warn(`No version found in ${this.jsonpath}. Skipping.`); + return value; + } + return value.replace(VERSION_REGEX, this.version.toString()); }); if (!nodes) { logger.warn(`No entries modified in ${this.jsonpath}`); diff --git a/test/updaters/fixtures/renovate-shared-preset.json b/test/updaters/fixtures/renovate-shared-preset.json new file mode 100644 index 000000000..1f0caca2d --- /dev/null +++ b/test/updaters/fixtures/renovate-shared-preset.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>abc/foo:xyz/sub#1.2.3", + "github>abc/bar:xyz/sub#1.2.3" + ] +} diff --git a/test/updaters/generic-json.ts b/test/updaters/generic-json.ts index 00431bc68..d25cf6d9e 100644 --- a/test/updaters/generic-json.ts +++ b/test/updaters/generic-json.ts @@ -45,6 +45,15 @@ describe('GenericJson', () => { const newContent = updater.updateContent(oldContent); snapshot(newContent); }); + it('updates substring in matching entry', async () => { + const oldContent = readFileSync( + resolve(fixturesPath, './renovate-shared-preset.json'), + 'utf8' + ).replace(/\r\n/g, '\n'); + const updater = new GenericJson('$.extends.*', Version.parse('v2.3.4')); + const newContent = updater.updateContent(oldContent); + snapshot(newContent); + }); it('ignores non-matching entry', async () => { const oldContent = readFileSync( resolve(fixturesPath, './esy.json'), @@ -54,6 +63,24 @@ describe('GenericJson', () => { const newContent = updater.updateContent(oldContent); expect(newContent).to.eql(oldContent); }); + it('ignore array entry', async () => { + const oldContent = readFileSync( + resolve(fixturesPath, './renovate-shared-preset.json'), + 'utf8' + ).replace(/\r\n/g, '\n'); + const updater = new GenericJson('$.extends', Version.parse('v2.3.4')); + const newContent = updater.updateContent(oldContent); + expect(newContent).to.eql(oldContent); + }); + it('ignore non-matching string', async () => { + const oldContent = readFileSync( + resolve(fixturesPath, './esy.json'), + 'utf8' + ).replace(/\r\n/g, '\n'); + const updater = new GenericJson('$.author', Version.parse('v2.3.4')); + const newContent = updater.updateContent(oldContent); + expect(newContent).to.eql(oldContent); + }); it('warns on invalid jsonpath', async () => { const oldContent = readFileSync( resolve(fixturesPath, './esy.json'), From dad27e385e4cfdec18c84a1b48c3b45ab65abe5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bazyli=20Brz=C3=B3ska?= Date: Wed, 11 Sep 2024 10:04:53 -0700 Subject: [PATCH 06/12] fix: respect `tagSeparator` and `includeVInTag` everywhere (#2283) fixes #2282 Co-authored-by: Jeff Ching --- src/manifest.ts | 7 ++++++- src/strategies/php-yoshi.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/manifest.ts b/src/manifest.ts index ec227dc6c..5226ac21f 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -687,7 +687,12 @@ export class Manifest { `No latest release found for path: ${path}, component: ${component}, but a previous version (${version.toString()}) was specified in the manifest.` ); releasesByPath[path] = { - tag: new TagName(version, component), + tag: new TagName( + version, + component, + this.repositoryConfig[path].tagSeparator, + this.repositoryConfig[path].includeVInTag + ), sha: '', notes: '', }; diff --git a/src/strategies/php-yoshi.ts b/src/strategies/php-yoshi.ts index ed31687b9..8bd1bfde6 100644 --- a/src/strategies/php-yoshi.ts +++ b/src/strategies/php-yoshi.ts @@ -101,7 +101,12 @@ export class PHPYoshi extends BaseStrategy { const versionsMap: VersionsMap = new Map(); const directoryVersionContents: Record = {}; const component = await this.getComponent(); - const newVersionTag = new TagName(newVersion, component); + const newVersionTag = new TagName( + newVersion, + component, + this.tagSeparator, + this.includeVInTag + ); let releaseNotesBody = `## ${newVersion.toString()}`; for (const directory of topLevelDirectories) { try { From a4bbce1355f1105c0ef53ac84cdf10edce5fc690 Mon Sep 17 00:00:00 2001 From: Amo Chumber Date: Wed, 11 Sep 2024 18:09:02 +0100 Subject: [PATCH 07/12] =?UTF-8?q?docs:=20update=20manifest-releaser=20docs?= =?UTF-8?q?=20to=20add=20some=20clarification=20around=20=E2=80=A6=20(#233?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update manifest-releaser docs to add some clarification around the package path - make it a little clearer that the package path should be a folder and not a file - give an example for creating an empty release-please-manifest.json Signed-off-by: Amo Chumber * Update manifest-releaser.md --------- Signed-off-by: Amo Chumber Co-authored-by: Jeff Ching --- docs/manifest-releaser.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/manifest-releaser.md b/docs/manifest-releaser.md index cfc3e0248..92e24a273 100644 --- a/docs/manifest-releaser.md +++ b/docs/manifest-releaser.md @@ -47,7 +47,13 @@ Create a minimal `release-please-config.json`, e.g., for a single JS package: } ``` -Create an empty `.release-please-manifest.json` +> Note: `path/to/pkg` should be a directory and not a file. + +Create an empty `.release-please-manifest.json`. For example: +```shell +echo "{}" > .release-please-manifest.json +``` + Commit/push/merge these to your remote GitHub repo (using either the repo's default branch or a test branch in which case you'll use the `--target-branch` @@ -269,7 +275,7 @@ defaults (those are documented in comments) "exclude-paths": ["path/to/myPyPkgA"] }, - // path segment should be relative to repository root + // path segment should be a folder relative to repository root "path/to/myJSPkgA": { // overrides release-type for node "release-type": "node", From 92abffb65bdf8e3d855224b15f3869d9f01aba5c Mon Sep 17 00:00:00 2001 From: Forest Anderson Date: Wed, 11 Sep 2024 13:14:56 -0400 Subject: [PATCH 08/12] docs: fix xml mention in json docs (#2243) Co-authored-by: Jeff Ching --- docs/customizing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/customizing.md b/docs/customizing.md index 0c5df16ea..3f290f5d1 100644 --- a/docs/customizing.md +++ b/docs/customizing.md @@ -199,7 +199,7 @@ force the [Generic](/src/updaters/generic.ts) updater, you must use type ## Updating arbitrary JSON files -For files with the `.xml` extension, the `version` property is updated. +For files with the `.json` extension, the `version` property is updated. For most release strategies, you can provide additional files to update using the [GenericJson](/src/updaters/generic-json.ts) updater. You can From 3101ab32a1898d265277f543f1fca08793ec9a41 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Wed, 11 Sep 2024 11:19:48 -0600 Subject: [PATCH 09/12] fix: prevent open release PRs from being mistaken as current releases (#2323) * docs: add compile step to local run command * fix: prevent open release PRs from being mistaken as current releases --------- Co-authored-by: Jeff Ching --- CONTRIBUTING.md | 2 +- __snapshots__/github.js | 29 +++++++++++++++++++++++++++++ src/github.ts | 1 + src/manifest.ts | 2 +- src/pull-request.ts | 1 + test/manifest.ts | 1 + 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2591549ef..d9e4be0fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -62,7 +62,7 @@ accept your pull requests. The below command should be run from the root of the source code: ``` - node build/src/bin/release-please.js release-pr \ + npm run compile && node build/src/bin/release-please.js release-pr \ --token=$GITHUB_TOKEN \ --repo-url=/ [extra options] ``` diff --git a/__snapshots__/github.js b/__snapshots__/github.js index af1c14c8b..a7900800b 100644 --- a/__snapshots__/github.js +++ b/__snapshots__/github.js @@ -11,6 +11,7 @@ exports['GitHub commitsSince backfills commit files for pull requests rebased an "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-rebase-merge", + "mergeCommitOid": "b29149f890e6f76ee31ed128585744d4c598924c", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -28,6 +29,7 @@ exports['GitHub commitsSince backfills commit files for pull requests rebased an "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-rebase-merge", + "mergeCommitOid": "b29149f890e6f76ee31ed128585744d4c598924c", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -48,6 +50,7 @@ exports['GitHub commitsSince backfills commit files for pull requests with lots "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "e6daec403626c9987c7af0d97b34f324cd84320a", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -68,6 +71,7 @@ exports['GitHub commitsSince backfills commit files without pull requests 1'] = "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "e6daec403626c9987c7af0d97b34f324cd84320a", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -86,6 +90,7 @@ exports['GitHub commitsSince finds commits up until a condition 1'] = [ "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "e6daec403626c9987c7af0d97b34f324cd84320a", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -104,6 +109,7 @@ exports['GitHub commitsSince finds first commit of a multi-commit merge pull req "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "e6daec403626c9987c7af0d97b34f324cd84320a", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -119,6 +125,7 @@ exports['GitHub commitsSince finds first commit of a multi-commit merge pull req "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "b29149f890e6f76ee31ed128585744d4c598924c", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -134,6 +141,7 @@ exports['GitHub commitsSince finds first commit of a multi-commit merge pull req "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "27d7d7232e2e312d1380e906984f0823f5decf61", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -152,6 +160,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "e6daec403626c9987c7af0d97b34f324cd84320a", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -167,6 +176,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "b29149f890e6f76ee31ed128585744d4c598924c", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -182,6 +192,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "27d7d7232e2e312d1380e906984f0823f5decf61", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -197,6 +208,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "2b4e0b3be2e231cd87cc44c411bd8f84b4587ab5", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -212,6 +224,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "a257514a541d483425118d973674b1ce006a5489", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -227,6 +240,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "b6a8ab1a50106cfb03f22c2cdaf7abfdcccce088", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -242,6 +256,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "520b6f42551c86002197d033564a76a3f99b0019", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -257,6 +272,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 3, "baseBranchName": "main", "headBranchName": "release-please/branches/main", + "mergeCommitOid": "9dda1a331d311d0a7643015cc9e6802548c8d943", "title": "chore(main): release 0.1.1-SNAPSHOT", "body": ":robot: I have created a release \\*beep\\* \\*boop\\* \n---\n### Updating meta-information for bleeding-edge SNAPSHOT release.\n---\n\n\nThis PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).", "labels": [ @@ -274,6 +290,7 @@ exports['GitHub commitsSince limits pagination 1'] = [ "number": 2, "baseBranchName": "main", "headBranchName": "feature-branch", + "mergeCommitOid": "e86984fb22ccc5eafb6c3d815851ade3463193da", "title": "feat: feature-branch that will be squash merged", "body": "", "labels": [], @@ -296,6 +313,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "e6daec403626c9987c7af0d97b34f324cd84320a", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -311,6 +329,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "b29149f890e6f76ee31ed128585744d4c598924c", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -326,6 +345,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "27d7d7232e2e312d1380e906984f0823f5decf61", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -341,6 +361,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "2b4e0b3be2e231cd87cc44c411bd8f84b4587ab5", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -356,6 +377,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "a257514a541d483425118d973674b1ce006a5489", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -371,6 +393,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "b6a8ab1a50106cfb03f22c2cdaf7abfdcccce088", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -386,6 +409,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 6, "baseBranchName": "main", "headBranchName": "feature-branch-merge", + "mergeCommitOid": "520b6f42551c86002197d033564a76a3f99b0019", "title": "feat: feature that will be rebase merged", "body": "", "labels": [], @@ -401,6 +425,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 3, "baseBranchName": "main", "headBranchName": "release-please/branches/main", + "mergeCommitOid": "9dda1a331d311d0a7643015cc9e6802548c8d943", "title": "chore(main): release 0.1.1-SNAPSHOT", "body": ":robot: I have created a release \\*beep\\* \\*boop\\* \n---\n### Updating meta-information for bleeding-edge SNAPSHOT release.\n---\n\n\nThis PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).", "labels": [ @@ -418,6 +443,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 2, "baseBranchName": "main", "headBranchName": "feature-branch", + "mergeCommitOid": "e86984fb22ccc5eafb6c3d815851ade3463193da", "title": "feat: feature-branch that will be squash merged", "body": "", "labels": [], @@ -437,6 +463,7 @@ exports['GitHub commitsSince paginates through commits 1'] = [ "number": 1, "baseBranchName": "main", "headBranchName": "release-release-please-test-v0.1.0", + "mergeCommitOid": "959ee48c95f254300eb040c46ebdc8248317efe4", "title": "Release release-please-test v0.1.0", "body": "This pull request was generated using releasetool.\n\n02-03-2021 11:56 PST\n\n### New Features\n- feat: initial commit\n\n### Internal / Testing Changes\n- build: add java structure", "labels": [ @@ -531,6 +558,7 @@ exports['GitHub mergeCommitIterator handles merged pull requests without files 1 "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "e6daec403626c9987c7af0d97b34f324cd84320a", "title": "feat: feature that will be plain merged", "body": "", "labels": [], @@ -546,6 +574,7 @@ exports['GitHub mergeCommitIterator handles merged pull requests without files 1 "number": 7, "baseBranchName": "main", "headBranchName": "feature-branch-plain-merge", + "mergeCommitOid": "b29149f890e6f76ee31ed128585744d4c598924c", "title": "feat: feature that will be plain merged", "body": "", "labels": [], diff --git a/src/github.ts b/src/github.ts index 0b581b646..f36a98f15 100644 --- a/src/github.ts +++ b/src/github.ts @@ -510,6 +510,7 @@ export class GitHub { number: pullRequest.number, baseBranchName: pullRequest.baseRefName, headBranchName: pullRequest.headRefName, + mergeCommitOid: pullRequest.mergeCommit?.oid, title: pullRequest.title, body: pullRequest.body, labels: pullRequest.labels.nodes.map(node => node.name), diff --git a/src/manifest.ts b/src/manifest.ts index 5226ac21f..281e20ee7 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -1575,7 +1575,7 @@ async function latestReleaseVersion( for await (const commitWithPullRequest of generator) { commitShas.add(commitWithPullRequest.sha); const mergedPullRequest = commitWithPullRequest.pullRequest; - if (!mergedPullRequest) { + if (!mergedPullRequest?.mergeCommitOid) { logger.trace( `skipping commit: ${commitWithPullRequest.sha} missing merged pull request` ); diff --git a/src/pull-request.ts b/src/pull-request.ts index a44feaee1..9176207d4 100644 --- a/src/pull-request.ts +++ b/src/pull-request.ts @@ -16,6 +16,7 @@ export interface PullRequest { readonly headBranchName: string; readonly baseBranchName: string; readonly number: number; + readonly mergeCommitOid?: string; readonly title: string; readonly body: string; readonly labels: string[]; diff --git a/test/manifest.ts b/test/manifest.ts index 7315dee0c..cbf259f02 100644 --- a/test/manifest.ts +++ b/test/manifest.ts @@ -1423,6 +1423,7 @@ describe('Manifest', () => { title: 'chore: release 1.2.3', headBranchName: 'release-please/branches/main', baseBranchName: 'main', + mergeCommitOid: 'abc123', number: 123, body: '', labels: [], From c4eb637b16e9bee19c3ee90bb426a6609040f545 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 10:26:00 -0700 Subject: [PATCH 10/12] chore(main): release 16.12.1 (#2376) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- src/index.ts | 2 +- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1c0bdd4c1..f1f01eaf9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "16.12.0" + ".": "16.12.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bc6720e5b..39e32f9cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ [1]: https://www.npmjs.com/package/release-please?activeTab=versions +## [16.12.1](https://github.com/googleapis/release-please/compare/v16.12.0...v16.12.1) (2024-09-11) + + +### Bug Fixes + +* add missing generic updaters in to release please config schema extraFiles ([#2344](https://github.com/googleapis/release-please/issues/2344)) ([050cf93](https://github.com/googleapis/release-please/commit/050cf93f272e76f0fc7a408fc9e85ab02321459c)) +* don't escape html tags inside of inline code in release notes ([#2367](https://github.com/googleapis/release-please/issues/2367)) ([a41d137](https://github.com/googleapis/release-please/commit/a41d13787b6676b73c87b9e03ff952289928c0fd)) +* fix comment at release pr is ugly ([#2348](https://github.com/googleapis/release-please/issues/2348)) ([e562ee2](https://github.com/googleapis/release-please/commit/e562ee21c8820d99007604cd930022816ce6c76c)) +* GenericJSON updater uses regex to find version in matching entry ([#2253](https://github.com/googleapis/release-please/issues/2253)) ([acc3242](https://github.com/googleapis/release-please/commit/acc3242b1e35349ada51e0d41a66e8fad29000f6)) +* prevent open release PRs from being mistaken as current releases ([#2323](https://github.com/googleapis/release-please/issues/2323)) ([3101ab3](https://github.com/googleapis/release-please/commit/3101ab32a1898d265277f543f1fca08793ec9a41)) +* respect `tagSeparator` and `includeVInTag` everywhere ([#2283](https://github.com/googleapis/release-please/issues/2283)) ([dad27e3](https://github.com/googleapis/release-please/commit/dad27e385e4cfdec18c84a1b48c3b45ab65abe5e)), closes [#2282](https://github.com/googleapis/release-please/issues/2282) +* respect signoff in manifest config ([#2334](https://github.com/googleapis/release-please/issues/2334)) ([eb968c8](https://github.com/googleapis/release-please/commit/eb968c8cbbf666355b87612e3bb704e1611e1747)) + ## [16.12.0](https://github.com/googleapis/release-please/compare/v16.11.0...v16.12.0) (2024-06-06) diff --git a/package-lock.json b/package-lock.json index 17786ba6c..6ad5fc234 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "release-please", - "version": "16.12.0", + "version": "16.12.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "release-please", - "version": "16.12.0", + "version": "16.12.1", "license": "Apache-2.0", "dependencies": { "@conventional-commits/parser": "^0.4.1", diff --git a/package.json b/package.json index e8c727574..495503a0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "release-please", - "version": "16.12.0", + "version": "16.12.1", "description": "generate release PRs based on the conventionalcommits.org spec", "main": "./build/src/index.js", "bin": "./build/src/bin/release-please.js", diff --git a/src/index.ts b/src/index.ts index 2f7b71528..c0033a7f9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,5 +63,5 @@ export const configSchema = require('../../schemas/config.json'); export const manifestSchema = require('../../schemas/manifest.json'); // x-release-please-start-version -export const VERSION = '16.12.0'; +export const VERSION = '16.12.1'; // x-release-please-end From 83eb3e4ead56ad6ef77be57050ba9a4770ae9d20 Mon Sep 17 00:00:00 2001 From: Ahmed AbouZaid <6760103+aabouzaid@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:44:11 +0200 Subject: [PATCH 11/12] fix: debug log error message of unparsed commits (#2326) Signed-off-by: Ahmed AbouZaid <6760103+aabouzaid@users.noreply.github.com> Co-authored-by: Jeff Ching --- src/commit.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commit.ts b/src/commit.ts index 6dffc4613..2bfd392c1 100644 --- a/src/commit.ts +++ b/src/commit.ts @@ -398,6 +398,7 @@ export function parseConventionalCommits( commit.message.split('\n')[0] }` ); + logger.debug(`error message: ${_err}`); } } } From 1491ab69deb445d9909590d2c0e54afc9e77f2eb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 11 Sep 2024 19:58:42 +0200 Subject: [PATCH 12/12] fix(deps): update dependency diff to v7 (#2372) Co-authored-by: Jeff Ching --- package-lock.json | 42 +++++++++++++++++++++++++++++++++++------- package.json | 2 +- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ad5fc234..54da454dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "conventional-changelog-writer": "^6.0.0", "conventional-commits-filter": "^3.0.0", "detect-indent": "^6.1.0", - "diff": "^5.0.0", + "diff": "^7.0.0", "figures": "^3.0.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", @@ -1700,6 +1700,14 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/code-suggester/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/code-suggester/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -1959,9 +1967,9 @@ } }, "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "engines": { "node": ">=0.3.1" } @@ -5197,6 +5205,15 @@ "type-detect": "4.0.8" } }, + "node_modules/sinon/node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -7393,6 +7410,11 @@ "wrap-ansi": "^7.0.0" } }, + "diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==" + }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -7585,9 +7607,9 @@ "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==" }, "diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==" + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==" }, "dir-glob": { "version": "3.0.1", @@ -9927,6 +9949,12 @@ "requires": { "type-detect": "4.0.8" } + }, + "diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true } } }, diff --git a/package.json b/package.json index 495503a0a..663360add 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "conventional-changelog-writer": "^6.0.0", "conventional-commits-filter": "^3.0.0", "detect-indent": "^6.1.0", - "diff": "^5.0.0", + "diff": "^7.0.0", "figures": "^3.0.0", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0",