-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repokitteh: Add
/coverage
command (#24288)
Signed-off-by: Ryan Northey <[email protected]>
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
COVERAGE_LINK_MESSAGE = """ | ||
Coverage for this Pull Request will be rendered here: | ||
https://storage.googleapis.com/envoy-pr/%s/coverage/index.html | ||
The coverage results are (re-)rendered each time the CI `envoy-presubmit (check linux_x64 coverage)` job completes. | ||
""" | ||
|
||
def should_add_coverage_link(action, issue_title): | ||
return ( | ||
action == 'opened' | ||
and issue_title.startswith("coverage:")) | ||
|
||
def add_coverage_link(issue_number): | ||
github.issue_create_comment(COVERAGE_LINK_MESSAGE % issue_number) | ||
|
||
def _pr(action, issue_number, issue_title): | ||
if should_add_coverage_link(action, issue_title): | ||
add_coverage_link(issue_number) | ||
|
||
def _add_coverage(issue_number): | ||
add_coverage_link(issue_number) | ||
|
||
handlers.pull_request(func=_pr) | ||
handlers.command(name='coverage', func=_add_coverage) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters