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 c29ffc08a fix(sonarqube): increase cq_issues and cq_file_metrics 
project_key length to 500 (#8783)
c29ffc08a is described below

commit c29ffc08a493be420e85694d66748e23040eaabc
Author: Joshua Smith <[email protected]>
AuthorDate: Mon Mar 23 08:40:58 2026 -0600

    fix(sonarqube): increase cq_issues and cq_file_metrics project_key length 
to 500 (#8783)
    
    Fixes #8331
---
 .../domainlayer/codequality/cq_file_metrics.go     |  2 +-
 .../models/domainlayer/codequality/cq_issues.go    |  2 +-
 ...260317_increase_cq_issues_project_key_length.go | 44 ++++++++++++++++++++++
 backend/core/models/migrationscripts/register.go   |  1 +
 4 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/backend/core/models/domainlayer/codequality/cq_file_metrics.go 
b/backend/core/models/domainlayer/codequality/cq_file_metrics.go
index abc03b85f..dc069230e 100644
--- a/backend/core/models/domainlayer/codequality/cq_file_metrics.go
+++ b/backend/core/models/domainlayer/codequality/cq_file_metrics.go
@@ -23,7 +23,7 @@ import (
 
 type CqFileMetrics struct {
        domainlayer.DomainEntity
-       ProjectKey                          string 
`gorm:"index;type:varchar(255)"` //domain project key
+       ProjectKey                          string 
`gorm:"index;type:varchar(500)"` //domain project key
        FileName                            string `gorm:"type:varchar(2000)"`
        FilePath                            string
        FileLanguage                        string `gorm:"type:varchar(20)"`
diff --git a/backend/core/models/domainlayer/codequality/cq_issues.go 
b/backend/core/models/domainlayer/codequality/cq_issues.go
index 1e9ea7134..4441eb1d7 100644
--- a/backend/core/models/domainlayer/codequality/cq_issues.go
+++ b/backend/core/models/domainlayer/codequality/cq_issues.go
@@ -27,7 +27,7 @@ type CqIssue struct {
        Rule                     string `gorm:"type:varchar(255)"`
        Severity                 string `gorm:"type:varchar(100)"`
        Component                string
-       ProjectKey               string `gorm:"index;type:varchar(100)"` 
//domain project key
+       ProjectKey               string `gorm:"index;type:varchar(500)"` 
//domain project key
        Line                     int
        Status                   string `gorm:"type:varchar(20)"`
        Message                  string
diff --git 
a/backend/core/models/migrationscripts/20260317_increase_cq_issues_project_key_length.go
 
b/backend/core/models/migrationscripts/20260317_increase_cq_issues_project_key_length.go
new file mode 100644
index 000000000..223a2b6a3
--- /dev/null
+++ 
b/backend/core/models/migrationscripts/20260317_increase_cq_issues_project_key_length.go
@@ -0,0 +1,44 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+       "github.com/apache/incubator-devlake/core/context"
+       "github.com/apache/incubator-devlake/core/errors"
+       "github.com/apache/incubator-devlake/core/plugin"
+)
+
+var _ plugin.MigrationScript = (*increaseCqIssuesProjectKeyLength)(nil)
+
+type increaseCqIssuesProjectKeyLength struct{}
+
+func (script *increaseCqIssuesProjectKeyLength) Up(basicRes context.BasicRes) 
errors.Error {
+       db := basicRes.GetDal()
+       if err := db.ModifyColumnType("cq_issues", "project_key", 
"varchar(500)"); err != nil {
+               return err
+       }
+       return db.ModifyColumnType("cq_file_metrics", "project_key", 
"varchar(500)")
+}
+
+func (*increaseCqIssuesProjectKeyLength) Version() uint64 {
+       return 20260317000000
+}
+
+func (*increaseCqIssuesProjectKeyLength) Name() string {
+       return "increase cq_issues and cq_file_metrics project_key length to 
500"
+}
diff --git a/backend/core/models/migrationscripts/register.go 
b/backend/core/models/migrationscripts/register.go
index 9372d8fbd..9abb4f0ae 100644
--- a/backend/core/models/migrationscripts/register.go
+++ b/backend/core/models/migrationscripts/register.go
@@ -143,5 +143,6 @@ func All() []plugin.MigrationScript {
                new(addPipelinePriority),
                new(fixNullPriority),
                new(modifyCicdDeploymentsToText),
+               new(increaseCqIssuesProjectKeyLength),
        }
 }

Reply via email to