diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e19c8abd..1e9fcf246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ _None_ ### New Features -_None_ +- The backmerge PR body now use a [Mermaid](https://mermaid.js.org) graph to represent the Git tree [#594] ### Bug Fixes diff --git a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_backmerge_pull_request_action.rb b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_backmerge_pull_request_action.rb index 2ead2930e..48421a992 100644 --- a/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_backmerge_pull_request_action.rb +++ b/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_backmerge_pull_request_action.rb @@ -110,10 +110,36 @@ def self.create_backmerge_pr(token:, repository:, title:, head_branch:, base_bra other_action.push_to_git_remote(tags: false) - pr_body = <<~BODY - Merging `#{head_branch}` into `#{base_branch}`. + # Live playground to edit this graph + # https://mermaid.live/edit#pako:eNqNkU1PwzAMhv9KZanqpWVFwCVHQOKCxoFrLl7itdGaZEoTTWjqf8eLOo2i8eGTPx77TewjKK8JBJTlUbqCzTgTRTEHJ6s6E18C7vtqkc4li8Y9BnSqX6MlBqoYkttV9Y_cW9AUGLxt2_Y7Nfb-8OStNfEVNzQwtcVhpCU1XUJ2p7KU7vzAXNlkmSLQQDjS6v7m4S7nVU9q51O8UsmSv7jzSEuho9Xc3pzaG-Oib_KXlxr_QL8onbuuVy9unvrXbKiBCV645qvme0mIPVmSINjVtMU0RAm8O0YxRf_-4RQIbqca0l5jpGeDXUALIu9_-gRejKzU + meramid_git_graph = <<~GRAPH + ```mermaid + %%{ + init: { + 'gitGraph': { + 'mainBranchName': '#{base_branch}', + 'mainBranchOrder': 1000, + 'showCommitLabel': false + } + } + }%% + gitGraph + branch #{head_branch} + checkout #{head_branch} + commit + commit + commit + branch #{intermediate_branch} + checkout #{intermediate_branch} + commit + checkout #{base_branch} + commit + commit + merge #{base_branch} + ``` + GRAPH - Via intermediate branch `#{intermediate_branch}`, to help fix conflicts if any: + ascii_git_graph = <<~GRAPH ``` #{head_branch.rjust(40)} ----o-- - - - #{' ' * 40} \\ @@ -121,6 +147,21 @@ def self.create_backmerge_pr(token:, repository:, title:, head_branch:, base_bra #{' ' * 40} \\ #{base_branch.rjust(40)} ------------x- - - ``` + GRAPH + + pr_body = <<~BODY + Merging `#{head_branch}` into `#{base_branch}`. + + Via intermediate branch `#{intermediate_branch}`, to help fix conflicts if any: + + #{meramid_git_graph} + +
+ Expand to see an ASCII representation of the Git graph above + + #{ascii_git_graph} + +
BODY other_action.create_pull_request(