From d5058c24f6f0ce6960ae547db320dbe871d8c996 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 19 Sep 2022 13:10:09 -0700 Subject: [PATCH 1/7] test: failing test for adding BEGIN/END_NESTED_COMMIT markers --- .../test/scan-googleapis-gen-and-create-pull-requests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts b/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts index fa1625d7fd0..729cf68be4e 100644 --- a/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts +++ b/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts @@ -355,7 +355,7 @@ Copy-Tag: ${copyTag}` body: '- [ ] Regenerate this pull request now.\n\n' + `Source-Link: https://github.com/googleapis/googleapis-gen/commit/${abcCommits[1]}\n` + - `Copy-Tag: ${copyTag}\n\nq\nThis is the greatest pull request ever.`, + `Copy-Tag: ${copyTag}\n\nBEGIN_NESTED_COMMIT\nq\nThis is the greatest pull request ever.\nEND_NESTED_COMMIT\n`, title: 'b', }, ]); From 612438830537bebaf035bca8d9dd61d8abfe1609 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 19 Sep 2022 13:12:45 -0700 Subject: [PATCH 2/7] feat: add BEGIN_NESTED_COMMIT/END_NESTED_COMMIT markers when combining multiple source commits --- packages/owl-bot/__snapshots__/create-pr.js | 73 ++ packages/owl-bot/package-lock.json | 735 ++++++++++++++++++++ packages/owl-bot/package.json | 3 +- packages/owl-bot/src/copy-code.ts | 13 +- packages/owl-bot/src/create-pr.ts | 57 +- packages/owl-bot/test/create-pr.ts | 42 +- 6 files changed, 909 insertions(+), 14 deletions(-) create mode 100644 packages/owl-bot/__snapshots__/create-pr.js diff --git a/packages/owl-bot/__snapshots__/create-pr.js b/packages/owl-bot/__snapshots__/create-pr.js new file mode 100644 index 00000000000..675b7509f4c --- /dev/null +++ b/packages/owl-bot/__snapshots__/create-pr.js @@ -0,0 +1,73 @@ +exports[ + 'prependCommitMessage with checkbox: yes handles an initial pull request content 1' +] = ` +fix: some new feature +`; + +exports[ + 'prependCommitMessage with checkbox: yes handles an initial pull request content 2' +] = ` +- [ ] Regenerate this pull request now. + +more additional context + +BEGIN_NESTED_COMMIT +feat: some feature +additional context +END_NESTED_COMMIT + +`; + +exports[ + 'prependCommitMessage with checkbox: yes handles an initial pull request with long title 1' +] = ` +fix: some new feature +`; + +exports[ + 'prependCommitMessage with checkbox: yes handles an initial pull request with long title 2' +] = ` +- [ ] Regenerate this pull request now. + +more additional context + +BEGIN_NESTED_COMMIT +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +END_NESTED_COMMIT + +`; + +exports[ + 'prependCommitMessage with checkbox: no handles an initial pull request content 1' +] = ` +fix: some new feature +`; + +exports[ + 'prependCommitMessage with checkbox: no handles an initial pull request content 2' +] = ` +more additional context + +BEGIN_NESTED_COMMIT +feat: some feature +additional context +END_NESTED_COMMIT + +`; + +exports[ + 'prependCommitMessage with checkbox: no handles an initial pull request with long title 1' +] = ` +fix: some new feature +`; + +exports[ + 'prependCommitMessage with checkbox: no handles an initial pull request with long title 2' +] = ` +more additional context + +BEGIN_NESTED_COMMIT +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +END_NESTED_COMMIT + +`; diff --git a/packages/owl-bot/package-lock.json b/packages/owl-bot/package-lock.json index f8542c546fb..b8385d2895a 100644 --- a/packages/owl-bot/package-lock.json +++ b/packages/owl-bot/package-lock.json @@ -54,6 +54,7 @@ "nock": "^13.2.9", "rimraf": "^3.0.2", "sinon": "^14.0.0", + "snap-shot-it": "^7.9.6", "ts-node": "^10.9.1", "typescript": "~4.8.3", "uuid": "^9.0.0" @@ -179,6 +180,19 @@ "node": ">=6.0.0" } }, + "node_modules/@bahmutov/data-driven": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@bahmutov/data-driven/-/data-driven-1.0.0.tgz", + "integrity": "sha512-YqW3hPS0RXriqjcCrLOTJj+LWe3c8JpwlL83k1ka1Q8U05ZjAKbGQZYeTzUd0NFEnnfPtsUiKGpFEBJG6kFuvg==", + "dev": true, + "dependencies": { + "check-more-types": "2.24.0", + "lazy-ass": "1.6.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -2914,6 +2928,15 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "node_modules/check-more-types": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -2941,6 +2964,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3101,6 +3130,15 @@ "node": ">= 6" } }, + "node_modules/common-tags": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", + "integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -3313,6 +3351,31 @@ "node": ">=8" } }, + "node_modules/disparity": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/disparity/-/disparity-3.0.0.tgz", + "integrity": "sha512-n94Rzbv2ambRaFzrnBf34IEiyOdIci7maRpMkoQWB6xFYGA7Nbs0Z5YQzMfTeyQeelv23nayqOcssBoc6rKrgw==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "diff": "^4.0.1" + }, + "bin": { + "disparity": "bin/disparity" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/disparity/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3424,6 +3487,24 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, + "node_modules/escape-quotes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-quotes/-/escape-quotes-1.0.2.tgz", + "integrity": "sha512-JpLFzklNReeakCpyj59s78P5F72q0ZUpDnp2BuIk9TtTjj2HMsgiWBChw17BlZT8dRhMtmSb1jE2+pTP1iFYyw==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + } + }, + "node_modules/escape-quotes/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -4327,6 +4408,12 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "node_modules/folktale": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/folktale/-/folktale-2.3.2.tgz", + "integrity": "sha512-+8GbtQBwEqutP0v3uajDDoN64K2ehmHd0cjlghhxh0WpcfPzAIjPA03e1VvHlxL02FVGR0A6lwXsNQKn3H1RNQ==", + "dev": true + }, "node_modules/follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -4929,6 +5016,27 @@ "node": ">= 0.4.0" } }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4937,6 +5045,15 @@ "node": ">=8" } }, + "node_modules/has-only": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/has-only/-/has-only-1.1.1.tgz", + "integrity": "sha512-3GuFy9rDw0xvovCHb4SOKiRImbZ+a8boFBUyGNRPVd2mRyQOzYdau5G9nodUXC1ZKYN59hrHFkW1lgBQscYfTg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -5277,6 +5394,18 @@ "node": ">=8" } }, + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "dependencies": { + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, "node_modules/is-core-module": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", @@ -5424,6 +5553,15 @@ "node": ">=8" } }, + "node_modules/its-name": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/its-name/-/its-name-1.0.0.tgz", + "integrity": "sha512-GYUWFxViqxDvGzsNEItTEuOqqAQVx29Xl9Lh5YUqyJd6gPHTCMiIbjqcjjyUzsBUqEcgwIdRoydwgfFw1oYbhg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/jmespath": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", @@ -5515,6 +5653,18 @@ "node": ">=8" } }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -5706,6 +5856,15 @@ "graceful-fs": "^4.1.9" } }, + "node_modules/lazy-ass": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", + "dev": true, + "engines": { + "node": "> 0.8" + } + }, "node_modules/leven": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", @@ -6544,6 +6703,15 @@ "node": ">=8" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", @@ -7002,6 +7170,15 @@ "node": ">=4" } }, + "node_modules/pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -7473,6 +7650,18 @@ "node": ">=8" } }, + "node_modules/quote": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/quote/-/quote-0.4.0.tgz", + "integrity": "sha512-KHp3y3xDjuBhRx+tYKOgzPnVHMRlgpn2rU450GcU4PL24r1H6ls/hfPrxDwX2pvYMlwODHI2l8WwgoV69x5rUQ==", + "dev": true + }, + "node_modules/ramda": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz", + "integrity": "sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==", + "dev": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -8162,6 +8351,156 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, + "node_modules/snap-shot-compare": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/snap-shot-compare/-/snap-shot-compare-3.0.0.tgz", + "integrity": "sha512-bdwNOAGuKwPU+qsn0ASxTv+QfkXU+3VmkcDOkt965tes+JQQc8d6SfoLiEiRVhCey4v+ip2IjNUSbZm5nnkI9g==", + "dev": true, + "dependencies": { + "check-more-types": "2.24.0", + "debug": "4.1.1", + "disparity": "3.0.0", + "folktale": "2.3.2", + "lazy-ass": "1.6.0", + "strip-ansi": "5.2.0", + "variable-diff": "1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/snap-shot-compare/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/snap-shot-compare/node_modules/debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/snap-shot-compare/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/snap-shot-compare/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/snap-shot-core": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/snap-shot-core/-/snap-shot-core-10.2.4.tgz", + "integrity": "sha512-A7tkcfmvnRKge4VzFLAWA4UYMkvFY4TZKyL+D6hnHjI3HJ4pTepjG5DfR2ACeDKMzCSTQ5EwR2iOotI+Z37zsg==", + "dev": true, + "dependencies": { + "arg": "4.1.3", + "check-more-types": "2.24.0", + "common-tags": "1.8.0", + "debug": "4.3.1", + "escape-quotes": "1.0.2", + "folktale": "2.3.2", + "is-ci": "2.0.0", + "jsesc": "2.5.2", + "lazy-ass": "1.6.0", + "mkdirp": "1.0.4", + "pluralize": "8.0.0", + "quote": "0.4.0", + "ramda": "0.27.1" + }, + "bin": { + "resave-snapshots": "bin/resave-snapshots.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/snap-shot-core/node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/snap-shot-core/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/snap-shot-it": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/snap-shot-it/-/snap-shot-it-7.9.6.tgz", + "integrity": "sha512-t/ADZfQ8EUk4J76S5cmynye7qg1ecUFqQfANiOMNy0sFmYUaqfx9K/AWwpdcpr3vFsDptM+zSuTtKD0A1EOLqA==", + "dev": true, + "dependencies": { + "@bahmutov/data-driven": "1.0.0", + "check-more-types": "2.24.0", + "common-tags": "1.8.0", + "debug": "4.3.1", + "has-only": "1.1.1", + "its-name": "1.0.0", + "lazy-ass": "1.6.0", + "pluralize": "8.0.0", + "ramda": "0.27.1", + "snap-shot-compare": "3.0.0", + "snap-shot-core": "10.2.4" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/snap-shot-it/node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/snap-shot-it/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/sonic-boom": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.2.0.tgz", @@ -8849,6 +9188,80 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/variable-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/variable-diff/-/variable-diff-1.1.0.tgz", + "integrity": "sha512-0Jk/MsCNtL/fCuVIbsLxwXpABGZCzN57btcPbSsjOOAwkdHJ3Y58fo8BoUfG7jghnvglbwo+5Hk1KOJ2W2Ormw==", + "dev": true, + "dependencies": { + "chalk": "^1.1.1", + "object-assign": "^4.0.1" + } + }, + "node_modules/variable-diff/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/variable-diff/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/variable-diff/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/variable-diff/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/variable-diff/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/variable-diff/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -9169,6 +9582,16 @@ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.1.tgz", "integrity": "sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A==" }, + "@bahmutov/data-driven": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@bahmutov/data-driven/-/data-driven-1.0.0.tgz", + "integrity": "sha512-YqW3hPS0RXriqjcCrLOTJj+LWe3c8JpwlL83k1ka1Q8U05ZjAKbGQZYeTzUd0NFEnnfPtsUiKGpFEBJG6kFuvg==", + "dev": true, + "requires": { + "check-more-types": "2.24.0", + "lazy-ass": "1.6.0" + } + }, "@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -11400,6 +11823,12 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "check-more-types": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", + "dev": true + }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -11416,6 +11845,12 @@ "readdirp": "~3.6.0" } }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -11542,6 +11977,12 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" }, + "common-tags": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", + "integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==", + "dev": true + }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -11709,6 +12150,24 @@ "path-type": "^4.0.0" } }, + "disparity": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/disparity/-/disparity-3.0.0.tgz", + "integrity": "sha512-n94Rzbv2ambRaFzrnBf34IEiyOdIci7maRpMkoQWB6xFYGA7Nbs0Z5YQzMfTeyQeelv23nayqOcssBoc6rKrgw==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "diff": "^4.0.1" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -11802,6 +12261,23 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, + "escape-quotes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-quotes/-/escape-quotes-1.0.2.tgz", + "integrity": "sha512-JpLFzklNReeakCpyj59s78P5F72q0ZUpDnp2BuIk9TtTjj2HMsgiWBChw17BlZT8dRhMtmSb1jE2+pTP1iFYyw==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + } + } + }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -12485,6 +12961,12 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, + "folktale": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/folktale/-/folktale-2.3.2.tgz", + "integrity": "sha512-+8GbtQBwEqutP0v3uajDDoN64K2ehmHd0cjlghhxh0WpcfPzAIjPA03e1VvHlxL02FVGR0A6lwXsNQKn3H1RNQ==", + "dev": true + }, "follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -12915,11 +13397,34 @@ "function-bind": "^1.1.1" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + } + } + }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "has-only": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/has-only/-/has-only-1.1.1.tgz", + "integrity": "sha512-3GuFy9rDw0xvovCHb4SOKiRImbZ+a8boFBUyGNRPVd2mRyQOzYdau5G9nodUXC1ZKYN59hrHFkW1lgBQscYfTg==", + "dev": true + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -13170,6 +13675,15 @@ "binary-extensions": "^2.0.0" } }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, "is-core-module": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", @@ -13275,6 +13789,12 @@ "istanbul-lib-report": "^3.0.0" } }, + "its-name": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/its-name/-/its-name-1.0.0.tgz", + "integrity": "sha512-GYUWFxViqxDvGzsNEItTEuOqqAQVx29Xl9Lh5YUqyJd6gPHTCMiIbjqcjjyUzsBUqEcgwIdRoydwgfFw1oYbhg==", + "dev": true + }, "jmespath": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", @@ -13344,6 +13864,12 @@ } } }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, "json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -13510,6 +14036,12 @@ "graceful-fs": "^4.1.9" } }, + "lazy-ass": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", + "dev": true + }, "leven": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", @@ -14170,6 +14702,12 @@ "path-key": "^3.0.0" } }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true + }, "object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", @@ -14532,6 +15070,12 @@ } } }, + "pluralize": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", + "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "dev": true + }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -14910,6 +15454,18 @@ "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, + "quote": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/quote/-/quote-0.4.0.tgz", + "integrity": "sha512-KHp3y3xDjuBhRx+tYKOgzPnVHMRlgpn2rU450GcU4PL24r1H6ls/hfPrxDwX2pvYMlwODHI2l8WwgoV69x5rUQ==", + "dev": true + }, + "ramda": { + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz", + "integrity": "sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==", + "dev": true + }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -15413,6 +15969,127 @@ "is-fullwidth-code-point": "^3.0.0" } }, + "snap-shot-compare": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/snap-shot-compare/-/snap-shot-compare-3.0.0.tgz", + "integrity": "sha512-bdwNOAGuKwPU+qsn0ASxTv+QfkXU+3VmkcDOkt965tes+JQQc8d6SfoLiEiRVhCey4v+ip2IjNUSbZm5nnkI9g==", + "dev": true, + "requires": { + "check-more-types": "2.24.0", + "debug": "4.1.1", + "disparity": "3.0.0", + "folktale": "2.3.2", + "lazy-ass": "1.6.0", + "strip-ansi": "5.2.0", + "variable-diff": "1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "snap-shot-core": { + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/snap-shot-core/-/snap-shot-core-10.2.4.tgz", + "integrity": "sha512-A7tkcfmvnRKge4VzFLAWA4UYMkvFY4TZKyL+D6hnHjI3HJ4pTepjG5DfR2ACeDKMzCSTQ5EwR2iOotI+Z37zsg==", + "dev": true, + "requires": { + "arg": "4.1.3", + "check-more-types": "2.24.0", + "common-tags": "1.8.0", + "debug": "4.3.1", + "escape-quotes": "1.0.2", + "folktale": "2.3.2", + "is-ci": "2.0.0", + "jsesc": "2.5.2", + "lazy-ass": "1.6.0", + "mkdirp": "1.0.4", + "pluralize": "8.0.0", + "quote": "0.4.0", + "ramda": "0.27.1" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "snap-shot-it": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/snap-shot-it/-/snap-shot-it-7.9.6.tgz", + "integrity": "sha512-t/ADZfQ8EUk4J76S5cmynye7qg1ecUFqQfANiOMNy0sFmYUaqfx9K/AWwpdcpr3vFsDptM+zSuTtKD0A1EOLqA==", + "dev": true, + "requires": { + "@bahmutov/data-driven": "1.0.0", + "check-more-types": "2.24.0", + "common-tags": "1.8.0", + "debug": "4.3.1", + "has-only": "1.1.1", + "its-name": "1.0.0", + "lazy-ass": "1.6.0", + "pluralize": "8.0.0", + "ramda": "0.27.1", + "snap-shot-compare": "3.0.0", + "snap-shot-core": "10.2.4" + }, + "dependencies": { + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "sonic-boom": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.2.0.tgz", @@ -15944,6 +16621,64 @@ "spdx-expression-parse": "^3.0.0" } }, + "variable-diff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/variable-diff/-/variable-diff-1.1.0.tgz", + "integrity": "sha512-0Jk/MsCNtL/fCuVIbsLxwXpABGZCzN57btcPbSsjOOAwkdHJ3Y58fo8BoUfG7jghnvglbwo+5Hk1KOJ2W2Ormw==", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "object-assign": "^4.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true + } + } + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/packages/owl-bot/package.json b/packages/owl-bot/package.json index 699c397ddf2..2517bb2892c 100644 --- a/packages/owl-bot/package.json +++ b/packages/owl-bot/package.json @@ -18,7 +18,7 @@ "compile": "tsc -p .", "fix": "gts fix", "lint": "gts check", - "mocha": "c8 mocha build/test", + "mocha": "npm run compile && c8 mocha build/test", "test": "c8 mocha build/test && node ./build/src/bin/owl-bot.js --help", "system-test": "c8 mocha build/system-test", "pretest": "npm run compile", @@ -61,6 +61,7 @@ "nock": "^13.2.9", "rimraf": "^3.0.2", "sinon": "^14.0.0", + "snap-shot-it": "^7.9.6", "ts-node": "^10.9.1", "typescript": "~4.8.3", "uuid": "^9.0.0" diff --git a/packages/owl-bot/src/copy-code.ts b/packages/owl-bot/src/copy-code.ts index 713dc8c17c1..b3a6375ba92 100644 --- a/packages/owl-bot/src/copy-code.ts +++ b/packages/owl-bot/src/copy-code.ts @@ -29,12 +29,11 @@ import {OWL_BOT_COPY} from './core'; import {newCmd} from './cmd'; import { createPullRequestFromLastCommit, - EMPTY_REGENERATE_CHECKBOX_TEXT, Force, - REGENERATE_CHECKBOX_TEXT, resplit, WithRegenerateCheckbox, insertApiName, + prependCommitMessage, } from './create-pr'; import {GithubRepo, githubRepoFromOwnerSlashName} from './github-repo'; import {CopyStateStore} from './copy-state-store'; @@ -372,13 +371,9 @@ async function findAndAppendPullRequest( }) .toString('utf8') .trim(); - const {title, body} = resplit( - `${commitBody}\n\n` + - `${pull.title}\n` + - pull.body - ?.replace(REGENERATE_CHECKBOX_TEXT, '') - .replace(EMPTY_REGENERATE_CHECKBOX_TEXT, '') - .trim() ?? '', + const {title, body} = prependCommitMessage( + commitBody, + {title: pull.title, body: pull.body || ''}, WithRegenerateCheckbox.Yes ); const apiNames = copiedYamls.map(tag => tag.yaml['api-name']).filter(Boolean); diff --git a/packages/owl-bot/src/create-pr.ts b/packages/owl-bot/src/create-pr.ts index 4600435d8e5..2b40b41693b 100644 --- a/packages/owl-bot/src/create-pr.ts +++ b/packages/owl-bot/src/create-pr.ts @@ -27,6 +27,11 @@ export const EMPTY_REGENERATE_CHECKBOX_TEXT = REGENERATE_CHECKBOX_TEXT.replace( '[ ]' ); +interface PullRequestContent { + title: string; + body: string; +} + /*** * Github will reject the pull request if the title is longer than 255 * characters. This function will move characters from the title to the body @@ -37,7 +42,7 @@ export const EMPTY_REGENERATE_CHECKBOX_TEXT = REGENERATE_CHECKBOX_TEXT.replace( export function resplit( rawBody: string, withRegenerateCheckbox: WithRegenerateCheckbox -): {title: string; body: string} { +): PullRequestContent { const regexp = /([^\r\n]*)([\r\n]*)((.|\r|\n)*)/; const match = regexp.exec(rawBody)!; let title = match[1]; @@ -53,6 +58,56 @@ export function resplit( return {title, body: body.substring(0, MAX_BODY_LENGTH)}; } +const NESTED_COMMIT_SEPARATOR = 'BEGIN_NESTED_COMMIT'; + +/** + * Given pull request content and a new commit message. Rewrite the pull request + * title and body. If the initial pull request title was truncated with ellipses, + * rejoin the title to the remaining part. + * @param {string} newCommitMessage the new commit message + * @param {PullRequestContent} existingContent exisiting pull request title and body + * @param {WithRegenerateCheckbox} withRegenerateCheckbox whether to include the + * checkbox to regenerate the pull request + */ +export function prependCommitMessage( + newCommitMessage: string, + existingContent: PullRequestContent, + withRegenerateCheckbox: WithRegenerateCheckbox +): PullRequestContent { + // remove any regenerate checkbox content and leading/trailing whitespace + const oldStrippedBody = existingContent.body + .replace(EMPTY_REGENERATE_CHECKBOX_TEXT, '') + .replace(REGENERATE_CHECKBOX_TEXT, '') + .trim(); + // if title was truncated, re-add it to the beginning of the commit message + const oldBody = existingContent.title.endsWith('...') + ? `${existingContent.title.substring( + 0, + existingContent.title.length - 3 + )}${oldStrippedBody}` + : `${existingContent.title}\n${oldStrippedBody}`; + // anything before the first BEGIN_NESTED_COMMIT marker, is considered part of + // the previous commit + const bodyParts = oldBody.split(NESTED_COMMIT_SEPARATOR); + const oldBodyWithNestedCommitMarkers = + bodyParts.length === 1 + ? // there is a single commit -- wrap the old body in the nested commit tags + `${NESTED_COMMIT_SEPARATOR}\n${oldBody}\nEND_NESTED_COMMIT\n` + : // there are already existing nested commit tags, content before the first + // one is wrapped in a new nested commit tag + `${NESTED_COMMIT_SEPARATOR}\n${ + bodyParts[0] + }\nEND_NESTED_COMMIT\n${bodyParts + .slice(1) + .join(NESTED_COMMIT_SEPARATOR)}`; + + // prepend the new commit message and use original title truncation logic + return resplit( + `${newCommitMessage}\n\n${oldBodyWithNestedCommitMarkers}`, + withRegenerateCheckbox + ); +} + // Exported for testing only. /** * Inserts an API name into a pr title after the first colon. diff --git a/packages/owl-bot/test/create-pr.ts b/packages/owl-bot/test/create-pr.ts index d0363e16f37..a71808b4496 100644 --- a/packages/owl-bot/test/create-pr.ts +++ b/packages/owl-bot/test/create-pr.ts @@ -21,7 +21,12 @@ import { MAX_TITLE_LENGTH, resplit, WithRegenerateCheckbox, + prependCommitMessage, } from '../src/create-pr'; +import snapshot = require('snap-shot-it'); + +const loremIpsum = + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; describe('resplit', () => { it('leaves a short title unchanged', () => { @@ -37,9 +42,6 @@ describe('resplit', () => { }); }); - const loremIpsum = - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; - it('resplits a long title', () => { const tb = resplit(loremIpsum + '\n\nbody', WithRegenerateCheckbox.No); assert.strictEqual(tb.title.length, MAX_TITLE_LENGTH); @@ -97,6 +99,40 @@ describe('resplit', () => { }); }); +describe('prependCommitMessage', () => { + for (const withCheckbox of [ + WithRegenerateCheckbox.Yes, + WithRegenerateCheckbox.No, + ]) { + describe(`with checkbox: ${withCheckbox}`, () => { + it('handles an initial pull request content', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + withCheckbox + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + withCheckbox + ); + snapshot(prependedContent.title); + snapshot(prependedContent.body); + }); + + it('handles an initial pull request with long title', () => { + const pullContent = resplit(loremIpsum, withCheckbox); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + withCheckbox + ); + snapshot(prependedContent.title); + snapshot(prependedContent.body); + }); + }); + } +}); + describe('insertApiName', () => { it('does nothing when the api name is empty', () => { const title = 'chore(bazel): Update gapic-generator-php to v1.2.1'; From f498bbba792dcd72db35882ca52d17ecfdef34c9 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 22 Sep 2022 13:12:51 -0700 Subject: [PATCH 3/7] refactor: make NESTED_COMMIT opt-in --- packages/owl-bot/__snapshots__/create-pr.js | 102 ++++++++++-------- packages/owl-bot/src/create-pr.ts | 71 ++++++++---- packages/owl-bot/test/create-pr.ts | 56 +++++----- ...googleapis-gen-and-create-pull-requests.ts | 2 +- 4 files changed, 141 insertions(+), 90 deletions(-) diff --git a/packages/owl-bot/__snapshots__/create-pr.js b/packages/owl-bot/__snapshots__/create-pr.js index 675b7509f4c..90af90b176a 100644 --- a/packages/owl-bot/__snapshots__/create-pr.js +++ b/packages/owl-bot/__snapshots__/create-pr.js @@ -1,73 +1,91 @@ -exports[ - 'prependCommitMessage with checkbox: yes handles an initial pull request content 1' -] = ` +exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 1'] = ` fix: some new feature -`; +` -exports[ - 'prependCommitMessage with checkbox: yes handles an initial pull request content 2' -] = ` +exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 2'] = ` - [ ] Regenerate this pull request now. more additional context -BEGIN_NESTED_COMMIT feat: some feature additional context -END_NESTED_COMMIT +` -`; - -exports[ - 'prependCommitMessage with checkbox: yes handles an initial pull request with long title 1' -] = ` +exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 1'] = ` fix: some new feature -`; +` -exports[ - 'prependCommitMessage with checkbox: yes handles an initial pull request with long title 2' -] = ` +exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 2'] = ` - [ ] Regenerate this pull request now. more additional context -BEGIN_NESTED_COMMIT Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -END_NESTED_COMMIT - -`; +` -exports[ - 'prependCommitMessage with checkbox: no handles an initial pull request content 1' -] = ` +exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 1'] = ` fix: some new feature -`; +` + +exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 2'] = ` +- [ ] Regenerate this pull request now. -exports[ - 'prependCommitMessage with checkbox: no handles an initial pull request content 2' -] = ` more additional context -BEGIN_NESTED_COMMIT feat: some feature additional context -END_NESTED_COMMIT +` + +exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 1'] = ` +fix: some new feature +` + +exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 2'] = ` +- [ ] Regenerate this pull request now. + +more additional context + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +` + +exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 1'] = ` +fix: some new feature +` + +exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 2'] = ` +more additional context -`; +feat: some feature +additional context +` -exports[ - 'prependCommitMessage with checkbox: no handles an initial pull request with long title 1' -] = ` +exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 1'] = ` fix: some new feature -`; +` -exports[ - 'prependCommitMessage with checkbox: no handles an initial pull request with long title 2' -] = ` +exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 2'] = ` more additional context -BEGIN_NESTED_COMMIT Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -END_NESTED_COMMIT +` + +exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 1'] = ` +fix: some new feature +` + +exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 2'] = ` +more additional context -`; +feat: some feature +additional context +` + +exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 1'] = ` +fix: some new feature +` + +exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 2'] = ` +more additional context + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +` diff --git a/packages/owl-bot/src/create-pr.ts b/packages/owl-bot/src/create-pr.ts index 2b40b41693b..83ae79b2837 100644 --- a/packages/owl-bot/src/create-pr.ts +++ b/packages/owl-bot/src/create-pr.ts @@ -62,8 +62,18 @@ const NESTED_COMMIT_SEPARATOR = 'BEGIN_NESTED_COMMIT'; /** * Given pull request content and a new commit message. Rewrite the pull request - * title and body. If the initial pull request title was truncated with ellipses, - * rejoin the title to the remaining part. + * title and body using the newest message as the title. If the initial pull + * request title was truncated with ellipses, rejoin the title to the remaining part. + * + * For example, if the existing pull request is something like: + * Title: `feat: original feature` + * Body: `Copy-Tag: 1234` + * + * and we prepend a new message of `feat: another new feature\nCopy-Tag: 2345`, the + * output will be: + * Title: `feat: another new feature` + * Body: `Copy-Tag: 2345\nBEGIN_NESTED_COMMIT\nfeat: original feature\nCopy-Tag:1234\nEND_NESTED_COMMIT` + * * @param {string} newCommitMessage the new commit message * @param {PullRequestContent} existingContent exisiting pull request title and body * @param {WithRegenerateCheckbox} withRegenerateCheckbox whether to include the @@ -72,7 +82,8 @@ const NESTED_COMMIT_SEPARATOR = 'BEGIN_NESTED_COMMIT'; export function prependCommitMessage( newCommitMessage: string, existingContent: PullRequestContent, - withRegenerateCheckbox: WithRegenerateCheckbox + withRegenerateCheckbox: WithRegenerateCheckbox, + withNestedCommitDelimiters: WithNestedCommitDelimiters = WithNestedCommitDelimiters.No ): PullRequestContent { // remove any regenerate checkbox content and leading/trailing whitespace const oldStrippedBody = existingContent.body @@ -86,26 +97,29 @@ export function prependCommitMessage( existingContent.title.length - 3 )}${oldStrippedBody}` : `${existingContent.title}\n${oldStrippedBody}`; - // anything before the first BEGIN_NESTED_COMMIT marker, is considered part of - // the previous commit - const bodyParts = oldBody.split(NESTED_COMMIT_SEPARATOR); - const oldBodyWithNestedCommitMarkers = - bodyParts.length === 1 - ? // there is a single commit -- wrap the old body in the nested commit tags - `${NESTED_COMMIT_SEPARATOR}\n${oldBody}\nEND_NESTED_COMMIT\n` - : // there are already existing nested commit tags, content before the first - // one is wrapped in a new nested commit tag - `${NESTED_COMMIT_SEPARATOR}\n${ - bodyParts[0] - }\nEND_NESTED_COMMIT\n${bodyParts - .slice(1) - .join(NESTED_COMMIT_SEPARATOR)}`; - - // prepend the new commit message and use original title truncation logic - return resplit( - `${newCommitMessage}\n\n${oldBodyWithNestedCommitMarkers}`, - withRegenerateCheckbox - ); + if (withNestedCommitDelimiters === WithNestedCommitDelimiters.Yes) { + // anything before the first BEGIN_NESTED_COMMIT marker, is considered part of + // the previous commit + const bodyParts = oldBody.split(NESTED_COMMIT_SEPARATOR); + const oldBodyWithNestedCommitMarkers = + bodyParts.length === 1 + ? // there is a single commit -- wrap the old body in the nested commit tags + `${NESTED_COMMIT_SEPARATOR}\n${oldBody}\nEND_NESTED_COMMIT\n` + : // there are already existing nested commit tags, content before the first + // one is wrapped in a new nested commit tag + `${NESTED_COMMIT_SEPARATOR}\n${ + bodyParts[0] + }\nEND_NESTED_COMMIT\n${bodyParts + .slice(1) + .join(NESTED_COMMIT_SEPARATOR)}`; + + // prepend the new commit message and use original title truncation logic + return resplit( + `${newCommitMessage}\n\n${oldBodyWithNestedCommitMarkers}`, + withRegenerateCheckbox + ); + } + return resplit(`${newCommitMessage}\n\n${oldBody}`, withRegenerateCheckbox); } // Exported for testing only. @@ -156,6 +170,17 @@ export enum WithRegenerateCheckbox { No = 'no', } +/** + * Should createPullRequestFromLastCommit() separate multiple commit message + * bodies with `BEGIN_NESTED_COMMIT`/`END_NESTED_COMMIT`? + * + * More type safe and readable than a boolean. + */ +export enum WithNestedCommitDelimiters { + Yes = 'yes', + No = 'no', +} + /** * Creates a pull request using the title and commit message from the most * recent commit. diff --git a/packages/owl-bot/test/create-pr.ts b/packages/owl-bot/test/create-pr.ts index a71808b4496..96c38a56e97 100644 --- a/packages/owl-bot/test/create-pr.ts +++ b/packages/owl-bot/test/create-pr.ts @@ -22,6 +22,7 @@ import { resplit, WithRegenerateCheckbox, prependCommitMessage, + WithNestedCommitDelimiters, } from '../src/create-pr'; import snapshot = require('snap-shot-it'); @@ -105,30 +106,37 @@ describe('prependCommitMessage', () => { WithRegenerateCheckbox.No, ]) { describe(`with checkbox: ${withCheckbox}`, () => { - it('handles an initial pull request content', () => { - const pullContent = resplit( - 'feat: some feature\n\nadditional context', - withCheckbox - ); - const prependedContent = prependCommitMessage( - 'fix: some new feature\n\nmore additional context', - pullContent, - withCheckbox - ); - snapshot(prependedContent.title); - snapshot(prependedContent.body); - }); - - it('handles an initial pull request with long title', () => { - const pullContent = resplit(loremIpsum, withCheckbox); - const prependedContent = prependCommitMessage( - 'fix: some new feature\n\nmore additional context', - pullContent, - withCheckbox - ); - snapshot(prependedContent.title); - snapshot(prependedContent.body); - }); + for (const withNested of [ + WithNestedCommitDelimiters.Yes, + WithNestedCommitDelimiters.No, + ]) { + describe(`with nested: ${withNested}`, () => { + it('handles an initial pull request content', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + withCheckbox + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + withCheckbox + ); + snapshot(prependedContent.title); + snapshot(prependedContent.body); + }); + + it('handles an initial pull request with long title', () => { + const pullContent = resplit(loremIpsum, withCheckbox); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + withCheckbox + ); + snapshot(prependedContent.title); + snapshot(prependedContent.body); + }); + }); + } }); } }); diff --git a/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts b/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts index 729cf68be4e..fa1625d7fd0 100644 --- a/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts +++ b/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts @@ -355,7 +355,7 @@ Copy-Tag: ${copyTag}` body: '- [ ] Regenerate this pull request now.\n\n' + `Source-Link: https://github.com/googleapis/googleapis-gen/commit/${abcCommits[1]}\n` + - `Copy-Tag: ${copyTag}\n\nBEGIN_NESTED_COMMIT\nq\nThis is the greatest pull request ever.\nEND_NESTED_COMMIT\n`, + `Copy-Tag: ${copyTag}\n\nq\nThis is the greatest pull request ever.`, title: 'b', }, ]); From 176ce8e64d9957ace19e020e1ab4e30d6da711ae Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 22 Sep 2022 13:30:12 -0700 Subject: [PATCH 4/7] chore: fix lint --- packages/owl-bot/__snapshots__/create-pr.js | 96 ++++++++++++++------- packages/owl-bot/test/create-pr.ts | 2 +- 2 files changed, 65 insertions(+), 33 deletions(-) diff --git a/packages/owl-bot/__snapshots__/create-pr.js b/packages/owl-bot/__snapshots__/create-pr.js index 90af90b176a..987e07cc0f8 100644 --- a/packages/owl-bot/__snapshots__/create-pr.js +++ b/packages/owl-bot/__snapshots__/create-pr.js @@ -1,91 +1,123 @@ -exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 1'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 2'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 2' +] = ` - [ ] Regenerate this pull request now. more additional context feat: some feature additional context -` +`; -exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 1'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 2'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 2' +] = ` - [ ] Regenerate this pull request now. more additional context Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -` +`; -exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 1'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 2'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 2' +] = ` - [ ] Regenerate this pull request now. more additional context feat: some feature additional context -` +`; -exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 1'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 2'] = ` +exports[ + 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 2' +] = ` - [ ] Regenerate this pull request now. more additional context Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -` +`; -exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 1'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 2'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 2' +] = ` more additional context feat: some feature additional context -` +`; -exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 1'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 2'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 2' +] = ` more additional context Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -` +`; -exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 1'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 2'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 2' +] = ` more additional context feat: some feature additional context -` +`; -exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 1'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 1' +] = ` fix: some new feature -` +`; -exports['prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 2'] = ` +exports[ + 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 2' +] = ` more additional context Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -` +`; diff --git a/packages/owl-bot/test/create-pr.ts b/packages/owl-bot/test/create-pr.ts index 96c38a56e97..01f13e8ff6b 100644 --- a/packages/owl-bot/test/create-pr.ts +++ b/packages/owl-bot/test/create-pr.ts @@ -124,7 +124,7 @@ describe('prependCommitMessage', () => { snapshot(prependedContent.title); snapshot(prependedContent.body); }); - + it('handles an initial pull request with long title', () => { const pullContent = resplit(loremIpsum, withCheckbox); const prependedContent = prependCommitMessage( From ed69624c1bb1560e68bc388fb28b27790f2855fc Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 22 Sep 2022 15:56:41 -0700 Subject: [PATCH 5/7] feat: add --use-nested-commit-delimiters CLI argument for the copy code command --- .../copy-code-and-create-pull-request.ts | 20 ++++- packages/owl-bot/src/copy-code.ts | 28 +++++-- ...googleapis-gen-and-create-pull-requests.ts | 11 ++- ...googleapis-gen-and-create-pull-requests.ts | 77 ++++++++++++++++++- 4 files changed, 125 insertions(+), 11 deletions(-) diff --git a/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts b/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts index 8ee6cb18b0c..73a3b88e2bf 100644 --- a/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts +++ b/packages/owl-bot/src/bin/commands/copy-code-and-create-pull-request.ts @@ -19,12 +19,14 @@ import * as cc from '../../copy-code'; import {octokitFactoryFrom, OctokitParams} from '../../octokit-util'; import {githubRepoFromOwnerSlashName} from '../../github-repo'; import {FakeCopyStateStore} from '../../fake-copy-state-store'; +import {WithNestedCommitDelimiters} from '../../create-pr'; interface Args extends OctokitParams { 'source-repo': string; 'source-repo-commit-hash': string; 'dest-repo': string; 'dest-owlbot-yaml': string; + 'use-nested-commit-delimiters': boolean; } export const copyCodeAndCreatePullRequestCommand: yargs.CommandModule< @@ -74,6 +76,13 @@ export const copyCodeAndCreatePullRequestCommand: yargs.CommandModule< type: 'string', default: '.github/.OwlBot.yaml', demand: false, + }) + .option('use-nested-commit-delimiters', { + describe: + 'Whether to use BEGIN_NESTED_COMMIT delimiters when separating multiple commit messages', + type: 'boolean', + default: false, + demand: false, }); }, async handler(argv) { @@ -87,8 +96,13 @@ export const copyCodeAndCreatePullRequestCommand: yargs.CommandModule< copyStateStore: new FakeCopyStateStore(), octokitFactory, }; - await cc.copyCodeAndAppendOrCreatePullRequest(params, [ - argv['dest-owlbot-yaml'], - ]); + await cc.copyCodeAndAppendOrCreatePullRequest( + params, + [argv['dest-owlbot-yaml']], + undefined, + argv['use-nested-commit-delimiters'] + ? WithNestedCommitDelimiters.Yes + : WithNestedCommitDelimiters.No + ); }, }; diff --git a/packages/owl-bot/src/copy-code.ts b/packages/owl-bot/src/copy-code.ts index b3a6375ba92..0cb949e24d4 100644 --- a/packages/owl-bot/src/copy-code.ts +++ b/packages/owl-bot/src/copy-code.ts @@ -34,6 +34,7 @@ import { WithRegenerateCheckbox, insertApiName, prependCommitMessage, + WithNestedCommitDelimiters, } from './create-pr'; import {GithubRepo, githubRepoFromOwnerSlashName} from './github-repo'; import {CopyStateStore} from './copy-state-store'; @@ -279,7 +280,8 @@ export function branchNameForCopies(yamlPaths: string[]): string { async function findAndAppendPullRequest( params: WorkingCopyParams, yamlPaths: string[], - logger: Logger = console + logger: Logger = console, + withNestedCommitDelimiters: WithNestedCommitDelimiters = WithNestedCommitDelimiters.No ): Promise { const cmd = newCmd(logger); const octokit = await params.octokitFactory.getShortLivedOctokit(); @@ -374,7 +376,8 @@ async function findAndAppendPullRequest( const {title, body} = prependCommitMessage( commitBody, {title: pull.title, body: pull.body || ''}, - WithRegenerateCheckbox.Yes + WithRegenerateCheckbox.Yes, + withNestedCommitDelimiters ); const apiNames = copiedYamls.map(tag => tag.yaml['api-name']).filter(Boolean); const apiList = abbreviateApiListForTitle(apiNames as string[]); @@ -417,7 +420,8 @@ interface WorkingCopyParams extends CopyParams { export async function copyCodeAndAppendOrCreatePullRequest( params: CopyParams, yamlPaths: string[], - logger: Logger = console + logger: Logger = console, + withNestedCommitDelimiters: WithNestedCommitDelimiters = WithNestedCommitDelimiters.No ): Promise { const workDir = tmp.dirSync().name; logger.info(`Working in ${workDir}`); @@ -444,7 +448,14 @@ export async function copyCodeAndAppendOrCreatePullRequest( const leftOvers: string[] = []; const wparams: WorkingCopyParams = {...params, destDir, workDir}; for (const yamlPath of yamlPaths) { - if (!(await findAndAppendPullRequest(wparams, [yamlPath], logger))) { + if ( + !(await findAndAppendPullRequest( + wparams, + [yamlPath], + logger, + withNestedCommitDelimiters + )) + ) { leftOvers.push(yamlPath); } } @@ -454,7 +465,14 @@ export async function copyCodeAndAppendOrCreatePullRequest( if (isDeepStrictEqual(yamlPaths, leftOvers)) { // Don't repeat exactly the same search } else { - if (await findAndAppendPullRequest(wparams, leftOvers, logger)) { + if ( + await findAndAppendPullRequest( + wparams, + leftOvers, + logger, + withNestedCommitDelimiters + ) + ) { return; // Appended a pull request for all the left-over APIs. Done. } } diff --git a/packages/owl-bot/src/scan-googleapis-gen-and-create-pull-requests.ts b/packages/owl-bot/src/scan-googleapis-gen-and-create-pull-requests.ts index 880a884a738..9ea85ad66b8 100644 --- a/packages/owl-bot/src/scan-googleapis-gen-and-create-pull-requests.ts +++ b/packages/owl-bot/src/scan-googleapis-gen-and-create-pull-requests.ts @@ -27,6 +27,7 @@ import {newCmd} from './cmd'; import {CopyStateStore} from './copy-state-store'; import {GithubRepo} from './github-repo'; import {Logger, LoggerWithTimestamp} from './logger'; +import {WithNestedCommitDelimiters} from './create-pr'; interface Todo { repo: GithubRepo; @@ -79,7 +80,8 @@ export async function scanGoogleapisGenAndCreatePullRequests( cloneDepth = 100, copyStateStore: CopyStateStore, combinePullsThreshold = Number.MAX_SAFE_INTEGER, - logger: Logger = console + logger: Logger = console, + withNestedCommitDelimiters: WithNestedCommitDelimiters = WithNestedCommitDelimiters.No ): Promise { logger = new LoggerWithTimestamp(logger); // Clone the source repo. @@ -184,7 +186,12 @@ export async function scanGoogleapisGenAndCreatePullRequests( copyStateStore, octokitFactory, }; - await copyCodeAndAppendOrCreatePullRequest(params, todo.yamlPaths, logger); + await copyCodeAndAppendOrCreatePullRequest( + params, + todo.yamlPaths, + logger, + withNestedCommitDelimiters + ); } return todoStack.length; } diff --git a/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts b/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts index fa1625d7fd0..b385ab73ba9 100644 --- a/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts +++ b/packages/owl-bot/test/scan-googleapis-gen-and-create-pull-requests.ts @@ -34,7 +34,10 @@ import { } from './fake-octokit'; import tmp from 'tmp'; import {copyTagFrom} from '../src/copy-code'; -import {EMPTY_REGENERATE_CHECKBOX_TEXT} from '../src/create-pr'; +import { + EMPTY_REGENERATE_CHECKBOX_TEXT, + WithNestedCommitDelimiters, +} from '../src/create-pr'; import {FakeCopyStateStore} from '../src/fake-copy-state-store'; // Use anys to mock parts of the octokit API. @@ -384,6 +387,78 @@ Copy-Tag: ${copyTag}` assert.strictEqual(prCount, 0); }); + it('copies files and appends a pull request with nested commit tags', async () => { + const [destRepo, configsStore] = makeDestRepoAndConfigsStore(bYaml); + + // Create a branch in the dest dir for the existing pull request. + const destDir = destRepo.getCloneUrl(); + cmd('git branch owl-bot-copy', {cwd: destDir}); + + // Create an existing pull request to be appended. + const pullBody = 'This is the greatest pull request ever.'; + const pulls = new FakePulls(); + pulls.create({ + owner: 'googleapis', + repo: 'nodejs-spell-check', + title: 'q', + body: pullBody, + head: 'owl-bot-copy', + }); + + const issues = new FakeIssues(); + const octokit = newFakeOctokit(pulls, issues); + const copyStateStore = new FakeCopyStateStore(); + await scanGoogleapisGenAndCreatePullRequests( + abcRepo, + factory(octokit), + configsStore, + undefined, + copyStateStore + ); + + // Confirm it updated the body. + const copyTag = cc.copyTagFrom('.github/.OwlBot.yaml', abcCommits[1]); + assert.strictEqual(pulls.updates.length, 1); + assert.deepStrictEqual(pulls.updates, [ + { + owner: 'googleapis', + repo: 'nodejs-spell-check', + pull_number: 1, + body: + '- [ ] Regenerate this pull request now.\n\n' + + `Source-Link: https://github.com/googleapis/googleapis-gen/commit/${abcCommits[1]}\n` + + `Copy-Tag: ${copyTag}\n\nq\nThis is the greatest pull request ever.`, + title: 'b', + }, + ]); + + // Confirm the pull request branch contains the new file. + cmd(`git checkout ${pulls.pulls[0].head}`, {cwd: destDir}); + const bpath = path.join(destDir, 'src', 'b.txt'); + assert.strictEqual(fs.readFileSync(bpath).toString('utf8'), '2'); + + // But of course the main branch doesn't have it until the PR is merged. + cmd('git checkout main', {cwd: destDir}); + assert.ok(!cc.stat(bpath)); + + // Confirm the PR was recorded in firestore. + assert.ok(await copyStateStore.findBuildForCopy(destRepo, copyTag)); + + // Because the PR is recorded in firestore, a second call should skip + // creating a new one. + const prCount = await scanGoogleapisGenAndCreatePullRequests( + abcRepo, + factory(octokit), + configsStore, + undefined, + copyStateStore, + undefined, + undefined, + WithNestedCommitDelimiters.Yes + ); + assert.strictEqual(prCount, 0); + }); + it('reports error for corrupt yaml in new pull request', async () => { const [destRepo, configsStore] = makeDestRepoAndConfigsStore(bYaml); From 409aaad2b10ee68b4a1843b8adcedd2ab8891a07 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 26 Sep 2022 12:20:24 -0700 Subject: [PATCH 6/7] test: use explicit assertions --- packages/owl-bot/__snapshots__/create-pr.js | 123 ---- packages/owl-bot/package-lock.json | 735 -------------------- packages/owl-bot/package.json | 1 - packages/owl-bot/src/create-pr.ts | 8 +- packages/owl-bot/test/create-pr.ts | 281 +++++++- 5 files changed, 248 insertions(+), 900 deletions(-) delete mode 100644 packages/owl-bot/__snapshots__/create-pr.js diff --git a/packages/owl-bot/__snapshots__/create-pr.js b/packages/owl-bot/__snapshots__/create-pr.js deleted file mode 100644 index 987e07cc0f8..00000000000 --- a/packages/owl-bot/__snapshots__/create-pr.js +++ /dev/null @@ -1,123 +0,0 @@ -exports[ - 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request content 2' -] = ` -- [ ] Regenerate this pull request now. - -more additional context - -feat: some feature -additional context -`; - -exports[ - 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: yes with nested: yes handles an initial pull request with long title 2' -] = ` -- [ ] Regenerate this pull request now. - -more additional context - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -`; - -exports[ - 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request content 2' -] = ` -- [ ] Regenerate this pull request now. - -more additional context - -feat: some feature -additional context -`; - -exports[ - 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: yes with nested: no handles an initial pull request with long title 2' -] = ` -- [ ] Regenerate this pull request now. - -more additional context - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request content 2' -] = ` -more additional context - -feat: some feature -additional context -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: yes handles an initial pull request with long title 2' -] = ` -more additional context - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request content 2' -] = ` -more additional context - -feat: some feature -additional context -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 1' -] = ` -fix: some new feature -`; - -exports[ - 'prependCommitMessage with checkbox: no with nested: no handles an initial pull request with long title 2' -] = ` -more additional context - -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -`; diff --git a/packages/owl-bot/package-lock.json b/packages/owl-bot/package-lock.json index ebea35df246..bbdf4c07403 100644 --- a/packages/owl-bot/package-lock.json +++ b/packages/owl-bot/package-lock.json @@ -54,7 +54,6 @@ "nock": "^13.2.9", "rimraf": "^3.0.2", "sinon": "^14.0.0", - "snap-shot-it": "^7.9.6", "ts-node": "^10.9.1", "typescript": "~4.8.3", "uuid": "^9.0.0" @@ -180,19 +179,6 @@ "node": ">=6.0.0" } }, - "node_modules/@bahmutov/data-driven": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@bahmutov/data-driven/-/data-driven-1.0.0.tgz", - "integrity": "sha512-YqW3hPS0RXriqjcCrLOTJj+LWe3c8JpwlL83k1ka1Q8U05ZjAKbGQZYeTzUd0NFEnnfPtsUiKGpFEBJG6kFuvg==", - "dev": true, - "dependencies": { - "check-more-types": "2.24.0", - "lazy-ass": "1.6.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -2928,15 +2914,6 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "node_modules/check-more-types": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", - "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -2964,12 +2941,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3130,15 +3101,6 @@ "node": ">= 6" } }, - "node_modules/common-tags": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", - "integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -3351,31 +3313,6 @@ "node": ">=8" } }, - "node_modules/disparity": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/disparity/-/disparity-3.0.0.tgz", - "integrity": "sha512-n94Rzbv2ambRaFzrnBf34IEiyOdIci7maRpMkoQWB6xFYGA7Nbs0Z5YQzMfTeyQeelv23nayqOcssBoc6rKrgw==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "diff": "^4.0.1" - }, - "bin": { - "disparity": "bin/disparity" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/disparity/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -3487,24 +3424,6 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, - "node_modules/escape-quotes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/escape-quotes/-/escape-quotes-1.0.2.tgz", - "integrity": "sha512-JpLFzklNReeakCpyj59s78P5F72q0ZUpDnp2BuIk9TtTjj2HMsgiWBChw17BlZT8dRhMtmSb1jE2+pTP1iFYyw==", - "dev": true, - "dependencies": { - "escape-string-regexp": "^1.0.5" - } - }, - "node_modules/escape-quotes/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -4408,12 +4327,6 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, - "node_modules/folktale": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/folktale/-/folktale-2.3.2.tgz", - "integrity": "sha512-+8GbtQBwEqutP0v3uajDDoN64K2ehmHd0cjlghhxh0WpcfPzAIjPA03e1VvHlxL02FVGR0A6lwXsNQKn3H1RNQ==", - "dev": true - }, "node_modules/follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -5016,27 +4929,6 @@ "node": ">= 0.4.0" } }, - "node_modules/has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/has-ansi/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -5045,15 +4937,6 @@ "node": ">=8" } }, - "node_modules/has-only": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/has-only/-/has-only-1.1.1.tgz", - "integrity": "sha512-3GuFy9rDw0xvovCHb4SOKiRImbZ+a8boFBUyGNRPVd2mRyQOzYdau5G9nodUXC1ZKYN59hrHFkW1lgBQscYfTg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -5394,18 +5277,6 @@ "node": ">=8" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-core-module": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", @@ -5553,15 +5424,6 @@ "node": ">=8" } }, - "node_modules/its-name": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/its-name/-/its-name-1.0.0.tgz", - "integrity": "sha512-GYUWFxViqxDvGzsNEItTEuOqqAQVx29Xl9Lh5YUqyJd6gPHTCMiIbjqcjjyUzsBUqEcgwIdRoydwgfFw1oYbhg==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/jmespath": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", @@ -5653,18 +5515,6 @@ "node": ">=8" } }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -5856,15 +5706,6 @@ "graceful-fs": "^4.1.9" } }, - "node_modules/lazy-ass": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", - "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", - "dev": true, - "engines": { - "node": "> 0.8" - } - }, "node_modules/leven": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", @@ -6703,15 +6544,6 @@ "node": ">=8" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", @@ -7170,15 +7002,6 @@ "node": ">=4" } }, - "node_modules/pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -7650,18 +7473,6 @@ "node": ">=8" } }, - "node_modules/quote": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/quote/-/quote-0.4.0.tgz", - "integrity": "sha512-KHp3y3xDjuBhRx+tYKOgzPnVHMRlgpn2rU450GcU4PL24r1H6ls/hfPrxDwX2pvYMlwODHI2l8WwgoV69x5rUQ==", - "dev": true - }, - "node_modules/ramda": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz", - "integrity": "sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==", - "dev": true - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -8351,156 +8162,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/snap-shot-compare": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/snap-shot-compare/-/snap-shot-compare-3.0.0.tgz", - "integrity": "sha512-bdwNOAGuKwPU+qsn0ASxTv+QfkXU+3VmkcDOkt965tes+JQQc8d6SfoLiEiRVhCey4v+ip2IjNUSbZm5nnkI9g==", - "dev": true, - "dependencies": { - "check-more-types": "2.24.0", - "debug": "4.1.1", - "disparity": "3.0.0", - "folktale": "2.3.2", - "lazy-ass": "1.6.0", - "strip-ansi": "5.2.0", - "variable-diff": "1.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/snap-shot-compare/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/snap-shot-compare/node_modules/debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", - "dev": true, - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/snap-shot-compare/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/snap-shot-compare/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "dependencies": { - "ansi-regex": "^4.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/snap-shot-core": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/snap-shot-core/-/snap-shot-core-10.2.4.tgz", - "integrity": "sha512-A7tkcfmvnRKge4VzFLAWA4UYMkvFY4TZKyL+D6hnHjI3HJ4pTepjG5DfR2ACeDKMzCSTQ5EwR2iOotI+Z37zsg==", - "dev": true, - "dependencies": { - "arg": "4.1.3", - "check-more-types": "2.24.0", - "common-tags": "1.8.0", - "debug": "4.3.1", - "escape-quotes": "1.0.2", - "folktale": "2.3.2", - "is-ci": "2.0.0", - "jsesc": "2.5.2", - "lazy-ass": "1.6.0", - "mkdirp": "1.0.4", - "pluralize": "8.0.0", - "quote": "0.4.0", - "ramda": "0.27.1" - }, - "bin": { - "resave-snapshots": "bin/resave-snapshots.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/snap-shot-core/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/snap-shot-core/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/snap-shot-it": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/snap-shot-it/-/snap-shot-it-7.9.6.tgz", - "integrity": "sha512-t/ADZfQ8EUk4J76S5cmynye7qg1ecUFqQfANiOMNy0sFmYUaqfx9K/AWwpdcpr3vFsDptM+zSuTtKD0A1EOLqA==", - "dev": true, - "dependencies": { - "@bahmutov/data-driven": "1.0.0", - "check-more-types": "2.24.0", - "common-tags": "1.8.0", - "debug": "4.3.1", - "has-only": "1.1.1", - "its-name": "1.0.0", - "lazy-ass": "1.6.0", - "pluralize": "8.0.0", - "ramda": "0.27.1", - "snap-shot-compare": "3.0.0", - "snap-shot-core": "10.2.4" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/snap-shot-it/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/snap-shot-it/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/sonic-boom": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.2.0.tgz", @@ -9188,80 +8849,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "node_modules/variable-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/variable-diff/-/variable-diff-1.1.0.tgz", - "integrity": "sha512-0Jk/MsCNtL/fCuVIbsLxwXpABGZCzN57btcPbSsjOOAwkdHJ3Y58fo8BoUfG7jghnvglbwo+5Hk1KOJ2W2Ormw==", - "dev": true, - "dependencies": { - "chalk": "^1.1.1", - "object-assign": "^4.0.1" - } - }, - "node_modules/variable-diff/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/variable-diff/node_modules/ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/variable-diff/node_modules/chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/variable-diff/node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/variable-diff/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/variable-diff/node_modules/supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -9582,16 +9169,6 @@ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.1.tgz", "integrity": "sha512-h7RCSorm1DdTVGJf3P2Mhj3kdnkmF/EiysUkzS2TdgAYqyjFdMQJbVuXOBej2SBJaXan/lIVtT6KkGbyyq753A==" }, - "@bahmutov/data-driven": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@bahmutov/data-driven/-/data-driven-1.0.0.tgz", - "integrity": "sha512-YqW3hPS0RXriqjcCrLOTJj+LWe3c8JpwlL83k1ka1Q8U05ZjAKbGQZYeTzUd0NFEnnfPtsUiKGpFEBJG6kFuvg==", - "dev": true, - "requires": { - "check-more-types": "2.24.0", - "lazy-ass": "1.6.0" - } - }, "@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -11823,12 +11400,6 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, - "check-more-types": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", - "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", - "dev": true - }, "chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -11845,12 +11416,6 @@ "readdirp": "~3.6.0" } }, - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -11977,12 +11542,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" }, - "common-tags": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", - "integrity": "sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==", - "dev": true - }, "compressible": { "version": "2.0.18", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", @@ -12150,24 +11709,6 @@ "path-type": "^4.0.0" } }, - "disparity": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/disparity/-/disparity-3.0.0.tgz", - "integrity": "sha512-n94Rzbv2ambRaFzrnBf34IEiyOdIci7maRpMkoQWB6xFYGA7Nbs0Z5YQzMfTeyQeelv23nayqOcssBoc6rKrgw==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "diff": "^4.0.1" - }, - "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } - } - }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -12261,23 +11802,6 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, - "escape-quotes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/escape-quotes/-/escape-quotes-1.0.2.tgz", - "integrity": "sha512-JpLFzklNReeakCpyj59s78P5F72q0ZUpDnp2BuIk9TtTjj2HMsgiWBChw17BlZT8dRhMtmSb1jE2+pTP1iFYyw==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - }, - "dependencies": { - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - } - } - }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -12961,12 +12485,6 @@ "integrity": "sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==", "dev": true }, - "folktale": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/folktale/-/folktale-2.3.2.tgz", - "integrity": "sha512-+8GbtQBwEqutP0v3uajDDoN64K2ehmHd0cjlghhxh0WpcfPzAIjPA03e1VvHlxL02FVGR0A6lwXsNQKn3H1RNQ==", - "dev": true - }, "follow-redirects": { "version": "1.15.2", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", @@ -13397,34 +12915,11 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true - } - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, - "has-only": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/has-only/-/has-only-1.1.1.tgz", - "integrity": "sha512-3GuFy9rDw0xvovCHb4SOKiRImbZ+a8boFBUyGNRPVd2mRyQOzYdau5G9nodUXC1ZKYN59hrHFkW1lgBQscYfTg==", - "dev": true - }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -13675,15 +13170,6 @@ "binary-extensions": "^2.0.0" } }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - } - }, "is-core-module": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", @@ -13789,12 +13275,6 @@ "istanbul-lib-report": "^3.0.0" } }, - "its-name": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/its-name/-/its-name-1.0.0.tgz", - "integrity": "sha512-GYUWFxViqxDvGzsNEItTEuOqqAQVx29Xl9Lh5YUqyJd6gPHTCMiIbjqcjjyUzsBUqEcgwIdRoydwgfFw1oYbhg==", - "dev": true - }, "jmespath": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", @@ -13864,12 +13344,6 @@ } } }, - "jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true - }, "json-bigint": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", @@ -14036,12 +13510,6 @@ "graceful-fs": "^4.1.9" } }, - "lazy-ass": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", - "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", - "dev": true - }, "leven": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", @@ -14702,12 +14170,6 @@ "path-key": "^3.0.0" } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true - }, "object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", @@ -15070,12 +14532,6 @@ } } }, - "pluralize": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", - "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", - "dev": true - }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -15454,18 +14910,6 @@ "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, - "quote": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/quote/-/quote-0.4.0.tgz", - "integrity": "sha512-KHp3y3xDjuBhRx+tYKOgzPnVHMRlgpn2rU450GcU4PL24r1H6ls/hfPrxDwX2pvYMlwODHI2l8WwgoV69x5rUQ==", - "dev": true - }, - "ramda": { - "version": "0.27.1", - "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.1.tgz", - "integrity": "sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw==", - "dev": true - }, "randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -15969,127 +15413,6 @@ "is-fullwidth-code-point": "^3.0.0" } }, - "snap-shot-compare": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/snap-shot-compare/-/snap-shot-compare-3.0.0.tgz", - "integrity": "sha512-bdwNOAGuKwPU+qsn0ASxTv+QfkXU+3VmkcDOkt965tes+JQQc8d6SfoLiEiRVhCey4v+ip2IjNUSbZm5nnkI9g==", - "dev": true, - "requires": { - "check-more-types": "2.24.0", - "debug": "4.1.1", - "disparity": "3.0.0", - "folktale": "2.3.2", - "lazy-ass": "1.6.0", - "strip-ansi": "5.2.0", - "variable-diff": "1.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", - "dev": true - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, - "snap-shot-core": { - "version": "10.2.4", - "resolved": "https://registry.npmjs.org/snap-shot-core/-/snap-shot-core-10.2.4.tgz", - "integrity": "sha512-A7tkcfmvnRKge4VzFLAWA4UYMkvFY4TZKyL+D6hnHjI3HJ4pTepjG5DfR2ACeDKMzCSTQ5EwR2iOotI+Z37zsg==", - "dev": true, - "requires": { - "arg": "4.1.3", - "check-more-types": "2.24.0", - "common-tags": "1.8.0", - "debug": "4.3.1", - "escape-quotes": "1.0.2", - "folktale": "2.3.2", - "is-ci": "2.0.0", - "jsesc": "2.5.2", - "lazy-ass": "1.6.0", - "mkdirp": "1.0.4", - "pluralize": "8.0.0", - "quote": "0.4.0", - "ramda": "0.27.1" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "snap-shot-it": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/snap-shot-it/-/snap-shot-it-7.9.6.tgz", - "integrity": "sha512-t/ADZfQ8EUk4J76S5cmynye7qg1ecUFqQfANiOMNy0sFmYUaqfx9K/AWwpdcpr3vFsDptM+zSuTtKD0A1EOLqA==", - "dev": true, - "requires": { - "@bahmutov/data-driven": "1.0.0", - "check-more-types": "2.24.0", - "common-tags": "1.8.0", - "debug": "4.3.1", - "has-only": "1.1.1", - "its-name": "1.0.0", - "lazy-ass": "1.6.0", - "pluralize": "8.0.0", - "ramda": "0.27.1", - "snap-shot-compare": "3.0.0", - "snap-shot-core": "10.2.4" - }, - "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, "sonic-boom": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.2.0.tgz", @@ -16621,64 +15944,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "variable-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/variable-diff/-/variable-diff-1.1.0.tgz", - "integrity": "sha512-0Jk/MsCNtL/fCuVIbsLxwXpABGZCzN57btcPbSsjOOAwkdHJ3Y58fo8BoUfG7jghnvglbwo+5Hk1KOJ2W2Ormw==", - "dev": true, - "requires": { - "chalk": "^1.1.1", - "object-assign": "^4.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true - } - } - }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/packages/owl-bot/package.json b/packages/owl-bot/package.json index 42725565d8b..8e9c2c57699 100644 --- a/packages/owl-bot/package.json +++ b/packages/owl-bot/package.json @@ -61,7 +61,6 @@ "nock": "^13.2.9", "rimraf": "^3.0.2", "sinon": "^14.0.0", - "snap-shot-it": "^7.9.6", "ts-node": "^10.9.1", "typescript": "~4.8.3", "uuid": "^9.0.0" diff --git a/packages/owl-bot/src/create-pr.ts b/packages/owl-bot/src/create-pr.ts index 83ae79b2837..792c5c574c1 100644 --- a/packages/owl-bot/src/create-pr.ts +++ b/packages/owl-bot/src/create-pr.ts @@ -100,16 +100,18 @@ export function prependCommitMessage( if (withNestedCommitDelimiters === WithNestedCommitDelimiters.Yes) { // anything before the first BEGIN_NESTED_COMMIT marker, is considered part of // the previous commit - const bodyParts = oldBody.split(NESTED_COMMIT_SEPARATOR); + const bodyParts = oldBody + .split(NESTED_COMMIT_SEPARATOR) + .map(part => part.trim()); const oldBodyWithNestedCommitMarkers = bodyParts.length === 1 ? // there is a single commit -- wrap the old body in the nested commit tags - `${NESTED_COMMIT_SEPARATOR}\n${oldBody}\nEND_NESTED_COMMIT\n` + `${NESTED_COMMIT_SEPARATOR}\n${oldBody}\nEND_NESTED_COMMIT` : // there are already existing nested commit tags, content before the first // one is wrapped in a new nested commit tag `${NESTED_COMMIT_SEPARATOR}\n${ bodyParts[0] - }\nEND_NESTED_COMMIT\n${bodyParts + }\nEND_NESTED_COMMIT\n${NESTED_COMMIT_SEPARATOR}\n${bodyParts .slice(1) .join(NESTED_COMMIT_SEPARATOR)}`; diff --git a/packages/owl-bot/test/create-pr.ts b/packages/owl-bot/test/create-pr.ts index 01f13e8ff6b..10cc3846c6c 100644 --- a/packages/owl-bot/test/create-pr.ts +++ b/packages/owl-bot/test/create-pr.ts @@ -24,7 +24,6 @@ import { prependCommitMessage, WithNestedCommitDelimiters, } from '../src/create-pr'; -import snapshot = require('snap-shot-it'); const loremIpsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'; @@ -101,44 +100,250 @@ describe('resplit', () => { }); describe('prependCommitMessage', () => { - for (const withCheckbox of [ - WithRegenerateCheckbox.Yes, - WithRegenerateCheckbox.No, - ]) { - describe(`with checkbox: ${withCheckbox}`, () => { - for (const withNested of [ - WithNestedCommitDelimiters.Yes, - WithNestedCommitDelimiters.No, - ]) { - describe(`with nested: ${withNested}`, () => { - it('handles an initial pull request content', () => { - const pullContent = resplit( - 'feat: some feature\n\nadditional context', - withCheckbox - ); - const prependedContent = prependCommitMessage( - 'fix: some new feature\n\nmore additional context', - pullContent, - withCheckbox - ); - snapshot(prependedContent.title); - snapshot(prependedContent.body); - }); - - it('handles an initial pull request with long title', () => { - const pullContent = resplit(loremIpsum, withCheckbox); - const prependedContent = prependCommitMessage( - 'fix: some new feature\n\nmore additional context', - pullContent, - withCheckbox - ); - snapshot(prependedContent.title); - snapshot(prependedContent.body); - }); - }); - } + describe('with checkbox', () => { + describe('with nested delimiters', () => { + it('handles an initial pull request content', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + WithRegenerateCheckbox.Yes + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.Yes, + WithNestedCommitDelimiters.Yes + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `- [ ] Regenerate this pull request now. + +more additional context + +BEGIN_NESTED_COMMIT +feat: some feature +additional context +END_NESTED_COMMIT` + ); + }); + + it('handles an initial pull request with long title', () => { + const pullContent = resplit(loremIpsum, WithRegenerateCheckbox.Yes); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.Yes, + WithNestedCommitDelimiters.Yes + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `- [ ] Regenerate this pull request now. + +more additional context + +BEGIN_NESTED_COMMIT +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +END_NESTED_COMMIT` + ); + }); + + it('handles pull request already updated', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + WithRegenerateCheckbox.Yes + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.Yes, + WithNestedCommitDelimiters.Yes + ); + const prependedContent2 = prependCommitMessage( + 'fix: another new feature\n\nfurther context', + prependedContent, + WithRegenerateCheckbox.Yes, + WithNestedCommitDelimiters.Yes + ); + assert.strictEqual(prependedContent2.title, 'fix: another new feature'); + assert.strictEqual( + prependedContent2.body, + `- [ ] Regenerate this pull request now. + +further context + +BEGIN_NESTED_COMMIT +fix: some new feature +more additional context +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +feat: some feature +additional context +END_NESTED_COMMIT` + ); + }); + }); + describe('without nested delimiters', () => { + it('handles an initial pull request content', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + WithRegenerateCheckbox.Yes + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.Yes, + WithNestedCommitDelimiters.No + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `- [ ] Regenerate this pull request now. + +more additional context + +feat: some feature +additional context` + ); + }); + + it('handles an initial pull request with long title', () => { + const pullContent = resplit(loremIpsum, WithRegenerateCheckbox.Yes); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.Yes, + WithNestedCommitDelimiters.No + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `- [ ] Regenerate this pull request now. + +more additional context + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.` + ); + }); }); - } + }); + describe('without checkbox', () => { + describe('with nested delimiters', () => { + it('handles an initial pull request content', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + WithRegenerateCheckbox.No + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.No, + WithNestedCommitDelimiters.Yes + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `more additional context + +BEGIN_NESTED_COMMIT +feat: some feature +additional context +END_NESTED_COMMIT` + ); + }); + + it('handles an initial pull request with long title', () => { + const pullContent = resplit(loremIpsum, WithRegenerateCheckbox.No); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.No, + WithNestedCommitDelimiters.Yes + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `more additional context + +BEGIN_NESTED_COMMIT +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +END_NESTED_COMMIT` + ); + }); + + it('handles pull request already updated', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + WithRegenerateCheckbox.No + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.No, + WithNestedCommitDelimiters.Yes + ); + const prependedContent2 = prependCommitMessage( + 'fix: another new feature\n\nfurther context', + prependedContent, + WithRegenerateCheckbox.No, + WithNestedCommitDelimiters.Yes + ); + assert.strictEqual(prependedContent2.title, 'fix: another new feature'); + assert.strictEqual( + prependedContent2.body, + `further context + +BEGIN_NESTED_COMMIT +fix: some new feature +more additional context +END_NESTED_COMMIT +BEGIN_NESTED_COMMIT +feat: some feature +additional context +END_NESTED_COMMIT` + ); + }); + }); + describe('without nested delimiters', () => { + it('handles an initial pull request content', () => { + const pullContent = resplit( + 'feat: some feature\n\nadditional context', + WithRegenerateCheckbox.No + ); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.No, + WithNestedCommitDelimiters.No + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `more additional context + +feat: some feature +additional context` + ); + }); + + it('handles an initial pull request with long title', () => { + const pullContent = resplit(loremIpsum, WithRegenerateCheckbox.No); + const prependedContent = prependCommitMessage( + 'fix: some new feature\n\nmore additional context', + pullContent, + WithRegenerateCheckbox.No, + WithNestedCommitDelimiters.No + ); + assert.strictEqual(prependedContent.title, 'fix: some new feature'); + assert.strictEqual( + prependedContent.body, + `more additional context + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.` + ); + }); + }); + }); }); describe('insertApiName', () => { From 6434b21c7020f726b925edb3dd73dd06e1bc03b0 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 26 Sep 2022 16:21:08 -0700 Subject: [PATCH 7/7] replace || with ?? --- packages/owl-bot/src/copy-code.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/owl-bot/src/copy-code.ts b/packages/owl-bot/src/copy-code.ts index 0cb949e24d4..a0a359c8caa 100644 --- a/packages/owl-bot/src/copy-code.ts +++ b/packages/owl-bot/src/copy-code.ts @@ -375,7 +375,7 @@ async function findAndAppendPullRequest( .trim(); const {title, body} = prependCommitMessage( commitBody, - {title: pull.title, body: pull.body || ''}, + {title: pull.title, body: pull.body ?? ''}, WithRegenerateCheckbox.Yes, withNestedCommitDelimiters );