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

Erik Joelsson erikj at openjdk.org
Fri Jan 13 21:09:53 UTC 2023

On Fri, 13 Jan 2023 18:31:27 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> Erik Joelsson has updated the pull request incrementally with one additional commit since the last revision:
>>   Fix import
> bots/notify/src/main/java/org/openjdk/skara/bots/notify/prbranch/PullRequestBranchNotifier.java line 61:
>> 59:             log.info("Creating new pull request pre-integration branch " + branch);
>> 60:             seedRepo.push(pr.headHash(), pr.repository().url(), branch, true);
>> 61:         } catch (IOException e) {
> I am wondering in the previous pushBranch, we didn't manually make the branch protected, but the branch pushed are protected, is this due to settings in GitLab?

Before this change, we relied on a static configuration for the repository with certain branch patterns being protected. When this change goes live, we will need to adjust those patterns so that they do not apply to pr/X branches. Not sure if this answers your question.

> bots/tester/src/test/java/org/openjdk/skara/bots/tester/InMemoryHostedRepository.java line 177:
>> 175:     @Override
>> 176:     public void protectBranchPattern(String ref) {
>> 177:     }
> The name of this method is protectBranchPattern, but I think it actually protects a specific branch rather than a pattern.

Hm, on GitLab the underlying call takes a pattern, but now that I think about it, on GitHub it doesn't. There you have to use GraphQL to add pattern based protection. I should change this method to reflect that. We aren't using patterns anyway.


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

More information about the skara-dev mailing list