Skip to content

Commit

Permalink
repokitteh: Add /coverage command (#24288)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax authored Jan 9, 2023
1 parent a77335a commit 9c9d1ec
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ci/repokitteh/modules/coverage.star
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)
1 change: 1 addition & 0 deletions repokitteh.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use("github.com/repokitteh/modules/assign.star")
use("github.com/repokitteh/modules/review.star")
use("github.com/repokitteh/modules/wait.star")
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/azure_pipelines.star", secret_token=get_secret('azp_token'))
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/coverage.star")
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/docs.star")
use("github.com/envoyproxy/envoy/ci/repokitteh/modules/newpr.star")
use(
Expand Down

0 comments on commit 9c9d1ec

Please sign in to comment.