-
Notifications
You must be signed in to change notification settings - Fork 109
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
bug: review approval dismissals are misleading when predicates are not satisfied #480
Comments
To make sure I understand: the rule with the Assuming that is accurate, this is something I did find a bit strange about the initial feature. How valuable is it to dismiss reviews that don't match a review comment pattern? To me, that feels more like getting an approval from someone on the wrong team (a case where the review is not dismissed), rather than a case where the review become invalid or stale (like it does if edited or if someone pushes a new commit.) Would it make sense to only dismiss reviews if they are edited or if new commits are pushed? I think that would solve this problem (at least the most confusion versions of it), but I'd have to think about how to implement it. I also have to think more about including reviews that match skipped rules. My initial reaction is that it feels wrong, because we otherwise exit evaluation pretty early for skipped rules. Doing partial evaluation beyond that point to get reviewers kind of breaks the the idea that skipped rules don't influence the result. |
No there are other rules in the policy using
I think it's very valuable for policies using
Doing so would reintroduce the situations where an approved review still shows up in the PR as green, but conflicts with policy bot's evaluated approval. This wouldn't be the end of the world since that's how it worked before anyway, but not the most ideal solution. With the current logic this could be easily implemented by just return nil in the fall through case for the reason function and then just continue in the reviews loop so that it doesn't call the dismissal mutation.
Yea, I haven't actually tried it, but I feel like based on the existing layout it could work, but I'll keep thinking about potential solutions because right now it's just broken as is because valid reviews are being dismissed just because stuff hasn't evaluated yet due to not meeting the condition of the predicate. |
To pick a solution here, I think it would help to clarify the purpose of review dismissals. Basically, how inaccurate or incomplete can they be before the feature stops being useful? On one side, it's clear that dismissing reviews that are valid and influence approval is not acceptable. But I'm finding it hard to think about the other side: how many (or which types of) reviews can we miss dismissing before the feature feels buggy and broken instead of helpful? Having no practical experience using the I ask because we never considered a version of review dismissal where it dismisses reviews from people who are not part of the set of allowed actors (for the record: I think that would be a bad feature), but we are considering variations on what happens when review comments do not match. If we do want to go ahead with dismissing reviews that don't match patterns, I can get behind making But to the point above about purpose, this defines dismissal as "dismiss all reviews that could not satisfy any rule under any condition." For policies where some rules set |
This is a really good point. Okay so the original intent here was to try and reduce some confusion around the disconnect between github's "approval" and policy bot's approval, to address the question some folks have around, "my PR was approved now why has the status not turned green to allow me to merge". I think this feature does a great job of that. Additionally, github's native dismissal feature is all or nothing, so I liked the feature because where some rules are still valid in a world where you have a policy with two rules and only one rule invalidates on push for example.
Yes, in my experience with the
You're right, I think my intent got foggy once I began developing the feature. It was titled, dismiss stale reviews, not dismiss non-satisfying reviews. The implementation of that purpose sounds scary, but I see what you mean by it feeling broken if it's not inclusive of everything. I started to creep in non-satisfying reviews by adding the github comment pattern piece, but maybe that doesn't belong there and it would be more suited as additional information in the details view instead. |
For example, the use case we saw had the status predicate:
Policy bot said that a review is dismissed because it didn't have a valid pattern. I think we should probably just allow review dismissals for results with a skipped evaluation assuming that evaluation will be triggered again when and if the predicate is ever satisfied.
In other words, if the status is skipped, then evaluation can't happen so there's no chance of accidentally allowing an approval that should have been dismissed, until a final evaluation happens.
I'm not sure it's the best approach or exactly the best way to implement, but it's what I got. What do you think?
/cc @bluekeyes
The text was updated successfully, but these errors were encountered: