Skip to content

fix: gitlab fixes#4272

Open
joanagmaia wants to merge 2 commits into
mainfrom
fix/gitlab-fixes
Open

fix: gitlab fixes#4272
joanagmaia wants to merge 2 commits into
mainfrom
fix/gitlab-fixes

Conversation

@joanagmaia

@joanagmaia joanagmaia commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add merge_request-review-approved as a recognized review activity type in the PR analysis Tinybird pipes
  • Fixes pull_request_analysis_baseline_merge_MV.pipe and pull_request_analysis_initial_snapshot.pipe to include GitLab approval events alongside change-request reviews

Test plan

  • Verify Tinybird pipe deployments pick up the updated SQL
  • Confirm GitLab MR approval events are reflected in PR analysis metrics

🤖 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 destroyAll holds an open DB transaction. Webhook tokens, project IDs, and hook IDs are collected during the transactional delete loop, the transaction commits, then removeGitlabWebhooks runs 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-approved like other review signals when computing first reviewed timestamps. pull_request_analysis_baseline_merge_MV and pull_request_analysis_initial_snapshot include that activity type alongside pull_request-reviewed and merge_request-review-changes-requested, so MR approval events can drive reviewedAt / 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.

Copilot AI review requested due to automatic review settings June 26, 2026 21:55
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@joanagmaia joanagmaia force-pushed the fix/gitlab-fixes branch 2 times, most recently from 00dd5fc to 0bc13a6 Compare June 26, 2026 21:57
joanagmaia and others added 2 commits June 26, 2026 22:58
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-approved to the “reviewed” event filters in pull_request_analysis_initial_snapshot.pipe.
  • Include merge_request-review-approved alongside other review types when computing reviewedAt/reviewedUpdatedAt in pull_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.

Comment thread backend/src/services/integrationService.ts
Copilot AI review requested due to automatic review settings June 26, 2026 22:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread backend/src/services/integrationService.ts
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.

2 participants