Skip to content

feat: add createCheckRun for Check Runs API#107

Merged
HarshMN2345 merged 18 commits into
mainfrom
feat/create-check-run
May 29, 2026
Merged

feat: add createCheckRun for Check Runs API#107
HarshMN2345 merged 18 commits into
mainfrom
feat/create-check-run

Conversation

@HarshMN2345
Copy link
Copy Markdown
Member

Add createCheckRun() method to post a completed check run with a given conclusion (neutral, success, failure, etc.) using the GitHub Check Runs API, which supports richer conclusions than the legacy Commit Status API.

Add createCheckRun() method to post a completed check run with a given
conclusion (neutral, success, failure, etc.) using the GitHub Check Runs
API, which supports richer conclusions than the legacy Commit Status API.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 26, 2026

Greptile Summary

This PR adds three new methods — createCheckRun, getCheckRun, and updateCheckRun — to both the base Adapter class and the GitHub implementation, enabling use of the richer GitHub Checks API alongside the existing commit-status API.

  • createCheckRun / updateCheckRun correctly guard status=completedconclusion consistency, auto-populate completed_at when a conclusion is provided, require both output.title and output.summary before sending the output block, and check HTTP response codes in all three methods.
  • Tests cover in-progress runs, completed one-shot runs, invalid-repository/ID error paths, and the missing-conclusion guard using finally blocks for cleanup.
  • Minor docblock drift: the base-class createCheckRun comment still advertises only queued/in_progress statuses, while the signature (and GitHub override) already support completed + conclusion directly. The updateCheckRun docblock in GitHub.php is also missing the @param $actions entry.

Confidence Score: 5/5

Safe to merge — all three new methods handle the GitHub Checks API constraints correctly and the integration tests cover the main failure paths.

All the substantive issues raised in earlier review rounds have been addressed in this revision. The only remaining findings are docblock inaccuracies that do not affect runtime behavior.

The createCheckRun docblock in src/VCS/Adapter.php still describes a narrower interface than what is implemented, which could mislead future callers.

Important Files Changed

Filename Overview
src/VCS/Adapter.php Adds createCheckRun, getCheckRun, and updateCheckRun default methods. Signatures now match the GitHub override, but the createCheckRun docblock still describes a narrower contract than what the method supports.
src/VCS/Adapter/Git/GitHub.php Implements createCheckRun, getCheckRun, and updateCheckRun for the GitHub Checks API. Guards for conclusion/status consistency are in place, completed_at is auto-set, HTTP error codes are checked in all three methods, and the output block requires both title and summary before inclusion.
tests/VCS/Adapter/GitHubTest.php Good integration-test coverage including happy paths, invalid-repository/id cases, completed check runs, and the missing-conclusion guard. All tests use finally blocks to clean up created repositories.

Reviews (12): Last reviewed commit: "fix: guard against status=completed with..." | Re-trigger Greptile

Comment thread src/VCS/Adapter/Git/GitHub.php Outdated
Comment thread src/VCS/Adapter/Git/GitHub.php Outdated
@HarshMN2345 HarshMN2345 self-assigned this May 26, 2026
Comment thread tests/VCS/Adapter/GitHubTest.php Outdated
'Deployment skipped because the commit message contains a skip pattern.'
);

$this->assertTrue(true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets avoid doing that - lets something we can assert.

If there is nothing, lets also add getCheckRun

Comment thread src/VCS/Adapter/Git/GitHub.php
Comment thread src/VCS/Adapter/Git/GitHub.php Outdated
'status' => 'completed',
'conclusion' => $conclusion,
'completed_at' => gmdate('Y-m-d\TH:i:s\Z'),
'output' => [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also has text, annotations, images..

Comment thread src/VCS/Adapter/Git/GitHub.php Outdated
Comment thread src/VCS/Adapter/Git/GitHub.php Outdated
Comment thread src/VCS/Adapter/Git/GitHub.php
@HarshMN2345 HarshMN2345 requested review from Meldiron and abnegate May 26, 2026 08:32
Comment thread tests/VCS/Adapter/GitHubTest.php
Comment thread tests/VCS/Adapter/GitHubTest.php
Comment thread tests/VCS/Adapter/GitHubTest.php
Comment thread tests/VCS/Adapter/GitHubTest.php
Comment thread tests/VCS/Adapter/GitHubTest.php
Add conclusion and completedAt params to createCheckRun to support
one-shot completed runs; expand test assertions to cover all response
fields; add failure tests (invalid repo, invalid ID) and multi-run
tests (two runs on same commit, same name on different commits).
Comment thread src/VCS/Adapter.php
Comment thread src/VCS/Adapter/Git/GitHub.php
Comment thread src/VCS/Adapter/Git/GitHub.php
@HarshMN2345 HarshMN2345 requested a review from Meldiron May 28, 2026 08:17
@HarshMN2345 HarshMN2345 merged commit 59b6483 into main May 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants