Commit graph

9 commits

Author SHA1 Message Date
Earl Warren
6c7179355e
[CI] backport auto-squash detection and -x
* Behaves as it should with merge & squashed pull requests
* Cherry-pick commits with -x for traceability

Refs: https://github.com/kiegroup/git-backporting/issues/113
2024-04-03 08:18:39 +02:00
Earl Warren
21dda0d1f7
[CI] backport workaround to cherry-pick in order
Refs: https://github.com/kiegroup/git-backporting/issues/114
2024-04-01 17:48:39 +02:00
Earl Warren
9bd55ced76 Merge pull request '[CI] backport workaround to avoid duplicated job runs' (#2934) from earl-warren/forgejo:wip-backport-workaround into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2934
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
2024-03-31 19:02:54 +00:00
Earl Warren
d9b5df89e3
[CI] backport workaround to avoid duplicated job runs
Refs: https://codeberg.org/forgejo/forgejo/issues/2009
2024-03-31 17:34:21 +02:00
Earl Warren
7aa686d979
[CI] backport: show event information for debug purposes
It will help figure out why two runs of testing happen when a backport
PR is open.

Refs: https://codeberg.org/forgejo/forgejo/pulls/2922
Refs: https://codeberg.org/forgejo/forgejo/issues/2009
2024-03-31 07:27:23 +02:00
Earl Warren
d8ab364889
[CI] allow backports to be launched on merged pull requests
The intention was good initially but the expression was wrong for two
reasons:

* When a pull_request event is received for a labeled action, the
  match should be github.event.action == 'label_updated' and not
  'labeled'
* The event does not have a github.event.label field and
  contains(github.event.label.name, 'backport/v') will always be
  false.

Since the expression is only evaluated in the context of a merged pull
request, either because it was just closed or because it was labeled
after the fact, the only verification that is needed is to assert that
there is at least one `backport/v*` label.
2024-03-30 13:35:56 +01:00
Earl Warren
ffdba30a62
[CI] backport strategy must fail when it conflicts
strategy: ort

The strategy is changed from "recursive" to "ort", which is the
default for git >= 2.43.2 and claims to reduce the likelyhood of
conflicts according to man git-merge:

> This has been reported to result in fewer merge conflicts without
> causing mismerges...

strategy-option: find-renames

The default option are the same for both strategies and "theirs" will:

> This option forces conflicting hunks to be auto-resolved
> cleanly by favoring their version.

"their" being whatever is not in the commits being cherry-picked.

In the context of Forgejo backports, this is not what is desired:
whenever a conflict happens it needs to be manually resolved and
prefering whatever is in the stable branch will not lead to a sane
backport.

It is changed back to "find-renames" which is documented to be the
default:

> Turn on rename detection, optionally setting the similarity
> threshold. This is the default.

Fixes: https://codeberg.org/forgejo/forgejo/issues/2886
2024-03-30 10:34:23 +01:00
Earl Warren
f326f14da7
[CI] backport: do no nothing if there are no backport labels 2024-03-24 07:52:00 +01:00
Earl Warren
549720bbef
[CI] backport PRs with the label backport/v* 2024-03-23 11:43:55 +01:00