KhronosGroup / SPIRV-Tools

Apache License 2.0
1.08k stars 555 forks source link

Protecting main branch from wild push #4977

Closed Keenuts closed 1 year ago

Keenuts commented 1 year ago

The main branch is currently not protected, meaning anybody with write permission can push to it. As far as we know, this was only useful for the release process: one could create release commits to update changelog without having to wait for a review cycle. Maybe we could do without.

Proposition:

The second point is debatable, but would force us to maintain a green CI.

alan-baker commented 1 year ago

Definitely in favour of the first point. For the second I would omit a green requirement on the shaderc smoketest at least.

Keenuts commented 1 year ago

Definitely in favour of the first point. For the second I would omit a green requirement on the shaderc smoketest at least.

Aren't you afraid of the "red test fatigue"? The log is long, and we could easily miss a real failure in-between the multiple version failures to take today's example.

alan-baker commented 1 year ago

That test is an integration test though. Sometimes failures require multiple repos to be updated. It seems unnecessarily onerous that SPIRV-Tools PRs can't be merged because a bug exists in multiple places.

Keenuts commented 1 year ago

Ok, thanks for the input, so what about those rules:

(https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/managing-a-branch-protection-rule)

alan-baker commented 1 year ago

That sounds reasonable to me.

@dneto0 @dnovillo any thoughts?

dnovillo commented 1 year ago

That sounds reasonable to me.

@dneto0 @dnovillo any thoughts?

+1 - This looks reasonable to me.

alan-baker commented 1 year ago

Given #4981 maybe we should change:

Require branches to be up to date before merging: false

To true for a month or so to avoid merging based on the old headers.

Keenuts commented 1 year ago

Given #4981 maybe we should change:

Require branches to be up to date before merging: false

To true for a month or so to avoid merging based on the old headers.

I was hesitant on that. Because enforcing that & approval drop on push means:

alan-baker commented 1 year ago

I can certainly ensure that PR is up-to-date, but if others have PRs that are based before it, the bots won't flag them as needing rebased.

Keenuts commented 1 year ago

Ok, see your point.

@vettoreldaniele since you are admin: could you apply the following rules (https://github.com/KhronosGroup/SPIRV-Tools/issues/4977#issuecomment-1300306177) except the "Require branches to be up to date before merging" which should be set to true ? (Adding reminder to disable this in a month)

vettoreldaniele commented 1 year ago

I applied those settings + required branches to be up to date before merging set to true.

Keenuts commented 1 year ago

@alan-baker : is it OK for you if we drop the requirement for up-to-date branch now?

Keenuts commented 1 year ago

@vettoreldaniele do you have the rights to change this setting back to "don't require"?

vettoreldaniele commented 1 year ago

@vettoreldaniele do you have the rights to change this setting back to "don't require"?

Done.