Add protected branches configuration for main branch#642
Conversation
Signed-off-by: Dave Fisher <dave2wave@comcast.net>
raboof
left a comment
There was a problem hiding this comment.
LGTM but would be good to have an infra confirmation as well
Agree -> required_approving_review_count = 1 likely. |
|
Pulsar has some interesting notes about CI workflows these go with their |
Add required status checks and pull request review settings for the main branch. Signed-off-by: Dave Fisher <dave2wave@comcast.net>
kevinjqliu
left a comment
There was a problem hiding this comment.
not sure if we want to set require_code_owner_reviews, everything else looks good to me
|
We do not have CODEOWNERS here ? Do we ? So I guess |
Signed-off-by: Dave Fisher <dave2wave@comcast.net>
raboof
left a comment
There was a problem hiding this comment.
I'm +1 on the concepts and on trying this out, though we should be ready to revert if it turns out it prevents the asfgit automated commits on this repo.
kevinjqliu
left a comment
There was a problem hiding this comment.
LGTM!
Lets track to see if asfgit can still push to main after this is merged
Ah... It won't be able to - when branches are protected, bots cannot push to - it - that is a major blocker. |
|
The only solution for that (and possibly a good one) would be that the fix creates a PR that we have to merge manually |
|
Looks like it depends on what
Could you run these to see if Another possible solution is to allowlist |
I think that would create too much work tbh
I see this token apparently is indeed admin. perhaps we should consider switching to a non-admin token.
That seems like a much nicer solution |
Indeed - if it will work. I remember a change in GitHub that blanket-disabled bots from being able to bypass the "pull request approval" limitation of protected branches. but maybe this is a way to bypass it. |
|
I'll add this. Let's wait until Monday to merge and test, |
Signed-off-by: Dave Fisher <dave2wave@comcast.net>
This reverts commit 1faf75d.
This fails because this feature is in the new |
filed apache/infrastructure-asfyaml#92 ... but it's not a blocker for this PR since asfgit is currently still an admin token, if I understand correctly, right? |
That's correct. |
That's weird, I see the |
|
The first step is actually to add the settings in asfyaml |
I was incorrect. Each feature desired has to be programed. There are several different PRs waiting about branch protection. This will need to get sorted out over there soon. |
|
The workflow that updates Example: https://github.com/apache/infrastructure-actions/actions/runs/24166144405/job/70528047649 |
|
Yeah. I think it's exactly what I thought will happen: #642 (comment) @raboof @dave2wave -> WDYT? should we revert the protection or rather make the action create a PR that we will have to merge manually ? There is a small issue with the second solution - it will not run workflows by default (when PR is created by a workflow, it cannot start another workflow), so what we do in Airflow, we create Draft PR, and someone has to undraft it -> and this triggers the workflows, then you have to merge it. That adds more of manual operations (but simple ones). I would be for that more safer solution. |
|
A fix to merge the missed updates #689 until we decide. |
|
Thanks @adoroszlai for notifying us! |
Yeah, this was one we saw coming ;) - thanks for highlighting though!
I'm all in favor of 'safer' options, but am not fully convinced creating a PR for every action approval or expiry will end up 'safer':
I'm reluctantly OK with giving it a try - but not sure how we'd measure success or failure. I'm pretty sure I'd prefer the |
I guess we'd want to ask Infra for a 'fine-grained PAT' that only gives write access to this repo, and then list the account associated with that PAT in |
|
You would also need to ask Infra to setup |
Well, we can PR that ourselves, but indeed they'd need to review ;) . (linking apache/infrastructure-asfyaml#92 for reference) |
|
Realistically I think we should revert this change until we've either done the refactor to have asfgit create PRs, or implemented the bypass_pull_request_allowances approach. |
|
See #692 |
As @potiuk suggested in #638