Hi,

A few weeks ago we added branch protection rules to the repository.
You can see the current rules in https://github.com/apache/kafka/rules/4026327

One of the rules we have is "Require linear history" which "Prevent
merge commits from being pushed to matching refs.". The issue is that
we have 1 merge commit (from 2018!) in our tree:
https://github.com/apache/kafka/commit/92529ac6d8c117f1704d84f94f18b9497707a1b5

This effectively prevents us from creating new branches as it violates
the linear history rule. I was getting the following error when
pushing the new 4.1 branch:
remote: remote: error: GH013: Repository rule violations found for
refs/heads/4.1.
remote: remote: Review all repository rules at
https://github.com/apache/kafka/rules?ref=refs%2Fheads%2F4.1
remote: remote:
remote: remote: - This branch must not contain merge commits.
remote: remote:   Found 1 violation:
remote: remote:
remote: remote:   92529ac6d8c117f1704d84f94f18b9497707a1b5
remote: remote:
remote: To github:apache/kafka.git
remote:  ! [remote rejected]
465b01cd2cf378e825bc63f2cf34086215439b93 -> 4.1 (push declined due to
repository rule violations)

To workaround the issue, the ASF Infra team temporarily disabled the
rule to let me push the new branch. The rule has now been re-enabled.

As things stands today, this will be an issue again in ~4 months when
we cut the next release branch. It seems Infra wants to give projects
control over the rules they use but it's unclear if this will be
available before our next release. See the discussion in
https://issues.apache.org/jira/browse/INFRA-26900

Thanks,
Mickael

Reply via email to