RFR: 1173: Dependent PR feature does not work with protected branches in newer Gitlab version [v2]

Erik Joelsson erikj at openjdk.org
Tue Jan 3 17:37:18 UTC 2023

> In GitLab, if a branch is protected, it cannot be removed. This is preventing us from using the pr/X feature of Skara to support dependent pull requests. This patch adds the ability to dynamically protect and unprotect branch patterns when creating pr/X branches. This is controlled with a new configuration option on the prbranch notifier like this:
>         "prbranch": {
>           "protect": true,
>         },
> The semantics needed for GitLab is to first add a pattern based protection rule, then create the branch. Unfortunately, I couldn't easily implement the same semantics for GitHubRepository. The REST API for branch protection in GitHub doesn't allow patterns, only existing branches. It could probably be done using GraphQL, but given how complicated that would be to implement, I chose not to, since we don't actually need this feature on GitHub. (GitHub branch protection is flexible enough so we can have a static configuration that allows admins to delete branches, and this is already in use today)
> I have tested the basic branch protection functionality using the new manual test and I have run the notifier bot with the new configuration against a playground repository in GitLab and manually created and closed PRs.

Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision:

  Fix import


  - all: https://git.openjdk.org/skara/pull/1452/files
  - new: https://git.openjdk.org/skara/pull/1452/files/43322c9f..68619fab

 - full: https://webrevs.openjdk.org/?repo=skara&pr=1452&range=01
 - incr: https://webrevs.openjdk.org/?repo=skara&pr=1452&range=00-01

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/skara/pull/1452.diff
  Fetch: git fetch https://git.openjdk.org/skara pull/1452/head:pull/1452

PR: https://git.openjdk.org/skara/pull/1452

More information about the skara-dev mailing list