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>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](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.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to