Skip to content

[Bug][Bitbucket] project_mapping missing repos scope when entities empty #8748

Closed

Description

@spiffaz

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

In backend/plugins/bitbucket/api/blueprint_v200.go, the makeScopesV200 function does not default scopeConfig.Entities to plugin.DOMAIN_TYPES when entities are empty. This means that when a blueprint is created without specifying entities (which is common in the UI), no scopes are generated at all, and the project_mapping table ends up with no repo rows.

This is the same bug that was fixed for GitLab in #8743 (which fixed #8742). While Bitbucket Cloud already has DOMAIN_TYPE_CROSS in the repo scope condition (unlike GitLab before the fix), it is still missing the empty-entities default.

What do you expect to happen

When scopeConfig.Entities is empty, it should default to plugin.DOMAIN_TYPES so that all domain scopes (repos, boards, cicd_scope) are created in project_mapping.

How to reproduce

  1. Create a Bitbucket Cloud connection and configure a blueprint without specifying entities (leave entities empty)
  2. Run the blueprint
  3. Check the project_mapping table - no rows are created for this scope

Anything else

Follow-up from #8742 / #8743. The fix is to add the same empty-entities default that was applied to GitLab.

Version

Latest main branch

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Activity

  1. added
    component/pluginsThis issue or PR relates to plugins
    severity/p1This bug affects functionality or significantly affect ux
    type/bugThis issue is a bug
    on Mar 3, 2026
  2. dosubot commented on Mar 3, 2026

    @dosubot

    Thanks for the detailed bug report! Your analysis is correct. Looking at the Bitbucket makeScopesV200 function, when scopeConfig.Entities is empty, none of the StringsContains checks pass, so no scopes get added.

    The fix should be the same pattern used in the GitLab fix (#8743) and GitHub's implementation — add this at the start of the loop in makeScopesV200:

    // if no entities specified, use all entities enabled by default
    if len(scopeConfig.Entities) == 0 {
        scopeConfig.Entities = plugin.DOMAIN_TYPES
    }

    As you noted, Bitbucket already has DOMAIN_TYPE_CROSS in its repo scope condition, so only the empty entities defaulting logic is needed.

    For reference, Azure DevOps has the same issue tracked in #8749.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about incubator-devlake Share Dosu with your team

  3. added a commit that references this issue on Mar 3, 2026
    6d1bdc6
  4. added a commit that references this issue on Mar 6, 2026
    628e358
  5. added a commit that references this issue on Mar 9, 2026
    d0ada3f
  6. added a commit that references this issue on Mar 12, 2026
    611556c
  7. added 2 commits that reference this issue on Mar 26, 2026
    0554c4f
    5f8c575
  8. added 2 commits that reference this issue on Apr 9, 2026
    a51d2bb
    cefb226
  9. added a commit that references this issue on Apr 30, 2026
    c9c2fcb
  10. added a commit that references this issue on Jun 5, 2026
    8a3af1f
  11. added a commit that references this issue on Jul 21, 2026
    c05201d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/pluginsThis issue or PR relates to pluginsseverity/p1This bug affects functionality or significantly affect uxtype/bugThis issue is a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions