-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 PHP Sync Issue generation script to ignore PRs with given labels #59549
Conversation
|
||
// The following paths will be ignored when generating the issue content. | ||
const IGNORED_PATHS = [ | ||
'init.php', // plugin specific code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to path ignore as I don't think we need to worry about code here.
const LABELS_TO_IGNORE = [ 'Backport from WordPress Core' ]; | ||
const LABELS_TO_IGNORE = [ | ||
'Backport from WordPress Core', // PRs made "upstream" in Core that were synced back into Gutenberg. | ||
'Backported to WP Core', // PRs that were synced into Core during a previous release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new label that indicates a given PR has already been backported to WP Core and so any PRs with this label can be safely omitted from the list of PRs that will need to be manually backported to Core in the next release cycle (at the time of authoring that will be WP 6.6).
@@ -466,7 +439,7 @@ function generateIssueContent( result, level = 1 ) { | |||
} | |||
|
|||
async function fetchAllCommits( since, path ) { | |||
return await octokitPaginate( 'GET /repos/{owner}/{repo}/commits', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to await inside an async function as return value will always be an awaitable Promise
.
@@ -481,7 +454,7 @@ async function fetchCommit( sha ) { | |||
|
|||
// eslint-disable-next-line no-unused-vars | |||
async function getPullRequestDataForCommit( commitSha ) { | |||
const pullRequests = octokitRequest( | |||
const pullRequests = await octokitRequest( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to await here to ensure we get the data 😅
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@youknowriad Could we get this merged do you think? Without these changes this script will be less useful to future contributors and I'd like to update the handbook. |
This comment was marked as off-topic.
This comment was marked as off-topic.
…ls (WordPress#59549) * Fetch full PR data and interogate labels * Revert change to const * Remove redundant comments * Remove debugging * Remove redundant arg * Add new script
What?
Updates the script which generates the list of PRs requiring manual backporting to WP Core for a given release to ignore PRs with known labels.
Why?
As part of changes to the process for syncing Gutenberg to WP Core we now add a
Backported to WP Core
label to any PRs that have been backported. This is done either manually or automatically via the Cherry Picking script.As a result, we should update the script to ignore any PRs that have this label as we know they have already been backported to Core.
As a consequence we can also remove the
lastRcDate
required arg as this was a temp hack in place during 6.5 because the PRs from the 6.4 cycle didn't have theBackported to WP Core
label (as this convention was adopted only during the 6.5 release).How?
Backported to WP Core
label.Testing Instructions
Backported to WP Core
labelBackport from WordPress Core
labelTesting Instructions for Keyboard
Screenshots or screencast