Skip to content

Commit addae7b

Browse files
auto-cherry-pick for docs-cypher (#1073)
@recrwplay changed the GitHub actions settings to include "sorenlouv/backport-github-action@*,", not sure that's enough --------- Co-authored-by: Neil Dewhurst <[email protected]>
1 parent 89d8c0f commit addae7b

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.backportrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"repoOwner": "Neo4j",
3+
"repoName": "docs-cypher",
4+
"prTitle": "[Cherry-pick][{{targetBranch}}] {{commitMessages}}"
5+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: auto-cherry-pick
2+
on:
3+
pull_request_target:
4+
types: ["closed"]
5+
6+
jobs:
7+
backport:
8+
name: Cherry-pick PR
9+
runs-on: [ubuntu-latest]
10+
if: |
11+
github.event.pull_request.merged == true
12+
&& contains(github.event.pull_request.labels.*.name, 'cherry-pick')
13+
&& github.event.action == 'closed'
14+
)
15+
steps:
16+
- name: Cherry-pick action
17+
uses: sorenlouv/backport-github-action@929f69d04adbc196d982e60f02837b6cc00b3129
18+
with:
19+
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
auto_backport_label_prefix: cherry-pick-to-
21+
add_original_reviewers: false
22+
23+
- name: Info log
24+
if: ${{ success() }}
25+
run: cat ~/.backport/backport.info.log
26+
27+
- name: Debug log
28+
if: ${{ failure() }}
29+
run: cat ~/.backport/backport.debug.log

README.adoc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,36 @@ There are a few edge cases where we might want to work only on the current branc
7878
* When a new version is ready to published, the `5.x` branch will get a git tag, named with the exact version (for example, **5.1.0**), signifying that this point-in-time marks the completion of the work for that minor release.
7979
* Updates merged into the `dev` branch for the next release are cherry-picked into the `5.x` branch.
8080

81+
=== Enable automatic cherry-picking on a PR
82+
83+
To enable automatic cherry-picking on a PR, add the label `auto-cherry-pick` to it.
84+
Without it, the responsible GitHub action is not going to be triggered.
85+
86+
To select the target branches you would like to cherry-pick your PR to, add labels of the following structure: `auto-cherry-pick-to-<targetBranch>`.
87+
For example: `auto-cherry-pick-to-cypher-25` to cherry-pick it to the branch `cypher-25` or `auto-cherry-pick-to-5.x` for the branch `5.x`.
88+
You may even add new labels for branches that do not have such a label yet.
89+
90+
The feature is triggered by either merging a PR with the `auto-cherry-pick` label or by adding the `auto-cherry-pick` label to an already closed and merged PR.
91+
In the latter case, ensure that you first add the labels containing the target branches and then finally the `auto-cherry-pick` label.
92+
Otherwise the automation starts without any target branches.
93+
94+
95+
==== Details
96+
97+
The PRs created by this GitHub action will have their heading prefixed with `[Cherry-pick][<targetBranch>]`.
98+
So, for example, for `6.x` as the target branch and `some changes` as the original PR heading, it results in `[Cherry-pick][6.x] some changes` as the heading for the cherry-picked PR.
99+
In case an assignee was set for the original PR, the cherry-picked PRs will also receive the same assignee.
100+
You must add reviewers manually after the cherry-picked PRs have been created.
101+
102+
The creation of cherry-picked PRs can take a few minutes.
103+
If you are an assignee of the original PR, you receive an email notification once the cherry-picked PRs have been created.
104+
The original PR is updated with a comment that contains links to the newly created cherry-picked PRs.
105+
106+
In case of a merge conflict while cherry-picking to a specific release branch, the branch will be skipped. Information on skipped branches is also included in the comment added to the original PR.
107+
In that case you will have to take care of cherry-picking manually and resolve the conflicts.
108+
This is not going to influence the other release branches as long as they do not have conflicts.
109+
110+
81111
[[documenting-changes]]
82112
== Documenting changes to Cypher
83113

@@ -117,3 +147,4 @@ When documenting a new Cypher feature, its relationship with GQL must be conside
117147
* If the feature is part of GQL's optional features, it should be recorded on the page xref:modules/ROOT/pages/appendix/gql-conformance/supported-optional.adoc[Supported optional GQL features].
118148
* if the feature adds functionality for which there exists an analogous, optional GQL feature, it should be recorded on the page xref:modules/ROOT/pages/appendix/gql-conformance/analogous-cypher.adoc[Optional GQL features and analogous Cypher].
119149
* If the feature adds functionality for which there exists no GQL equivalent, it should be recorded on the page xref:modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc[Additional Cypher features].
150+

0 commit comments

Comments
 (0)