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/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__/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/__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/__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/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 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", diff --git a/package-lock.json b/package-lock.json index 5b0602ac2..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", @@ -1430,12 +1430,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2851,9 +2851,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -2945,6 +2945,20 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -7186,12 +7200,12 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -8222,9 +8236,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -8291,6 +8305,13 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 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/schemas/config.json b/schemas/config.json index 2477278a5..e47aae6df 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"] } ] } @@ -377,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" @@ -412,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/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/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/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 diff --git a/src/manifest.ts b/src/manifest.ts index 10ac85748..281e20ee7 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; @@ -688,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: '', }; @@ -1240,7 +1244,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); } @@ -1372,7 +1376,6 @@ function extractReleaserConfig( skipSnapshot: config['skip-snapshot'], initialVersion: config['initial-version'], excludePaths: config['exclude-paths'], - signoff: config['signoff'], }; } @@ -1417,6 +1420,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(','), @@ -1571,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/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 { 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/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(); 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: [], 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'),