spiffaz opened a new pull request, #8750:
URL: https://github.com/apache/incubator-devlake/pull/8750
## Summary
- When `scopeConfig.Entities` is empty (common when no entities are
explicitly selected in the UI), `makeScopesV200` produced zero scopes, leaving
`project_mapping` with no repo rows
- Adds the same empty-entities default applied to GitLab in #8743
- Adds unit tests for normal entities, empty entities, and CROSS entity
scenarios
## How has this been tested?
```bash
docker run --rm -v $(pwd):/app -w /app/backend mericodev/lake-builder:latest
\
bash -c "go test ./plugins/bitbucket/api/ -v -run TestMakeScopes"
```
All 3 tests pass:
- `TestMakeScopes` - CODE + TICKET + CICD = 3 scopes
- `TestMakeScopesWithEmptyEntities` - empty entities defaults to all domain
types = 3 scopes
- `TestMakeScopesWithCrossEntity` - CROSS + TICKET = 2 scopes (repos +
boards)
## What is the fix?
After generating the domain ID, default empty entities to
`plugin.DOMAIN_TYPES`:
```go
if len(scopeConfig.Entities) == 0 {
scopeConfig.Entities = plugin.DOMAIN_TYPES
}
```
Bitbucket Cloud already had `DOMAIN_TYPE_CROSS` in the repo scope condition
(unlike GitLab before #8743), so only the empty-entities default was needed.
Closes #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]