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

feat(approvals-satisfied): comment when PR does not meet approvals #631

Merged
merged 9 commits into from
Jul 10, 2024

Conversation

sjschmidt93
Copy link
Contributor

📝 Description

🔗 Related Issues

@sjschmidt93 sjschmidt93 requested a review from a team as a code owner July 9, 2024 21:20

if (!approvalsSatisfied) {
await createPrComment({
body: 'PRs must meet all required approvals before entering the merge queue.\n\n' + logsJoined
Copy link
Contributor

Choose a reason for hiding this comment

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

This helper doesn't only run in the context of the merge queue, so we should make the message more generic. Maybe like

Required approvals not satisfied: <logsJoined>

and we could pass the existing body input into this helper so the merge queue invocation can provide a merge queue-specific message too

core.info(logs.join('\n'));

if (!approvalsSatisfied) {
logs.unshift('Required approvals not satisfied:\n');
Copy link
Contributor Author

@sjschmidt93 sjschmidt93 Jul 10, 2024

Choose a reason for hiding this comment

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

never heard of unshift until now, but it is equal to ['Required approvals not satisifed', ...logs]!

Comment on lines 35 to 36
{ teams, users, number_of_reviewers = '1', required_review_overrides, pull_number }: ApprovalsSatisfied = {},
approvalsNotMetMessage: string | undefined = undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use the existing body input instead of this second argument for providing an optional comment body? approvalsSatisfied is a standalone action

}

export const approvalsSatisfied = async ({
teams,
users,
number_of_reviewers = '1',
required_review_overrides,
pull_number
pull_number,
approvals_not_met_message
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename to body and add this to the above interface?

@danadajian danadajian merged commit f0a4649 into ExpediaGroup:main Jul 10, 2024
6 of 9 checks passed
@danadajian
Copy link
Contributor

🎉 This PR is included in version 1.58.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants