Beispiel #1
0
def get_summary_from_sha(ctxt, sha):
    checks = check_api.get_checks_for_ref(
        ctxt,
        sha,
        check_name=ctxt.SUMMARY_NAME,
    )
    checks = [c for c in checks if c["app"]["id"] == config.INTEGRATION_ID]
    if checks:
        return checks[0]
Beispiel #2
0
def copy_summary_from_previous_head_sha(ctxt, sha):
    checks = check_api.get_checks_for_ref(
        ctxt,
        sha,
        check_name=actions_runner.SUMMARY_NAME,
    )
    checks = [c for c in checks if c["app"]["id"] == config.INTEGRATION_ID]
    if checks:
        check_api.set_check_run(
            ctxt,
            actions_runner.SUMMARY_NAME,
            "completed",
            "success",
            output={
                "title": checks[0]["output"]["title"],
                "summary": checks[0]["output"]["summary"],
            },
        )
        return True
    else:
        return False
Beispiel #3
0
def copy_summary_from_previous_head_sha(ctxt, sha):
    checks = check_api.get_checks_for_ref(
        ctxt, sha, check_name=actions_runner.SUMMARY_NAME,
    )
    checks = [c for c in checks if c["app"]["id"] == config.INTEGRATION_ID]

    if not checks:
        ctxt.log.warning(
            "Got synchronize event but didn't find Summary on previous head sha",
        )
        return
    check_api.set_check_run(
        ctxt,
        actions_runner.SUMMARY_NAME,
        "completed",
        "success",
        output={
            "title": checks[0]["output"]["title"],
            "summary": checks[0]["output"]["summary"],
        },
    )
Beispiel #4
0
def copy_summary_from_previous_head_sha(g_pull, sha):
    checks = check_api.get_checks_for_ref(
        g_pull.base.repo,
        sha,
        {"check_name": actions_runner.SUMMARY_NAME},
        mergify_only=True,
    )
    if not checks:
        g_pull.log.warning(
            "Got synchronize event but didn't find Summary on previous head sha",
        )
        return
    check_api.set_check_run(
        g_pull,
        actions_runner.SUMMARY_NAME,
        "completed",
        "success",
        output={
            "title": checks[0].output["title"],
            "summary": checks[0].output["summary"],
        },
    )
Beispiel #5
0
def copy_summary_from_previous_head_sha(ctxt, sha):
    checks = check_api.get_checks_for_ref(
        ctxt,
        sha,
        mergify_only=True,
        check_name=actions_runner.SUMMARY_NAME,
    )
    if not checks:
        ctxt.log.warning(
            "Got synchronize event but didn't find Summary on previous head sha",
        )
        return
    check_api.set_check_run(
        ctxt,
        actions_runner.SUMMARY_NAME,
        "completed",
        "success",
        output={
            "title": checks[0]["output"]["title"],
            "summary": checks[0]["output"]["summary"],
        },
    )
Beispiel #6
0
 def pull_check_runs(self):
     return check_api.get_checks_for_ref(self, self.pull["head"]["sha"])
Beispiel #7
0
 def pull_check_runs(self) -> typing.List[github_types.GitHubCheckRun]:
     return check_api.get_checks_for_ref(self, self.pull["head"]["sha"])