dosubot[bot] commented on issue #7598:
URL:
https://github.com/apache/incubator-devlake/issues/7598#issuecomment-2157637812
<!-- Greeting -->
Hello @sstojak1! I'm here to help you with any bugs, questions, or
contributions you have for the project. Let's work together to resolve the
issue you've encountered.
<!-- Answer -->
To ensure that the `hudson.maven.MavenModuleSet` Jenkins project type is not
incorrectly categorized as a group instead of a scope in DevLake version
v1.0.0-beta11, you need to correctly configure the scope in the
`scope_config_api.go` file.
Here is an example of how you can create a scope configuration for Jenkins:
```go
func CreateScopeConfig(input *plugin.ApiResourceInput)
(*plugin.ApiResourceOutput, errors.Error) {
return dsHelper.ScopeConfigApi.Post(input)
}
```
Ensure that the `scopeConfig` parameter in the `CreateScopeConfig` function
correctly identifies `hudson.maven.MavenModuleSet` as a scope. This involves
setting the appropriate fields in the `models.JenkinsScopeConfig` structure.
Example of defining the `JenkinsScopeConfig` model:
```go
package models
type JenkinsScopeConfig struct {
ID int `json:"id"`
ConnectionId int `json:"connectionId"`
ScopeType string `json:"scopeType"` // Ensure this field correctly
identifies the scope type
ScopeName string `json:"scopeName"`
// Add other necessary fields
}
```
Ensure the `ScopeType` field correctly identifies
`hudson.maven.MavenModuleSet` as a scope. This way, when you create or update a
scope configuration, it will be correctly categorized.
Example usage:
```json
{
"connectionId": 1,
"scopeType": "hudson.maven.MavenModuleSet",
"scopeName": "My Maven Project"
}
```
Additionally, according to the DevLake domain layer schema, Jenkins jobs are
categorized under the CI/CD domain as `cicd_scopes`. Ensure that
`hudson.maven.MavenModuleSet` is correctly mapped to a `cicd_scope` in the
domain layer schema:
```md
#### cicd_scopes
The entity to filter or group 'cicd_pipelines'.
- For Jenkins: a Jenkins job is converted to a cicd_scope
```
By following these steps, you can ensure that `hudson.maven.MavenModuleSet`
is correctly categorized as a scope in DevLake
<sup>[[1]](https://github.com/apache/incubator-devlake/blob/main/backend/plugins/jenkins/api/scope_config_api.go)</sup><sup>[[2]](https://github.com/apache/incubator-devlake-website/blob/main/versioned_docs/version-v1.0/DataModels/DevLakeDomainLayerSchema.md)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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]