Skip to content

Commit

Permalink
chore(release): Show only PRs that needs to be cherry picked by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Dec 4, 2023
1 parent 684c39a commit 9c668bd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
29 changes: 20 additions & 9 deletions tasks/release/releaseLib.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { chalk, fs, question, $ } from 'zx'
* ref: string,
* type: 'commit' | 'ui' | 'release-chore' | 'tag'
* pretty: string,
* needsCherryPick?: boolean,
* }} Commit
*
* @typedef {Map<string, { message: string, needsCherryPick: boolean }>} CommitTriageData
Expand Down Expand Up @@ -903,6 +904,7 @@ export function reportCommitStatuses({ commits, commitTriageData, range }) {
const { needsCherryPick } = commitTriageData.get(commit.hash)
const prettyFn = needsCherryPick ? chalk.green : chalk.red
commit.pretty = prettyFn(commit.line)
commit.needsCherryPick = needsCherryPick
}

consoleBoxen(
Expand All @@ -911,17 +913,26 @@ export function reportCommitStatuses({ commits, commitTriageData, range }) {
`${chalk.green('■')} Needs to be cherry picked into ${chalk.magenta(
range.to
)}`,
`${chalk.blue('■')} Was cherry picked into ${chalk.magenta(
range.to
)} with changes`,
`${chalk.dim.red('■')} Shouldn't be cherry picked into ${chalk.magenta(
range.to
)}`,
`${chalk.dim('■')} Chore commit or purely-decorative line`,
].join('\n')
$.verbose &&
`${chalk.blue('■')} Was cherry picked into ${chalk.magenta(
range.to
)} with changes`,
$.verbose &&
`${chalk.dim.red('■')} Shouldn't be cherry picked into ${chalk.magenta(
range.to
)}`,
$.verbose && `${chalk.dim('■')} Chore commit or purely-decorative line`,
]
.filter(Boolean)
.join('\n')
)
console.log()
console.log(commits.map(({ pretty }) => pretty).join('\n'))
console.log(
commits
.filter((commit) => $.verbose || commit.needsCherryPick)
.map(({ pretty }) => pretty)
.join('\n')
)
}

/**
Expand Down
4 changes: 4 additions & 0 deletions tasks/release/triage/main_next.commitTriageData.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,9 @@
"00462e511c772fd03226f576816039a8e62f5ea2": {
"message": "RSC: Refactor to share buildRouteManifest function with SSR process (#9618)",
"needsCherryPick": false
},
"f99866178e4d335d4a087c66b10eb90cb81fff26": {
"message": "chore(release): Automatically triage RSC PRs",
"needsCherryPick": true
}
}

0 comments on commit 9c668bd

Please sign in to comment.