This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new f98072cd9 fix: sonarqube and gitee scope config id (#6186)
f98072cd9 is described below
commit f98072cd904d81b695ed6d9ab8387db96da0a3e0
Author: abeizn <[email protected]>
AuthorDate: Sat Oct 7 16:20:11 2023 +0800
fix: sonarqube and gitee scope config id (#6186)
* fix: sonarqube and gitee scope config id
* fix: ci lint
* fix: typo
---
.../migrationscripts/20230922_add_scope_config_id.go | 2 +-
.../migrationscripts/20230922_add_scope_config_id.go | 20 ++++++++++----------
.../sonarqube/models/migrationscripts/register.go | 1 +
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
b/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
index 14bc9ff12..1b7a8dba2 100644
---
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
+++
b/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
@@ -31,7 +31,7 @@ type giteeRepo20230922 struct {
}
func (giteeRepo20230922) TableName() string {
- return "_raw_gitee_api_repo"
+ return "_tool_gitee_repos"
}
type addScopeConfigIdToRepo struct{}
diff --git
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
b/backend/plugins/sonarqube/models/migrationscripts/20230922_add_scope_config_id.go
similarity index 70%
copy from
backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
copy to
backend/plugins/sonarqube/models/migrationscripts/20230922_add_scope_config_id.go
index 14bc9ff12..161afe602 100644
---
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
+++
b/backend/plugins/sonarqube/models/migrationscripts/20230922_add_scope_config_id.go
@@ -24,30 +24,30 @@ import (
"github.com/apache/incubator-devlake/helpers/migrationhelper"
)
-var _ plugin.MigrationScript = (*addScopeConfigIdToRepo)(nil)
+var _ plugin.MigrationScript = (*addScopeConfigIdToProject)(nil)
-type giteeRepo20230922 struct {
+type sonarqubeProject20230922 struct {
ScopeConfigId uint64 `json:"scopeConfigId,omitempty"
mapstructure:"scopeConfigId,omitempty"`
}
-func (giteeRepo20230922) TableName() string {
- return "_raw_gitee_api_repo"
+func (sonarqubeProject20230922) TableName() string {
+ return "_tool_sonarqube_projects"
}
-type addScopeConfigIdToRepo struct{}
+type addScopeConfigIdToProject struct{}
-func (script *addScopeConfigIdToRepo) Up(basicRes context.BasicRes)
errors.Error {
+func (script *addScopeConfigIdToProject) Up(basicRes context.BasicRes)
errors.Error {
return migrationhelper.AutoMigrateTables(
basicRes,
- &giteeRepo20230922{},
+ &sonarqubeProject20230922{},
)
}
-func (*addScopeConfigIdToRepo) Version() uint64 {
+func (*addScopeConfigIdToProject) Version() uint64 {
return 20230922152829
}
-func (*addScopeConfigIdToRepo) Name() string {
- return "add scope_config_id to _tool_gitee_repos table"
+func (*addScopeConfigIdToProject) Name() string {
+ return "add scope_config_id to _tool_sonarqube_projects table"
}
diff --git a/backend/plugins/sonarqube/models/migrationscripts/register.go
b/backend/plugins/sonarqube/models/migrationscripts/register.go
index 9a4047464..0626cf45d 100644
--- a/backend/plugins/sonarqube/models/migrationscripts/register.go
+++ b/backend/plugins/sonarqube/models/migrationscripts/register.go
@@ -26,6 +26,7 @@ func All() []plugin.MigrationScript {
new(modifyCharacterSet),
new(expandProjectKey20230206),
new(addRawParamTableForScope),
+ new(addScopeConfigIdToProject),
new(modifyFileMetricsKeyLength),
}
}