You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@devlake.apache.org by "spiffaz (via GitHub)" <gi...@apache.org> on 2026/03/03 10:10:12 UTC
[I] [Bug][Bitbucket] project_mapping missing repos scope when entities empty [incubator-devlake]
spiffaz opened a new issue, #8748:
URL: https://github.com/apache/incubator-devlake/issues/8748
## Search before asking
- [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/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?
- [X] Yes I am willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Bitbucket] project_mapping missing repos scope when entities empty [incubator-devlake]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #8748:
URL: https://github.com/apache/incubator-devlake/issues/8748#issuecomment-3990028382
<!-- Answer -->
Thanks for the detailed bug report! Your analysis is correct. Looking at the [Bitbucket `makeScopesV200` function](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/bitbucket/api/blueprint_v200.go#L142-L183), 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)](https://github.com/apache/incubator-devlake/pull/8743) and [GitHub's implementation](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/github/api/blueprint_v200.go#L154-L157) — add this at the start of the loop in `makeScopesV200`:
```go
// 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](https://github.com/apache/incubator-devlake/issues/8749).
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/61d2184f-71f5-4c13-b978-8c484459bcf9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/61d2184f-71f5-4c13-b978-8c484459bcf9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/61d2184f-71f5-4c13-b978-8c484459bcf9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/61d2184f-71f5-4c13-b978-8c484459bcf9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/61d2184f-71f5-4c13-b978-8c484459bcf9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/61d2184f-71f5-4c13-b978-8c484459bcf9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/61d2184f-71f5-4c13-b978-8c484459bcf9?feedback_type=other)</sup>
[](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github) [](https://cursor.com/link/prompt?text=Thanks%20for%20the%20detailed%20bug%20report%21%20Your%20analysis%20is%20correct.%20Looking%20at%20the%20%5BBitbucket%20%60makeScopesV200%60%20function%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/plugins/bitbucket/api/blueprint_v200.go%23L142-L183%29%2C%20when%20%60scopeConfig.Entities%60%20is%20empty%2C%20none%20of%20the%20%60StringsContains%60%20checks%20pass%2C%20so%20no%20scopes%20get%20added.%0A%0AThe%20fix%20should%20be%20the%20same%20pattern%20used%20in%20the%20%5BGitLab%20fix%20%28%238743%29%5D%28https%3A//github.com/apache/incubator-devlake/pull/8743%29%20and%20%5BGitHub%27s%20implementation%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf
4745b8b/backend/plugins/github/api/blueprint_v200.go%23L154-L157%29%20%E2%80%94%20add%20this%20at%20the%20start%20of%20the%20loop%20in%20%60makeScopesV200%60%3A%0A%0A%60%60%60go%0A//%20if%20no%20entities%20specified%2C%20use%20all%20entities%20enabled%20by%20default%0Aif%20len%28scopeConfig.Entities%29%20%3D%3D%200%20%7B%0A%20%20%20%20scopeConfig.Entities%20%3D%20plugin.DOMAIN_TYPES%0A%7D%0A%60%60%60%0A%0AAs%20you%20noted%2C%20Bitbucket%20already%20has%20%60DOMAIN_TYPE_CROSS%60%20in%20its%20repo%20scope%20condition%2C%20so%20only%20the%20empty%20entities%20defaulting%20logic%20is%20needed.%0A%0AFor%20reference%2C%20%5BAzure%20DevOps%20has%20the%20same%20issue%20tracked%20in%20%238749%5D%28https%3A//github.com/apache/incubator-devlake/issues/8749%29.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text
=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8748)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Bitbucket] project_mapping missing repos scope when entities empty [incubator-devlake]
Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh closed issue #8748: [Bug][Bitbucket] project_mapping missing repos scope when entities empty
URL: https://github.com/apache/incubator-devlake/issues/8748
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org