Created a GitHub Action workflow that creates a PR to sync main-to-dev - #2245
Conversation
Signed-off-by: chanmosq <75444793+chanmosq@users.noreply.github.com>
willihay
left a comment
There was a problem hiding this comment.
Nice! Let's try it! Will reviewers get automatically added per our current CODEOWNERS rules?
|
I suppose this means that every time a PR is merged in main, we can expect another PR to be created to merge it to dev. This could get tedious if it happens with every PR. I wonder if this workflow could be scheduled to run 1x per day or week. |
|
@willihay I'm not sure if the codeowners rules will apply to the auto-created PR, we'll find out when we use it. Otherwise, the GitHub Action also accepts the parameters, REVIEWERS and TEAM_REVIEWERS. |
The behavior I observed is when a PR first merges to main, an auto sync PR is created from |
Signed-off-by: chanmosq <75444793+chanmosq@users.noreply.github.com>
Signed-off-by: chanmosq <75444793+chanmosq@users.noreply.github.com>
Oh, got it! So commits from merged PRs will just keep stacking into an existing sync PR instead of creating a new one? That sounds perfect. I suppose the workflow must look for existing sync PRs that it had already created. |
Change summary
This introduces a new workflow that creates a PR to sync main-to-dev. It is triggered whenever there is a merge to
main. If there are multiple merges tomain, only one sync PR is automatically created.This workflow the Sync Branches GitHub Action.
Testing
I've tested the workflow in my own fork. Here are the test cases:
Test 1
Test with few changes in
docs/(commit 1a4d75a). The commit came fromupstream/main, and was committed after the commit, WK 5 main-to-dev-sync (d6456ee). Therefore, this commit will be branc new toorigin/developmentmain**Note: The generated sync PR in "Test 1" shows numerous commits to merge into
development. This is not expected, given that synceddevelopmentto this point when completing the steps in "Setting up a Test Environment". The only commit expected was 1a4d75a. However, in "Test 2", the generated sync PR has only one commit, as expected.Test 2
Test with more changes in
docs/(commit 397fca0). We follow the same steps as Test 1, but with another commit. Again, merging the PR tomain, led to the automatic creation of a sync PR: chanmosq#8Test 3
Test with multiple pushes to
main(commits 29ce2f5, 29916f8, and 25f0bae). This did not trigger the workflow to create multiple sync PRs - it only created one sync PR, which updated whenever a new commit was pushed tomain: chanmosq#9As Test 3 shows, there is no need to worry about multiple auto sync PRs being created.
Submission Checklist: