-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
tide should merge elafros PRs automatically #543
Comments
and looks like https://prow-internal.gcpnode.com/tide points to external k8s repos |
#528 is in the pool, that is why it is referenced in the #485 is failing to merge with this message CODEOWNERS may still be used to request reviews, but Github must not be configured to require reviews from CODEOWNERS in order for Tide to work properly. Someone with admin access to the repo will need to remove this requirement. |
Followup on #485: @evankanderson was incorrectly omitted from @elafros/elafros-writers, so his approval was not counted as approval from that team. Upon adding him to the team, the PR became mergeable and was immediately merged by Tide. |
@grantr The Github merge requirements for the repo still need to be changed. Tide will get stuck trying to merge a PR if that PR meets all the merge requirements it know about, but is subject to another CODEOWNER review merge requirement that it doesn't know about. |
@cjwagner Can you help me understand what happens when Tide gets stuck? In this case, the observed behavior from the PR side seemed correct: the PR was merged as soon as merging was possible. |
Tide is 'stuck' in the sense that it continually tries to merge that PR without success. So the observed behavior on that PR is appropriate, the problem is that other PRs were blocked while Tide repeatedly tried and failed to merge that PR. |
Ah I see, thanks @cjwagner for explaining. That's definitely an issue. |
@cjwagner is it possible for the Tide sync loop to skip PRs that are not able to be merged? |
As far as Tide is concerned, that PR is mergeable which is why it continues to attempt to merge. We could keep a cache of PRs that have failed to be merged and ignore them, but that introduces its own problems:
It is simpler and more fault tolerant for Tide to understand the merge requirements itself instead of relying on empirically tested mergeability. |
Tide appears capable of detecting this particular case though, since the error from the GitHub API states the reason for the lack of mergeability: This seems distinguishable from transient errors like network failures or rate limiting. |
We would need to specifically handle each of the different error messages (which are not documented and could be changed) that could occur from failing to merge a PR in order to properly add them to the cache of unmergeable PRs. This is necessary because some Github errors are improperly classified. For example, if PRs are being merged too quickly we receive a 405 error saying "Base branch was modified" even though this isn't a request error. Even if we did that, Tide doesn't have any way to know when a PR becomes mergeable again after receiving a merge error like this so if we removed it from the pool it would never be considered for merge again. |
So, looks like there's no action to be taken here? |
Was the Github CODEOWNERS review requirement disabled? |
Tide is doing what it's supposed to do. This is exactly the CODEOWNERS x OWNERS mixup that is discussed in this thread. @grantr what's the decision about CODEOWNERS? I see 3 options here:
For (1) we can hopefully prioritize the work on feature request 75956445 and have prow use only CODEOWNERS. |
@adrcunha Prow uses OWNERS files instead of CODEOWNERS because CODEOWNERS files cannot be specified per directory, there is only one CODEOWNERS file per org/repo:branch. For large repos with many contributors it is necessary to split up code ownership config instead of using a single monolithic config file in order to avoid a review bottle neck and support more granular permissions on the ownership config itself. |
Thanks, Cole. Actually my last sentence missed an important scope definition: I actually meant "and have prow use only CODEOWNERS for Elafros". Feature request 75956445 is about adding such feature, not replacing the current OWNERS mechanism (which would be a pretty bad breaking change for existing projects). |
@adrcunha it doesn't sound like 1 is really workable without fixing the bug you mention, since any PR with "single approval" blocks the auto-merge of all other "double approval" PRs. Option 2 seems to actually be "Remove the CODEOWNERS review requirement and remove merge access from humans," since without the review requirement it would be possible to merge unreviewed code. We had a discussion about options 2 and 3 in an internal chat that I'll summarize here: There is no correctness difference between auto-merge and the merge button as long as GitHub is configured to require PRs to be up to date before merging. This configuration means that whenever master is updated, any outstanding PRs must first merge master before they can be merged (i.e. it must be a fast-forward merge). Merging master into a PR invalidates any existing status checks (same as a push), so those status checks must pass again before the merge button is enabled. The consequence is that test runtime sets an upper bound on the rate of PR merges: if tests take 5 minutes to run, only one PR can be merged every 5 minutes. In my own experience, this sets up a constant struggle to keep test runtime low. This can be a good thing, since fast tests are easier to run locally with a faster debug loop, but it's a significant time investment as both contributor count and test surface grow. Tide allows decoupling test runtime from merge rate. When Tide controls all merge decisions, it can use optimizations like only running tests for the PR at the front of the queue, or batching up multiple PRs into a single test run. My thoughtsKubernetes, with its massive test surface and extremely large community, requires the Tide decoupling of test runtime from PR merge rate. I doubt Elafros' need for Tide's optimizations will ever be as great, but it might still be convenient to worry less about long test runtimes. I prefer the GitHub review flow to Prow's because it's better integrated into the GitHub UI, generates less email (fewer command comments), and is more discoverable for new users. I prefer Prow's reviewer suggestions to GitHub's code owners suggestions - GitHub sends an email to every owner which generates a lot of noise. I prefer the single CODEOWNERS file to the per-directory OWNERS files because the single file offers a complete overview of the project's ownership areas at a glance. As @cjwagner mentions, the overview convenience of the single file is ultimately outweighed by the bottleneck of managing it for a large project like Kubernetes. Plus, the top-level overview could be auto-generated from OWNERS files. Possible compromise?My preference would be option 2 with some (hopefully minor) changes to Prow and Tide to adapt to the GitHub review flow. Here's one way to do that, though certainly not the only way. First, make the Prow robot the only code owner of every file in Instead of using Tide searches for ready-to-merge PRs using the query |
Oops this fell off my radar as well. I can't tell exactly what is being suggested, these sentences seem to conflict:
@grantr Are you suggesting using OWNERS file data about |
@cjwagner the former. GitHub allows anyone with access to a repo to review a PR (I think), so the existence of any approving review isn't enough for Prow to consider the PR approved. However, Prow can use the Reviews API to cross-reference the list of approving reviewers with the list of approvers in OWNERS files, just like it does with comment authors today. The "Authors can't approve their own PRs" sentence is explaining that the effect of the above strategy is that a PR author cannot single-handedly cause Prow to consider a PR approved. The parenthetical is pointing out that I'm not sure what the current Prow behavior is: if an approver (as defined by an OWNERS file) authors a PR, does Prow consider that PR immediately approved, or does it wait for approval from another person? What qualifications does that person require, i.e. must they be a reviewer or approver in an OWNERS file? |
Can we just flip OFF the bit (in Github) that requires review by code owners, and flip ON the bit (in Github) that requires certain presubmits (e.g. "tide")? I feel like this small change, which we could literally make today, would go a long way towards alleviating some of the common confusion here. |
Cross-posting from #834 (comment) as another example of how GitHub codeowner behavior isn't optimal for us:
|
This is configurable via the
The approval process uses the
Prow doesn't implement any behavior related to CODEOWNERS files. I don't see why the proposed solution of making Prow a CODEOWNER of all files and reacting to PR reviews is better than the normal approval mechanism. Is this all so that approvers can leave an "Approved" Github review instead of typing |
Does kubernetes/test-infra#6738 solve this? |
No, that applies the |
The Prow as CODEOWNER solution decouples Prow automerge (which is essentially a test performance optimization) from Prow approval. That makes it possible to enable the merge button if repository owners so choose. |
Instead of making Prow a codeowner, an equivalent solution that requires only repo config changes is making the Tide status check required. Then we can drop the CODEOWNERS requirement. I still like the idea of Prow reviewing PRs to point out specific issues that are blocking merge, but that seems like a better fit for the upcoming checks API (if it ever becomes available outside the GitHub marketplace). So I recommend the following config changes for now:
/cc @elafros/elafros-admin for repo config access. @cjwagner points out that Tide runs merge and status check update concurrently, so the merge could fail if it's attempted before the status check update completes. In that case the merge will be retried 1 minute later. That seems acceptable to me. |
CODEOWNERS review were lifted, and checks are now enforced for elafros/build and elafros/elafros, which means:
|
Everything is now working smoothly, closing this issue, finally! :D Thanks all! |
I'll link here some Prow PRs that should improve our workflow when they're merged: kubernetes/test-infra#8086 makes an approving GitHub review equivalent to the kubernetes/test-infra#7742 allows reviewers to be chosen from the approvers list in |
Provisioning a volume might take longer than default 120s. Co-authored-by: Martin Gencur <mgencur@redhat.com>
one loop of log:
while #485 is because github context?
but #528 should be in the pool.. not sure why is that?
/assign
/assign @cjwagner
cc @adrcunha
The text was updated successfully, but these errors were encountered: