Skip to content

fix(riptide): report the reviewer account, stop dropping unpriced rollups - #186

Merged
trick77 merged 4 commits into
masterfrom
riptide-emit-fixes
Sep 8, 2026
Merged

trick77 merged 4 commits into
masterfrom
riptide-emit-fixes

Conversation

@trick77

@trick77 trick77 commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Two problems found while measuring 3.5 months of riptide data.

We looked like a human reviewer. Reviews are posted under an ordinary Bitbucket account, so riptide could not tell our comments apart from a person's. Being first to comment on nearly every PR within a minute, we pulled its code-review pickup-time metric from a real ~18 minutes down to 36 seconds. The rollup now carries reviewer_handle (BITBUCKET_USERNAME), which riptide uses to filter our comments out at read time.

An unpriced model silently withheld the whole PR record. emit_pr_completed returned early when total_cost_usd was None, logging at debug. Outcome, diff size, tokens and run count need no price, but they were dropped with it, and nothing surfaced that it was happening. The rollup is now always sent with the cost omitted (never zeroed, which would understate spend), and the unpriced path logs a warning naming the models.

Deploy riptide first

trick77/riptide#66 must be deployed before this version. The riptide rollup schema forbids unknown fields, so a collector without reviewer_handle rejects every rollup with 422, not only the ones carrying a new field. Rejected rollups are not retried: the PR is stamped as emitted when it is claimed, so everything closed in that window is lost.

Tests: 649 pass locally.

…lups

Two problems found while measuring 3.5 months of riptide data.

We post reviews under an ordinary Bitbucket account, so riptide could not tell
our comments apart from a human's. Being first to comment on almost every PR
within a minute, we drove its code-review pickup-time metric from ~18 minutes
to 36 seconds. The rollup now carries reviewer_handle (BITBUCKET_USERNAME) and
riptide filters us out at read time.

A rollup with no cost was dropped entirely and logged at debug, so a model the
gateway cannot price silently withheld the whole PR record - outcome, diff
size, tokens and runs included, none of which need a price. The rollup is now
always sent, with the cost omitted rather than zeroed, and the unpriced case
logs a warning naming the models.

Needs riptide with optional total_cost_usd and reviewer_handle support.
A collector predating reviewer_handle rejects every rollup, not just the ones
with a new field, and a rejected rollup is never retried.
riptide should not have to assume that a reported account is automation, so
we say so explicitly. The handle stays because the review comments reach
riptide from Bitbucket, where we are just another user.
riptide now distinguishes bot from service accounts; we are a bot.
@trick77
trick77 merged commit be8502a into master Sep 8, 2026
2 checks passed
@trick77
trick77 deleted the riptide-emit-fixes branch September 8, 2026 13:51
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.

1 participant