From c625d2ea0d2f10390ae9ac2cde8a7eac1b58b28c Mon Sep 17 00:00:00 2001 From: Dominic Saadi Date: Mon, 4 Dec 2023 13:49:08 -0800 Subject: [PATCH] chore(release): add the ability to skip triaging PRs --- tasks/release/releaseLib.mjs | 64 +++++- .../triage/main_next.commitTriageData.json | 190 +++++++++--------- 2 files changed, 146 insertions(+), 108 deletions(-) diff --git a/tasks/release/releaseLib.mjs b/tasks/release/releaseLib.mjs index 6fc70d25abf2..37f4832431c2 100644 --- a/tasks/release/releaseLib.mjs +++ b/tasks/release/releaseLib.mjs @@ -799,16 +799,31 @@ export async function triageCommits({ commits, commitTriageData, range }) { .join(' '), `need to be cherry picked into ${chalk.magenta( range.to - )}? [Y/n/o(pen)] > `, + )}? [Y/n/s(kip)/o(pen)] > `, ] .filter(Boolean) .join('\n') - let answer = 'n' - if (commit.milestone !== 'RSC') { + let answer = 'no' + if (!['RSC', 'v7.0.0'].includes(commit.milestone)) { answer = await question(message) } + answer = getLongAnswer(answer) + + let comment = '' + if (answer === 'skip') { + const commentRes = await prompts({ + type: 'text', + name: 'comment', + message: 'Why are you skipping it?', + + validate: (comment) => comment.length > 0 || 'Please enter a comment', + }) + + comment = commentRes.comment + } + if (['open', 'o'].includes(answer)) { if (commit.url) { await $`open ${commit.url}` @@ -821,7 +836,8 @@ export async function triageCommits({ commits, commitTriageData, range }) { commitTriageData.set(commit.hash, { message: commit.message, - needsCherryPick: isYes(answer), + needsCherryPick: answer, + ...(comment && { comment }), }) break @@ -829,6 +845,27 @@ export async function triageCommits({ commits, commitTriageData, range }) { } } +/** + * + * @param {string} answer + * @returns {'yes'|'no'|'skip'} + */ +function getLongAnswer(answer) { + answer = answer.toLowerCase() + + if (['', 'y', 'yes'].includes(answer)) { + return 'yes' + } + + if (['n', 'no'].includes(answer)) { + return 'no' + } + + if (['s', 'skip'].includes(answer)) { + return 'skip' + } +} + export let prMilestoneCache /** @@ -902,9 +939,16 @@ export function reportCommitStatuses({ commits, commitTriageData, range }) { } for (const commit of commitsToColor) { - const { needsCherryPick } = commitTriageData.get(commit.hash) - const prettyFn = needsCherryPick ? chalk.green : chalk.red - commit.pretty = prettyFn(commit.line) + const { needsCherryPick, comment } = commitTriageData.get(commit.hash) + + if (needsCherryPick === 'yes') { + commit.pretty = chalk.green(commit.line) + } else if (needsCherryPick === 'no') { + commit.pretty = chalk.red(commit.line) + } else { + commit.pretty = [chalk.yellow(commit.line), ` ${comment}`].join('\n') + } + commit.needsCherryPick = needsCherryPick } @@ -914,6 +958,7 @@ export function reportCommitStatuses({ commits, commitTriageData, range }) { `${chalk.green('■')} Needs to be cherry picked into ${chalk.magenta( range.to )}`, + `${chalk.yellow('■')} Skipped (see comments for details)`, $.verbose && `${chalk.blue('■')} Was cherry picked into ${chalk.magenta( range.to @@ -930,7 +975,10 @@ export function reportCommitStatuses({ commits, commitTriageData, range }) { console.log() console.log( commits - .filter((commit) => $.verbose || commit.needsCherryPick) + .filter( + (commit) => + $.verbose || ['yes', 'skip'].includes(commit.needsCherryPick) + ) .map(({ pretty }) => pretty) .join('\n') ) diff --git a/tasks/release/triage/main_next.commitTriageData.json b/tasks/release/triage/main_next.commitTriageData.json index ae406714fd75..e4cea6072b58 100644 --- a/tasks/release/triage/main_next.commitTriageData.json +++ b/tasks/release/triage/main_next.commitTriageData.json @@ -1,346 +1,336 @@ { "ed8a87d98d8c3e5dad23ac3e2143b46a201194dc": { "message": "chore(deps): update dependency esbuild to v0.19.2 (#9029)", - "needsCherryPick": false + "needsCherryPick": "no" }, "0c23f67708b286d1e923e4d93aaba238edf66bb3": { "message": "Streaming fe server: bind to 0.0.0.0 in prod (#9115)", - "needsCherryPick": false + "needsCherryPick": "no" }, "8d0ab16aa1c39f1526e4213211608805735f6974": { "message": "fix(meta): Remove duplicated title and meta attributes (possible edge cases) (#9113)", - "needsCherryPick": false + "needsCherryPick": "no" }, "d7560ec9c1b9b7d6feff3f6a952a49793e6ac8f8": { "message": "chore(deps): update dependency @apollo/experimental-nextjs-app-support to v0.4.2 (#9021)", - "needsCherryPick": false + "needsCherryPick": "no" }, "2b8a5558c6d88f37346346c5f9db2cdd0073f83f": { "message": "feat(Cell Suspense): Allow Cells to not Suspend (#9106)", - "needsCherryPick": false + "needsCherryPick": "no" }, "2f49ac90349e2ddd793e0adeaf00967abfd54912": { "message": "chore(deps): bump @apollo/server from 4.7.5 to 4.9.3 (#9100)", - "needsCherryPick": false + "needsCherryPick": "no" }, "c55f1c56b3b3279089784f3c388829ca3438e1e1": { "message": "chore(deps): bump apollo-server-core from 2.25.3 to 2.26.2 in /__fixtures__/example-todo-main (#9103)", - "needsCherryPick": false + "needsCherryPick": "no" }, "65acc365f05e2862d50aa86aaf2cd1377137b105": { "message": "chore(deps): bump @apollo/server from 4.9.2 to 4.9.3 in /__fixtures__/example-todo-main (#9102)", - "needsCherryPick": false + "needsCherryPick": "no" }, "029fa48c4186ec820704c666a9c31da448a2f7c4": { "message": "chore(deps): bump apollo-server-core from 2.11.0 to 2.26.2 in /__fixtures__/example-todo-main-with-errors (#9101)", - "needsCherryPick": false + "needsCherryPick": "no" }, "52fc187a3c609db9e05dc3d68dd2857f68209d0b": { "message": "chore(deps): update dependency @playwright/test to v1.37.1 (#9098)", - "needsCherryPick": false + "needsCherryPick": "no" }, "069101b7ca1115d021a20f4d9b80e9b10107df24": { "message": "feat(streaming): Make Cells render on the server with useBackgroundQuery and useReadQuery (#9074)", - "needsCherryPick": false + "needsCherryPick": "no" }, "fbd39919afc75bd7fc7082e22fcb4f650c916771": { "message": "chore(deps): bump @adobe/css-tools from 4.1.0 to 4.3.1 in /__fixtures__/example-todo-main (#9089)", - "needsCherryPick": false + "needsCherryPick": "no" }, "944a93b1df26afa6749fe34c12f1e334385aef6a": { "message": "chore(deps): bump @adobe/css-tools from 4.2.0 to 4.3.1 (#9088)", - "needsCherryPick": false + "needsCherryPick": "no" }, "8ca4b0201a6129efb50414c014bc910b3572625e": { "message": "chore(deps): bump protobufjs from 6.11.3 to 6.11.4 (#9042)", - "needsCherryPick": false + "needsCherryPick": "no" }, "c5ba4888a87e5ea0b11ff5d2768d13f47f672eeb": { "message": "feat(streaming): Cleanup/Unify streaming dev and prod server (#9047)", - "needsCherryPick": false + "needsCherryPick": "no" }, "bb3ef0bd6034dfa7c6a38efcdabb444eea9665c7": { "message": "Create releaseCommits.json", - "needsCherryPick": false + "needsCherryPick": "no" }, "c89e1364c7e9af541438f3274ddf1f92401dc2c8": { "message": "exp(streaming): Allow SSR with experimental apollo client (#9038)", - "needsCherryPick": false + "needsCherryPick": "no" }, "865c9085bf1519c6b2f153b7497ef005d42f3bad": { "message": "manually bump web-server package version", - "needsCherryPick": false + "needsCherryPick": "no" }, "ae11f69df494be05d33e558bfea328b751223f43": { "message": "Streaming SSR: Fix RWJS_EXP_SSR_GRAPHQL_ENDPOINT logic (#9134)", - "needsCherryPick": false + "needsCherryPick": "no" }, "7ee61534f9131657b920f2d95b3d0e8d7a6e4ab2": { "message": "RSC: Don't set the react-server condition for client builds (#9132)", - "needsCherryPick": false + "needsCherryPick": "no" }, "9257e3944fe1f49a3e9bd39a1f076c02134de28c": { "message": "RSC: Decode RSF args from request (#9157)", - "needsCherryPick": false + "needsCherryPick": "no" }, "c46bb67a75c4f78b4cbd5d744f52937a567f0e43": { "message": "RSC: RSF aka Server Actions (#9155)", - "needsCherryPick": false + "needsCherryPick": "no" }, "d3475cd7041b20106bf73968a1d59dcae611afcd": { "message": "RSC: Make code and execution easier to follow. Improve error handling. (#9154)", - "needsCherryPick": false + "needsCherryPick": "no" }, "ee334bcf08f760cdfe26c03e7d65dc7da2f76281": { "message": "RSC: Work around an issue in Rollup (#9153)", - "needsCherryPick": false + "needsCherryPick": "no" }, "050a16925ab9768374e56f20792bbb2a026488bb": { "message": "Streaming: meta charSet=utf-8 (#9142)", - "needsCherryPick": false - }, - "634099091ade40b5bba9f86cd6fc573ae5be480c": { - "message": "chore(tasks): Benchmark tests (#8578)", - "needsCherryPick": false + "needsCherryPick": "no" }, "91fb06b378ea2b156f0cb619033021f4b116a6a7": { "message": "Allow resuming rebuild-test-project-fixture at a specific sub step (#9173)", - "needsCherryPick": false + "needsCherryPick": "no" }, "9d63d080a69f1428bb2b961690ecb09eaee64edd": { "message": "RSC: react-18.3.0-canary-bbc8530ed-20230912 (#9164)", - "needsCherryPick": false - }, - "08870babd04bdfaa735f645603de0d5c515d66c2": { - "message": "chore(ci): undo changes to test project stories (#9166)", - "needsCherryPick": false + "needsCherryPick": "no" }, "1b52e3dda6b6e8fe5ea2522aaee8c687566912b7": { "message": "chore(deps): update dependency esbuild to v0.19.3 (#9180)", - "needsCherryPick": false + "needsCherryPick": "no" }, "adddd23987b8a1003053280fafe772275e932217": { "message": "chore(deps): update dependency lerna to v7.3.0 (#9186)", - "needsCherryPick": false + "needsCherryPick": "no" }, "4d06556988b8f1da0a9ecd7d6b0e133707e22921": { "message": "smoke-tests: Fix red squiggles (type import, * as) (#9193)", - "needsCherryPick": false + "needsCherryPick": "no" }, "83d180fc477b17bf33c7673f010b68e9f7d5e0a2": { "message": "RSC: Check if index.html has already been updated during setup (#9197)", - "needsCherryPick": false + "needsCherryPick": "no" }, "e2c14ebf9cb4f62d3d5eed63becd4cbf587485a4": { "message": "RSC: Use react/experimental types (#9196)", - "needsCherryPick": false + "needsCherryPick": "no" }, "a7bab85513ded97c500399daacf3a39de1fc1378": { "message": "RSC: Patch vite when running setup command (#9192)", - "needsCherryPick": false + "needsCherryPick": "no" }, "a436b1cfe82b0ce53baadc0149a5d2831928135b": { "message": "RSC: Support 'use client' in 3pp packages (#9191)", - "needsCherryPick": false + "needsCherryPick": "no" }, "5921359bf6482873df1bf9d9df51f3eaaba9c566": { "message": "chore(crwa): remove React `prop-types` package (#9206)", - "needsCherryPick": false + "needsCherryPick": "no" }, "18555d0e196cfc69ed322e24cafeb2d228773ae1": { "message": "RSC: Smoke test (#9194)", - "needsCherryPick": false + "needsCherryPick": "no" }, "27d33d3e29276d0d5c61d604034d65b4c6ae5f65": { "message": "RSC: Handle Windows paths in clientEntries (#9233)", - "needsCherryPick": false + "needsCherryPick": "no" }, "045531957188895e3ee42c3815030445bb59b87f": { "message": "fix(cli): Exit with non-zero exit code when `yarn rw g types` has errors (#9280)", - "needsCherryPick": false + "needsCherryPick": "no" }, "c8c8a3b1e3c599a610b3856b71078357e70e44be": { "message": "RSC: vite externalConditions (#9333)", - "needsCherryPick": false + "needsCherryPick": "no" }, "45065da262c1a57d67b0013ea7168c0fca687dc6": { "message": "RSC: test-project-rsa: Fix TS type error in onSend (#9332)", - "needsCherryPick": false + "needsCherryPick": "no" }, "18c5d961f203820facc8a42eebe2d382ed7ff7dd": { "message": "RSC: Implement RSC worker (#9331)", - "needsCherryPick": false + "needsCherryPick": "no" }, "433d8ef99b0025cf2a5d6faceef303be6089f155": { "message": "RSC: createRscRequestHandler (#9330)", - "needsCherryPick": false + "needsCherryPick": "no" }, "104c8e289340310dd4cba7d8cc20666a9abb85e6": { "message": "RSA smoke-test (#9327)", - "needsCherryPick": false + "needsCherryPick": "no" }, "f157c3ec9c76848716311c928a047138775279a3": { "message": "RSC e2e scripts: Fix console.log text. Change local test path (#9326)", - "needsCherryPick": false + "needsCherryPick": "no" }, "daaa1998837bdb6eaa42d9160292e781fadb3dc8": { "message": "fix(stream-ssr): Cancel the timeout when the react stream has finished (#9317)", - "needsCherryPick": false + "needsCherryPick": "no" }, "e2cf25db2518833ad0b833c5e6b5308557ecc7fd": { "message": "fix(ssr-build): Generate document in ssr build too! (#9310)", - "needsCherryPick": false + "needsCherryPick": "no" }, "1ed2b5b477a6b08a0d4731160591bebfaaeac34b": { "message": "feat(streaming-ssr): Various bug fixes and migrate to FetchAPI/Web streams (#9295)", - "needsCherryPick": false + "needsCherryPick": "no" }, "656a2c86e28a915a8f8552a44c8b79331873f7f7": { "message": "chore(e2e): Setup e2e test for streaming SSR (#9349)", - "needsCherryPick": false + "needsCherryPick": "no" }, "bdf885a0848c0aa97be2d7d16fa7bac60ff64f68": { "message": "fix(stream-ssr): Move wait for all ready to fix bot rendering (#9389)", - "needsCherryPick": false + "needsCherryPick": "no" }, "1e42b43b6201fd55e3e41e4d5a070606f2d385ff": { "message": "feat(ssr): Collect CSS links during dev (#9382)", - "needsCherryPick": false + "needsCherryPick": "no" }, "c4dedc66ced7259516715033c20372072c4cfd2d": { "message": "chore(ssr): Move LocationProvider inside framework for SSR (#9383)", - "needsCherryPick": false + "needsCherryPick": "no" }, "76e1672c33a9cb5f65d4a21bb9a9d86341655f6f": { "message": "feat(ssr-streaming): Allow building without index.html during streaming-ssr (#9387)", - "needsCherryPick": false + "needsCherryPick": "no" }, "a626553abcde3e3cbaf2e10c68dc8543698c9006": { "message": "Issue Metrics GitHub action (#9392)", - "needsCherryPick": false + "needsCherryPick": "no" }, "fdba607d5a21276e8ffd7d7b4eccb1f9262186d0": { "message": "Issue Metrics GitHub action in /workflows (#9393)", - "needsCherryPick": false + "needsCherryPick": "no" }, "2bfadd2ca4b2020e15226711520f04993ffeebff": { "message": "Move Issue Metrics GH actions into workflow folder (#9395)", - "needsCherryPick": false + "needsCherryPick": "no" }, "963fc0063e6134ec7b9a1a28a0acf766d2fe72fa": { "message": "Issue Metrics: Fix weekly report (#9397)", - "needsCherryPick": false + "needsCherryPick": "no" }, "79a331609fc206dfe7960fcff98e17720e845091": { "message": "Issue Metrics: Weekly JSON report (#9400)", - "needsCherryPick": false + "needsCherryPick": "no" }, "b79b0ed004513e48f5a856c0720fd5926af336cc": { "message": "Debug weekly issue metrics json.yml", - "needsCherryPick": false + "needsCherryPick": "no" }, "e49d8e328abfcc9990be6ebae6b4310f609674d3": { "message": "Issue Metrics: Weekly JSON report use different file name", - "needsCherryPick": false + "needsCherryPick": "no" }, "69d9bd537381180ad1e6fb9bdfe1fd07b00b1cec": { "message": "Issue Metrics: Try jq", - "needsCherryPick": false + "needsCherryPick": "no" }, "f837962c6ee06a3bd843ceecf7c3d2f0af78018d": { "message": "Issue Metrics: Try jq (spelled correctly)", - "needsCherryPick": false + "needsCherryPick": "no" }, "e2a90f8c3c905a26c788f40c21a54291c36f5c87": { "message": "RSC: smoke tests: install and build after project:copy (#9411)", - "needsCherryPick": false + "needsCherryPick": "no" }, "df885749bdf150c3e536f463256e8cf34a987e78": { "message": "RSC: Move loaders to worker thread (#9412)", - "needsCherryPick": false + "needsCherryPick": "no" }, "114a2b0260973b7ad252d43f2e14704284ba4ff7": { "message": "RSC GH action: Move build to after copy (#9413)", - "needsCherryPick": false + "needsCherryPick": "no" }, "cb0b035cced7678df7f7e6bf772cc1feabcfd785": { "message": "RSC: Check for rw-rsc header (#9410)", - "needsCherryPick": false + "needsCherryPick": "no" }, "e04e48e6933dd54e5133f8fc2c545aae48a1fa64": { "message": "RSC: Support client-only package and include @tobbe.dev/rsc-test in smoke test (#9367)", - "needsCherryPick": false + "needsCherryPick": "no" }, "4c15e9ad122961531a2757cd65d6439d414f47bb": { "message": "chore(deps): update dependency esbuild to v0.19.5 (#9359)", - "needsCherryPick": false + "needsCherryPick": "no" }, "c5eca98932564ffc8845eedba52f2e3f9ac004e3": { "message": "chore(deps): update dependency rollup to v3.29.4 (#9464)", - "needsCherryPick": false + "needsCherryPick": "no" }, "886e28ab5ecf88055f320c7c12120ea79eabdaad": { "message": "fix(deps): update dependency @whatwg-node/server to v0.9.16 (#9475)", - "needsCherryPick": false + "needsCherryPick": "no" }, "e330be7f1681cebeb226ad2c624dc575b51ea8e6": { "message": "fix(deps): update dependency isbot to v3.7.1 (#9506)", - "needsCherryPick": false - }, - "f0dd337030ec17a54ab5f6717b6a1b12dfa75d75": { - "message": "feature: Realtime setup and generator commands out of experimental and into main cli (#9342)", - "needsCherryPick": true - }, - "a1de0786b65c1178244fd682f0962e3ea9371e4c": { - "message": "feature: Support GraphQL Trusted Documents aka Persisted Operations for added security (#9416)", - "needsCherryPick": true + "needsCherryPick": "no" }, "fe70a367370d1070321a23a3f62294239830f379": { "message": "Prerender smoke-test: await helper function (#9546)", - "needsCherryPick": false + "needsCherryPick": "no" }, "4afccbcb6e5947c32add1779fd75c2907e497759": { "message": "RSC: Combine RSC server with StreamingSSR server (#9553)", - "needsCherryPick": false + "needsCherryPick": "no" }, "c37f086a0dd8d7425046406ef1ea6308ed6bc69d": { "message": "Remove GitHub action that creates new issue with metrics (#9559)", - "needsCherryPick": false + "needsCherryPick": "no" }, "205e0f4cbc41d75ba615cbd70b905d035dc066ee": { "message": "fix(streaming): Fix css loading on dev server on Windows (#9557)", - "needsCherryPick": false + "needsCherryPick": "no" }, "645956290e519d3e37432741f047569824330d9b": { "message": "fix(streaming-ssr): Fixes running the streaming server using rw serve (#9558)", - "needsCherryPick": false + "needsCherryPick": "no" }, "1f66831febefd5ab2c650f905eabce8dde43027b": { "message": "RSC: Refactor build process (#9588)", - "needsCherryPick": false + "needsCherryPick": "no" }, "99685ee74a2b9b25f0f4cc668746b8f016efa327": { "message": "RSC: Generate a route manifest (#9592)", - "needsCherryPick": false + "needsCherryPick": "no" }, "1e1c8d1a37d665ca5fc3c14649907dee1dec73fa": { "message": "fix(deps): update dependency @whatwg-node/server to v0.9.18 (#9602)", - "needsCherryPick": false + "needsCherryPick": "no" }, "a7ea8cdc35772234cbc7ac5e3c36446213ebe61a": { "message": "RSC: Include routing in initial RSC example app (#9611)", - "needsCherryPick": false + "needsCherryPick": "no" }, "2c638c38b97da8179f222d4515e83e7378ecb527": { "message": "RSC: Fake server-side routing (#9593)", - "needsCherryPick": false + "needsCherryPick": "no" }, "00462e511c772fd03226f576816039a8e62f5ea2": { "message": "RSC: Refactor to share buildRouteManifest function with SSR process (#9618)", - "needsCherryPick": false + "needsCherryPick": "no" + }, + "f0dd337030ec17a54ab5f6717b6a1b12dfa75d75": { + "message": "feature: Realtime setup and generator commands out of experimental and into main cli (#9342)", + "needsCherryPick": "skip", + "comment": "This PR breaks a previous patch that relied on [experimental.realtime] in redwood.toml" }, - "f99866178e4d335d4a087c66b10eb90cb81fff26": { - "message": "chore(release): Automatically triage RSC PRs", - "needsCherryPick": true + "a1de0786b65c1178244fd682f0962e3ea9371e4c": { + "message": "feature: Support GraphQL Trusted Documents aka Persisted Operations for added security (#9416)", + "needsCherryPick": "skip", + "comment": "Needs another PR to complete the feature" } }