Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cherry pick script to add Backported to WP Core label for backports #58970

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions bin/cherry-pick.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ function reportSummaryNextSteps( successes, failures ) {
nextSteps.push( 'Push this branch' );
nextSteps.push( 'Go to each of the cherry-picked Pull Requests' );
nextSteps.push( `Remove the ${ LABEL } label` );

if ( LABEL === 'Backport to WP Beta/RC' ) {
nextSteps.push( 'Add the "Backported to WP Core" label' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this label be hard coded in the code or should we make it an argument like LABEL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or at least a const

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@youknowriad I added a const for now. I don't have a use case for making this another arg yet. If we have one in the future we can easily add this.

It would be useful to bring this change in prior to Beta 3.

}

nextSteps.push( 'Request a backport to wordpress-develop if required' );
nextSteps.push( 'Comment, say that PR just got cherry-picked' );
}
Expand Down Expand Up @@ -363,6 +368,17 @@ function GHcommentAndRemoveLabel( pr ) {
try {
cli( 'gh', [ 'pr', 'comment', number, '--body', comment ] );
cli( 'gh', [ 'pr', 'edit', number, '--remove-label', LABEL ] );

if ( LABEL === 'Backport to WP Beta/RC' ) {
cli( 'gh', [
'pr',
'edit',
number,
'--add-label',
'Backported to WP Core',
] );
}

console.log( `✅ ${ number }: ${ comment }` );
} catch ( e ) {
console.log( `❌ ${ number }. ${ comment } ` );
Expand Down