Skip to content

fix(gitlab): Clean up redundant project webhooks - #129177

Merged
giovanni-guidini merged 2 commits into
masterfrom
gio/fix/gitlab-webhook-cleanup
Nov 3, 2026
Merged

giovanni-guidini merged 2 commits into
masterfrom
gio/fix/gitlab-webhook-cleanup

Conversation

@giovanni-guidini

@giovanni-guidini giovanni-guidini commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GitLab project webhook reconciliation now records when cleanup is pending and delegates exact duplicate or race-loser deletion to a retryable task. Cleanup re-fetches the candidate and verifies both its reconciliation marker and the repository's current winning project and hook IDs before deletion, regardless of the repository's current integration, so transient failures remain recoverable without risking unrelated or newly adopted hooks.

retry-safe reconciliation
        │
        ▼
list exact marked hooks
        │
        ├── one winner ───────────────┐
        │                             │
        └── additional exact matches │
                                      ▼
                            CAS-store winning hook ID
                                      │
                    ┌─────────────────┴─────────────────┐
                    │                                   │
                 success                            race lost
                    │                                   │
                    ▼                                   ▼
          enqueue duplicate cleanup          enqueue attempt cleanup
                    │                                   │
                    └─────────────────┬─────────────────┘
                                      ▼
                         cleanup task re-fetches hook
                                      │
                    ┌─────────────────┴─────────────────┐
                    │                                   │
        repository references candidate     marker is not an exact match
                    │                                   │
                    └──────── preserve hook ◄───────────┘
                                      │
                         otherwise delete candidate

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 29, 2026
@giovanni-guidini
giovanni-guidini force-pushed the gio/fix/gitlab-webhook-cleanup branch 2 times, most recently from 821b3b8 to 7026655 Compare October 29, 2026 13:46
@giovanni-guidini
giovanni-guidini force-pushed the gio/fix/gitlab-webhook-cleanup branch from 7026655 to eff2e88 Compare October 29, 2026 13:56
@giovanni-guidini
giovanni-guidini force-pushed the gio/fix/gitlab-webhook-cleanup branch from eff2e88 to 177f721 Compare October 29, 2026 14:44
@giovanni-guidini
giovanni-guidini force-pushed the gio/fix/gitlab-webhook-cleanup branch from 177f721 to 7bb95f1 Compare October 29, 2026 15:06
@giovanni-guidini
giovanni-guidini force-pushed the gio/fix/gitlab-webhook-cleanup branch from 7bb95f1 to c12b0f5 Compare October 29, 2026 15:42
@giovanni-guidini
giovanni-guidini marked this pull request as ready for review October 29, 2026 16:09
@giovanni-guidini
giovanni-guidini requested a review from a team as a code owner October 29, 2026 16:09
@giovanni-guidini
giovanni-guidini requested a review from a team as a code owner November 2, 2026 08:50
@giovanni-guidini
giovanni-guidini force-pushed the gio/fix/gitlab-webhook-cleanup branch from c12b0f5 to 91bb91d Compare November 2, 2026 08:53

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 91bb91d. Configure here.

Base automatically changed from gio/fix/gitlab-webhook-create-retries to master November 3, 2026 09:04
Track incomplete reconciliation cleanup and enqueue a retryable task for exact marked duplicates and race-losing hooks. Verify ownership and current repository state immediately before deletion.
@giovanni-guidini
giovanni-guidini force-pushed the gio/fix/gitlab-webhook-cleanup branch from 91bb91d to d100d07 Compare November 3, 2026 09:04
@giovanni-guidini
giovanni-guidini merged commit 92038ff into master Nov 3, 2026
68 checks passed
@giovanni-guidini
giovanni-guidini deleted the gio/fix/gitlab-webhook-cleanup branch November 3, 2026 09:40
@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

SCM-302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants