Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Add more supported events to baseRef validator #598

Merged
merged 1 commit into from
Dec 2, 2021

Conversation

abid-mujtaba
Copy link
Contributor

@abid-mujtaba abid-mujtaba commented Nov 25, 2021

  • The auto-merge workflow (using the merge action) listens to
    check_suite.* events in addition to the more standard
    pull-request.* and pull_request_review.*.
    This workflow relies on branch protections to stop the merge while
    the check_suite is running.
    Since branch protections are usually setup only only on the
    default branch it means PRs that are targetting non-default
    branches are auto-merged by the workflow sometime before the check
    suite has even completed (if check_suite.* is used).
  • Add check_suite.* event support to the baseRef validator so that
    auto-merge can be limited to the default branch.
  • Add unit tests for check_suite events.
  • Fix prior bug in mockContext fixture when using the baseRef option.
    The passed in baseRef value was not being set in the context payload.
  • Addresses feature request: add validator for other Github checks in a PR #395 (specifically this comment)

@codecov
Copy link

codecov bot commented Nov 25, 2021

Codecov Report

Merging #598 (5a8732f) into master (577cc12) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #598      +/-   ##
==========================================
+ Coverage   92.80%   92.83%   +0.03%     
==========================================
  Files         106      106              
  Lines        2404     2416      +12     
  Branches      431      433       +2     
==========================================
+ Hits         2231     2243      +12     
  Misses        154      154              
  Partials       19       19              
Impacted Files Coverage Δ
lib/validators/baseRef.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 577cc12...5a8732f. Read the comment docs.

@abid-mujtaba abid-mujtaba changed the title Add more supported events to baseRef validator feat: Add more supported events to baseRef validator Nov 25, 2021
@abid-mujtaba abid-mujtaba force-pushed the feat/baseref-events branch 4 times, most recently from e1bd7fe to 65942cc Compare November 30, 2021 15:28
@abid-mujtaba
Copy link
Contributor Author

Thanks @shine2lay.

How do I get the codecov/project requirement to pass (re-run)? I think my git push --force-with-lease might have got it stuck.

@shine2lay
Copy link
Member

@abid-mujtaba just merged #594, can you please resolve conflict, maybe that may help with the codecov issue too

- The auto-merge workflow (using the `merge` action) listens to
  `check_suite.*` events in addition to the more standard
  `pull-request.*` and `pull_request_review.*`.
  This workflow relies on branch protections to stop the merge while
  the check_suite is running.
  Since branch protections are usually setup **only** only on the
  default branch it means PRs that are targetting non-default
  branches are auto-merged by the workflow sometime before the check
  suite has even completed (if `check_suite.*` is used).
- Add `check_suite.*` event support to the baseRef validator so that
  auto-merge can be limited to the default branch.
- If more than one pull request is associated with a check_suite the
  validator will validate ALL of them and only pass if ALL of them
  pass
- If NO pull requests are associated with a check_suite the validator
  considers this to be a failure since there is no baseRef to
  validate
- Add unit tests for check_suite events.
@abid-mujtaba
Copy link
Contributor Author

@shine2lay, rebased on master. No luck.

@abid-mujtaba
Copy link
Contributor Author

@shine2lay, seems to have gotten unstuck 😄. Ready to merge.

@shine2lay shine2lay merged commit a430400 into mergeability:master Dec 2, 2021
@github-actions
Copy link

github-actions bot commented Dec 2, 2021

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@abid-mujtaba abid-mujtaba deleted the feat/baseref-events branch December 2, 2021 16:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants