fix: gitlab fixes#4272
Open
joanagmaia wants to merge 2 commits into
Open
Conversation
Contributor
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
00dd5fc to
0bc13a6
Compare
Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
0bc13a6 to
e3ccff5
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Updates PR analysis aggregation to properly count GitLab MR approval events as review activity in Tinybird, and adjusts GitLab webhook cleanup during integration deletion to avoid holding DB transactions open during external HTTP calls.
Changes:
- Add
merge_request-review-approvedto the “reviewed” event filters inpull_request_analysis_initial_snapshot.pipe. - Include
merge_request-review-approvedalongside other review types when computingreviewedAt/reviewedUpdatedAtinpull_request_analysis_baseline_merge_MV.pipe. - Defer GitLab webhook deletions until after the DB transaction commits in
IntegrationService.destroyAll.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| services/libs/tinybird/pipes/pull_request_analysis_initial_snapshot.pipe | Treat GitLab MR approvals as review events for initial snapshot metrics. |
| services/libs/tinybird/pipes/pull_request_analysis_baseline_merge_MV.pipe | Ensure baseline-merge aggregation includes GitLab approval reviews in reviewed timestamps. |
| backend/src/services/integrationService.ts | Move GitLab webhook removals out of the transaction to avoid DB connection timeouts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
merge_request-review-approvedas a recognized review activity type in the PR analysis Tinybird pipespull_request_analysis_baseline_merge_MV.pipeandpull_request_analysis_initial_snapshot.pipeto include GitLab approval events alongside change-request reviewsTest plan
🤖 Generated with Claude Code
Note
Medium Risk
Deferring webhook removal until after commit can leave orphaned GitLab hooks if the process fails post-commit, while Tinybird pipe changes affect production PR metrics once deployed.
Overview
GitLab integration teardown no longer calls GitLab’s API to delete webhooks while
destroyAllholds an open DB transaction. Webhook tokens, project IDs, and hook IDs are collected during the transactional delete loop, the transaction commits, thenremoveGitlabWebhooksruns in parallel. That avoids idle connections during slow external HTTP and reduces connection-timeout risk on bulk integration removal.PR analysis (Tinybird) now treats GitLab
merge_request-review-approvedlike other review signals when computing first reviewed timestamps.pull_request_analysis_baseline_merge_MVandpull_request_analysis_initial_snapshotinclude that activity type alongsidepull_request-reviewedandmerge_request-review-changes-requested, so MR approval events can drivereviewedAt/ related metrics where they were previously ignored.Reviewed by Cursor Bugbot for commit e3ccff5. Bugbot is set up for automated code reviews on this repo. Configure here.