Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lift some k/website branch protections #30394

Closed

Conversation

sftim
Copy link
Contributor

@sftim sftim commented Aug 16, 2023

  • (Re)allow website admins to merge PRs even with failing checks
    • Motivated by a process issue for v1.28 where we had to track down a contributor and ask them to fix their list of linked email addresses within GitHub, so we could merge [a branch that included] their change.
  • Don't protect dev-* branches from deletion

@kubernetes/sig-docs-leads FYI

This PR partially reverts #28789

- Allow website admins to merge PRs even with failing checks
- Don't protect dev-* branches from deletion
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. area/config Issues or PRs related to code in /config sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Aug 16, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sftim
Once this PR has been reviewed and has the lgtm label, please assign cblecker for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sftim
Copy link
Contributor Author

sftim commented Aug 16, 2023

Prompted by kubernetes/website#41545 - I can't delete dev-1.17-ru.1

@divya-mohan0209
Copy link
Contributor

Thanks for this @sftim !

@sftim
Copy link
Contributor Author

sftim commented Aug 16, 2023

I'm not very experienced configuring Prow - extra views welcome; please don't assume I got this change right.

Copy link
Member

@Rishit-dagli Rishit-dagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just putting it out there that I think this PR should probably be accompanied with a change to https://github.com/kubernetes/sig-release.

contexts:
- EasyCLA
exclude:
- "^dev-" # don't protect dev branches
Copy link
Member

@Rishit-dagli Rishit-dagli Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs release team handbook used to mention explicitly to protect the dev- branch: https://github.com/kubernetes/sig-release/blob/e57c4d957e371dd9a96dc7ba0ae8b5cadd5928bd/release-team/role-handbooks/docs/Release-Timeline.md#enable-branch-protection . This was only recently removed by me assuming that all branches are protected by default, however the new docs role handbook still says the branch should be protected (https://github.com/kubernetes/sig-release/blob/master/release-team/role-handbooks/docs/Release-Timeline.md#modify-prow-config-file):

e.g. Create a #21727 against k/test-infra to configure prow to automatically apply milestones to future release branch and to remove the configuration for the last release e.g. Add branch protection and milestone applier for k/website.

This might seem misleading to readers of the handbook after this change (since the handbook mentions that you still have branch protection for dev-).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prow experts,
Can we explicitly add dev- branches to have branch protection?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, all branches would be protected. Is there something special about this branch that it shouldn't have that protection?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to be able to delete a localization branch - see #30394 (comment)

I don't know how we delete stale localization branches nor how we delete the dev branches for previous releases. Is there a process that can work without making this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another example for deleting specific branches in k/website
At the end of the 1.27 release cycle, a release-1.27 branch was incorrectly made so I deleted it
The same thing happened last week for the 1.28 release cycle, a release-1.28 branch was incorrectly made and now we have to delete it before the end of the 1.29 release cycle (which is months away at this point)

@@ -466,6 +466,12 @@ branch-protection:
- stage-bots
website:
protect: true
enforce_admins: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is concerning because it would allow bypass of CLA.

What kinds of checks are failing that we would need admins to have a green merge button and not go through tide?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had this happen for v1.28: a contributor whose CLA checks had previously passed changed his details within GitHub, which meant that the commits we'd merged into dev-1.28 weren't seen (by the CLA bot) as valid to merge from dev-1.28 into main.

We always bypass Tide for the actual docs change on release day, but we still need a green button to click.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allow admins to bypass this rule? I can't decide, but I do trust repository admins to use this privilege only with care.

@sftim
Copy link
Contributor Author

sftim commented Aug 18, 2023

/retitle Lift some k/website branch protections

@k8s-ci-robot k8s-ci-robot changed the title List some k/website branch protections Lift some k/website branch protections Aug 18, 2023
@sftim
Copy link
Contributor Author

sftim commented Oct 29, 2023

What needs to happen to get this PR merged?

@Priyankasaggu11929
Copy link
Member

cc: @kubernetes/owners for review.

@seokho-son
Copy link
Member

Hi folks! I am one of the SIG-Docs Localization Subproject Leads.
For the localization teams in SIG-Docs, it's necessary to remove stale dev-branches in the k/website, such as:

  • dev-1.25-ko.1
  • dev-1.23-ko.3
  • dev-1.22-ko.1
  • dev-1.19-ja.1
  • dev-1.18-ja.2
  • dev-1.17-ru.1
  • ...

While some localization teams are actively creating and using dev branches in k/website, they are unable to remove stale ones due to the You can't delete this protected branch :)
(maintainers cannot remove it too)

We are looking for a way to easily remove dev branches.

@mrbobbytables
Copy link
Member

A repo admin for the k/website repo can remove the branches, they just have to delete the auto-created branch protection rule in the settings first. This can be done without having to change any configs here in k/test-infra.

@sftim
Copy link
Contributor Author

sftim commented Dec 12, 2023

What needs to happen to get this PR merged?

I cannot work out which feedback is ”I don't understand this, please clarify” and which feedback is ”we have the context, and we won't make that change”.

@mrbobbytables
Copy link
Member

@sftim I'm not sure if it's actually needed. A repo admin can delete branches or force a merge. The only thing is it'd require updating or removing the branch protection rules through the UI when an incident occurs. It does mean there would be an extra step, but would also prevent any accidental type things from happening.

@sftim
Copy link
Contributor Author

sftim commented Dec 12, 2023

We might want to make sure that a repo admin is available for each release day (and document that).

@sftim
Copy link
Contributor Author

sftim commented Dec 12, 2023

or change these rules so they are in place most of the time but not on release day

@cblecker
Copy link
Member

cblecker commented Dec 12, 2023

+1 to @mrbobbytables's comments

We might want to make sure that a repo admin is available for each release day (and document that)

+1

@sftim
Copy link
Contributor Author

sftim commented Dec 13, 2023

OK. This isn't needed; instead, we (SIG Release / SIG Docs especially) need to plan releases around the availability of a repository admin.

/close

@k8s-ci-robot
Copy link
Contributor

@sftim: Closed this PR.

In response to this:

OK. This isn't needed; instead, we (SIG Release / SIG Docs especially) need to plan releases around the availability of a repository admin.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config Issues or PRs related to code in /config cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants