Skip to content

feat(github): warn when adding a repo already scoped on another connection - #9034

Merged
klesh merged 1 commit into
apache:mainfrom
mfrancisc:upstream/feat-8947-scope-duplicates
Aug 8, 2026
Merged

feat(github): warn when adding a repo already scoped on another connection#9034
klesh merged 1 commit into
apache:mainfrom
mfrancisc:upstream/feat-8947-scope-duplicates

Conversation

@mfrancisc

Copy link
Copy Markdown
Contributor

Summary

Fixes#8947
When the same GitHub repository is added under more than one connection, DevLake stores duplicate domain-layer records and metrics get inflated. The Config UI previously allowed this with no warning.
This PR adds:

  • GET /plugins/github/scope-duplicates — diagnostics (repos already on multiple connections) and a pre-add check (connectionId + githubIds)
  • A dismissible, non-blocking warning in Config-UI when selecting a GitHub repo that already exists under another connection
    Save is still allowed; users can choose to proceed intentionally.

Screenshot

image

Follow-ups

  • Same API + Config-UI warning for GitLab and Bitbucket
  • Optional global GET /api/scope-duplicates aggregator
  • Domain-layer dedup / metric fixes remain out of scope

…ction
Add a scoped GET /plugins/github/scope-duplicates API and a dismissible
Config-UI Alert so users are informed before creating cross-connection
duplicate domain records (apache#8947).
Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@kleshklesh 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.

LGTM

@klesh
klesh merged commit d323c16 into apache:mainAug 8, 2026
11 checks passed
Sign up for freeto 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.

[Bug][Config-UI] No warning when the same repository is added under multiple connections, causing duplicate domain-layer records

2 participants

@mfrancisc@klesh