feat: add getCheckRunByName to look up check run ID by commit ref and…#109
feat: add getCheckRunByName to look up check run ID by commit ref and…#109HarshMN2345 wants to merge 3 commits into
Conversation
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge; the new method is additive, follows established patterns, and is guarded by a thorough integration test suite. The implementation is a straightforward additive read-only API call with no mutation risk. The silent-zero-on-error contract is intentional, well-documented in code comments, and exercised by a dedicated test. The five integration tests cover all the meaningful branches. No files require special attention. The Important Files Changed
Reviews (1): Last reviewed commit: "test: rewrite getCheckRunByName tests — ..." | Re-trigger Greptile |
| status: 'in_progress', | ||
| ); | ||
|
|
||
| $this->assertGreaterThan($first['id'], $second['id']); |
There was a problem hiding this comment.
The
assertGreaterThan before calling getCheckRunByName is used to validate that GitHub assigned a higher ID to the second run, but it's also a load-bearing pre-condition of the test: if GitHub ever returns equal IDs (e.g. the same check run was deduplicated), the assertion fails before the actual behavior is exercised. Swapping the argument order also silently inverts the comparison — assertGreaterThan($expected, $actual) means "assert that $expected > $actual", so assertGreaterThan($first['id'], $second['id']) asserts that $first['id'] > $second['id'], which is the opposite of what the comment says. Here the call is correct as written — but consider using assertLessThan for clarity: assertLessThan($second['id'], $first['id']) reads more naturally as "first is less than second".
| $this->assertGreaterThan($first['id'], $second['id']); | |
| $this->assertLessThan($second['id'], $first['id']); |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
… name