Repository navigation
Conversation
Signed-off-by: anilb <epipav@gmail.com>
|
|
PR SummaryLow Risk Overview A new Reviewed by Cursor Bugbot for commit 23dd1a8. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@greptileai review |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the scoped Gerrit lookup optimization.
No open issues 🎉
What changed in this PR
Optimizes the Tinybird patchsets_per_review metric by narrowing repository lookups and pull request reads to Gerrit channels within the requested project or collection.
Changes:
- Replaces the Gerrit segment lookup with scoped segment/channel pairs, including existing URL variants.
- Uses those pairs when
reposis absent, allowing scopes without Gerrit to skip pull request reads. - Preserves existing filters for requests with
repos. Reported production comparisons show identical output across 49 parameter sets with lower average rows read.
| File | Description |
|---|---|
services/libs/tinybird/pipes/patchsets_per_review.pipe |
Adds scoped Gerrit channel lookup, updates changeset filtering, and documents the optimized behavior. |
Review effort: Balanced
[Medium impact] The PR appears safe to merge. SummarySpeeds up
|
|
@epipav I'm starting review 1 of this pull request now (started 2026-11-17 20:02 UTC using review agent v0.1.34). The hourly check started this review. This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by Hi anilb, thanks for the PR and for the detailed validation numbers. SummaryThis pull request narrows the Decision✅ Approved DetailsOverview: The new Other reviewers and CI checks: Copilot, Cursor Bugbot and Greptile also reported no issues. The merge state is Rule files: read Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues |
lfx-one
left a comment
There was a problem hiding this comment.
Approved. The new patchsets_per_review_gerrit_channels node reproduces the channel variants of repos_to_channels (URL, lowercase URL, Gerrit q/project: form) with the same repository, integration and project filters. The repos path is unchanged, and no correctness, security or privacy issues were found.
Summary
patchsets_per_reviewhas a p95 of 1.44s over the last 3 days of app traffic, above the 1s target. 81% of its calls are collections. Every call built two lookups before reading any changeset:repos_to_channels, which scansrepositories FINALthree times to list the channels of every enabled repository (about 300K rows), and the Gerrit segment list from #5318 (about 90K rows). The twosegmentId INfilters prune the pull request scan separately, so a collection without Gerrit still read about 250K pull request rows to return an empty result.Changes
patchsets_per_review_gerrit_channelsreturns the segment and channel pairs of the enabled Gerrit repositories in the requested project or collection, with the channel variantsrepos_to_channelsuses (URL, lowercase URL and the Gerritq/project:form).repos,patchsets_per_review_changesetsfilters on(segmentId, channel) INthose pairs. A scope without Gerrit gets an empty set and reads no pull requests.reposkeep the current filters.patchsets_per_review_gerrit_segmentsis replaced by the new node.Validation
Read-only queries on production data, rendering the live pipes and this branch and running them back to back.
On all 1.41M Gerrit changesets with patchsets, every changeset the current channel filter keeps also matches a Gerrit repository channel in its own segment, so the pairs keep the same rows.
Output identical to the live pipe on 49 parameter sets taken from the last 3 days of app traffic: collections (CNCF, finos, korg, dronecode, lf-networking, top-30-open-source-projects and others), Gerrit projects (OpenStack, onap, opendaylight, agl, fdio-llc, starlingx, zuul), KPI and series, median and average, calls without dates and the
reposfilter.Rows read per call drop from 542K to 242K on average: collections read about 120K (were 400K to 750K) and Gerrit projects about 250K (were about 530K).
Seconds, fastest of 3 interleaved runs:
Single-call timings vary between runs on a shared cluster. OpenStack's all-time KPI reads 1.46M rows instead of 1.74M and measured between 0.13s and 0.41s on both versions.
tb fmt --diffpasses.Deploy
Pipe change only: push
patchsets_per_reviewwith--force.Type of change
Related issue
Refs linuxfoundation/lfx-cdp-insights-ops#857