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: Add last comment validator #668

Merged
merged 2 commits into from
Sep 30, 2022

Conversation

cuong-tech
Copy link
Contributor

Originally I thought this could be implemented as a filter (#639), but after giving it more thoughts, validator makes more sense.

The use case here is that developers can add a comment merge to trigger the merge action.

GIF

merge

Thanks to Bloomberg L.P. for letting us contribute to Mergeable.

Comment on lines +22 to +27
test.each([
undefined,
'pull_request_review',
'check_suite',
'issue_comment'
])('check that merge is called for %s events', async (eventName) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

small refactor to reduce code duplication

if (context.eventName === 'issues') { // event name is 'issues' but payload contain 'issue'
if (context.eventName === 'issues' || context.eventName === 'issue_comment') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove comment as it seems a bit redundant

@cuong-tech
Copy link
Contributor Author

@jusx @shine2lay could you take a look? 🙏

Copy link
Member

@shine2lay shine2lay left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Base: 92.95% // Head: 92.97% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (e5b22dc) compared to base (7b8f60f).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #668      +/-   ##
==========================================
+ Coverage   92.95%   92.97%   +0.02%     
==========================================
  Files         106      107       +1     
  Lines        2441     2448       +7     
  Branches      441      441              
==========================================
+ Hits         2269     2276       +7     
  Misses        153      153              
  Partials       19       19              
Impacted Files Coverage Δ
lib/actions/merge.js 97.05% <ø> (ø)
lib/filters/payload.js 100.00% <ø> (ø)
lib/eventAware.js 100.00% <100.00%> (ø)
lib/validators/lastComment.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@shine2lay shine2lay merged commit 3c3fe59 into mergeability:master Sep 30, 2022
@github-actions
Copy link

🎉 This PR is included in version 2.14.0 🎉

The release is available on:

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