Repository navigation
ci(review): wait for Codecov before the review reads CI - #163
Merged
Merged
Conversation
The review starts when Tests or Lint finishes, before Codecov reports codecov/patch and codecov/project, so require_ci_green read CI without coverage, or skipped the review while Codecov was running. The policy now lists both in wait_for_checks, and the review waits for them for 300 s at most.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 62 62
Lines 3196 3196
=========================================
Hits 3196 3196
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
✅ Ready — Code reviewThis configuration makes code review wait for both Codecov checks before evaluating CI, preventing coverage failures from being missed. Version impact: none; it changes repository configuration only and touches no SDK public symbols. Rating patch 6/6 (exemplary) · proof 6/6 (comprehensive) · overall 6/6 Reviewed |
MarketDataDev01
approved these changes
Oct 2, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #162
What happened
The review starts when
TestsorLintfinishes, andrequire_ci_greenreads the head's check runs at that moment. Codecov reportscodecov/patchandcodecov/project35 to 50 seconds afterTests, and nothing starts a review when they finish. On #159 most reviews read CI before Codecov had reported, so a redcodecov/projectcould not stop them. One read landed while Codecov was running: that review skipped and came back only through a manual re-review. The measurements are in #162.The change
.github/code-review/policy.ymllists both checks inwait_for_checks, the key MarketData-App/code-review-bot#25 added (merged 2026-10-01). The review now waits until both exist and nothing on the head is still running, for 300 s at most (wait_for_checks_seconds, left at its default), and stops at once when CI is already red. The wait runs before the shared Codex credential is borrowed, so it holds the runner, not the lease. The comment over the key says what it does and what it costs a documentation-only pull request.The bot reads the policy from the base branch, so this applies to pull requests once it is on
main, and changes nothing for the open ones before that.Cost: a documentation-only pull request skips the suite, so Codecov never reports on it. Its review waits the 300 s cap and then skips, since
ignore_pathscovers every file it changes.Version impact
None: repository configuration only. No CHANGELOG entry.
Proof
Codecov reports as check runs, which is what the wait reads. On
da96b09, the head of #157,codecov/patchandcodecov/projectare check runs of thecodecovapp, and the commit has no statuses.The bot's own loader accepts this policy.
reviewbot.config.loadfrom code-review-bot at19247a3, the merge of MarketData-App/code-review-bot#25, on the policy of this branch, onmain's, and on two broken variants:The same loader at
082fe19, the bot'smainbefore that merge, rejects this policy withPolicyError: unknown policy key: wait_for_checks.code-review.ymlcalls the bot'sreview.yml@main, which has the key.The wait, run on a measured case.
7759248, a head of #159, is the -24 s row of #162: the review read CI undermain's policy at 18:02:43Z (thereviewbot runstep of run 36462367405), and Codecov completed at 18:03:06Z and 18:03:07Z. Its recorded check runs, with the start and completion times the GitHub API keeps, replayed through the bot's ownwait_for_checksandci_stateat19247a3, with the transport answering from the recording and a simulated clock that starts at 18:02:43Z:Under
main's policy the review reads a green CI that has no coverage in it, which is what happened on that head. Under this branch's policy it waits three polls of 10 s and reads CI with both Codecov checks in it.The same code against the live API, on this pull request's head
1f1ea6e. The bot'swait_for_checks, with the GitHub client reading the live check runs and the policy swapped for each file, started the momentTests passedcompleted:test (3.10)failed on theFloatingPointErrorof A pandas DataFrame with a null date can raise FloatingPointError at random #155, so both policies returned at once, this branch's withreviewbot wait: CI is already red on the head commit; nothing to wait for;ci_state=success.Checks.
uv run pytest -n 4 --cov=marketdata: 1959 passed, coverage 100% (3196 statements, 0 missed)../lint.shclean.git merge-treeis clean againstmainand every open pull request.Review round 1
Measured on 2026-10-01, on
1f1ea6e.Proof. The review asked for a dry run showing
main's policy reading CI before Codecov and this one waiting for the same checks, with the test count and coverage. All three are under Proof: the replay of7759248runs the two policies from the same instant on the same check runs, and the live runs on1f1ea6eshow the same code reading this pull request's checks.1f1ea6ealso adds one line to the comment over the key, on what the wait costs a documentation-only pull request.