-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Automatically sync backport changelog to issue #62973
Conversation
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. |
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
fetch-depth: ${{ env.PR_COMMIT_COUNT }} |
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 don't need commit history for this test, so cleaning up a bit.
Flaky tests detected in d1070df. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9712700675
|
console.log(`Latest version: ${version}`); | ||
|
||
const { execSync } = require('child_process'); | ||
const processedChangelog = execSync(`awk '/./ {print ($0 ~ /^[-*]/ ? " " : "- ") $0}' backport-changelog/${version}/*.md`).toString().trim(); |
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.
Could we check the last commit for changes in this directory before doing anything else? Seems like it might save us some API requests.
Another alternative could be conditioning this workflow on a check similar to the one check-backport-changelog
uses.
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.
What API requests would it save? I'm already checking if the content is different.
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.
The very first one
What I'm getting at is that I think that not starting the workflow if it's not necessary is a good idea
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 an early abort 8bb22a2
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.
Looks good!
😔 I forgot to add props, I'm so sorry |
@vcanales What I don't like now, after the last change, is that it will only add the changes to a newly created issue after another backport was made. |
What?
Creates a new workflow to automatically sync the changelog to the right issue.
Why?
Reduce repetitive manual labor.
How?
When a change is pushed to trunk the workflow will:
When a new release cycle is started, someone can just create a new issue with the label "🤖 Sync Backport Changelog" and mention 6.7 (for example) in the title. On the next push to trunk the issue will be updated.
The script will only sync the last created issue, previous ones will be ignored and should probably be closed.
Future work
We could add a PR workflow that also adds unmerged backport PRs to the issue in the future. Worth noting that even the old cherry-pick script never took any unmerged PRs into account.
Testing Instructions
You can see it in action here: #62315
Testing Instructions for Keyboard
Screenshots or screencast