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

Jc/verbose num of approvers needed #36

Merged
merged 5 commits into from
Dec 10, 2018

Conversation

jmcampanini
Copy link
Member

Display in the policy UI how many approvals are required in total for a rule to pass.

@@ -207,7 +207,7 @@ func (r *Rule) IsApproved(ctx context.Context, prctx pull.Context) (bool, string
return false, msg, nil
}

msg := fmt.Sprintf("%s needed", numberOfApprovals(remaining))
msg := fmt.Sprintf("%s needed (of required %d)", numberOfApprovals(remaining), r.Requires.Count)
Copy link
Member

@bluekeyes bluekeyes Dec 5, 2018

Choose a reason for hiding this comment

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

What do you think about formatting this as 1/n approvals required? I supposed we'd have to change how numberOfApprovals works, but it might be more natural to read than the parenthetical suffix.

Related, should we update the message on L204 as well?

@jmcampanini
Copy link
Member Author

using "current/required approvals needed" messaging

numberOfApprovals(len(candidates)))
return false, msg, nil
}

msg := fmt.Sprintf("%s needed", numberOfApprovals(remaining))
msg := fmt.Sprintf("%d/%d approvals required", len(approvers), r.Requires.Count)
Copy link
Member

Choose a reason for hiding this comment

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

style: required vs. needed in the other message. I have a slight preference for "required", but mostly want them to match.

@jmcampanini jmcampanini merged commit bc5d2fa into develop Dec 10, 2018
@jmcampanini jmcampanini deleted the jc/verbose-num-of-approvers-needed branch December 10, 2018 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants