Comments (1)
Hey @klemen-df! I'm here to help you with any bugs, questions, or contributions you have for the project. Let me know how I can assist you!
To resolve the error "Data too long for column 'component' at row 209" encountered during the SonarQube scraping process in version v1.0.0-beta10, you need to modify the length of the 'component' column in the relevant tables. The provided migration script 20231007_modify_component_length.go
changes the column type to varchar(500)
for the component
field in the _tool_sonarqube_hotspots
, _tool_sonarqube_issue_code_blocks
, and _tool_sonarqube_issues
tables.
Here is the relevant migration script:
package migrationscripts
import (
"github.com/apache/incubator-devlake/core/context"
"github.com/apache/incubator-devlake/core/dal"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/helpers/migrationhelper"
)
var _ plugin.MigrationScript = (*modifyComponentLength)(nil)
type modifyComponentLength struct{}
type sonarqubeHotspot20231007 struct {
Component string `gorm:"index;type:varchar(500)"`
}
func (sonarqubeHotspot20231007) TableName() string {
return "_tool_sonarqube_hotspots"
}
type sonarqubeIssueCodeBlock20231007 struct {
Component string `gorm:"index;type:varchar(500)"`
}
func (sonarqubeIssueCodeBlock20231007) TableName() string {
return "_tool_sonarqube_issue_code_blocks"
}
type sonarqubeIssue20231007 struct {
Component string `gorm:"index;type:varchar(500)"`
}
func (sonarqubeIssue20231007) TableName() string {
return "_tool_sonarqube_issues"
}
func (script *modifyComponentLength) Up(basicRes context.BasicRes) errors.Error {
db := basicRes.GetDal()
err := migrationhelper.ChangeColumnsType[sonarqubeHotspot20231007](
basicRes,
script,
sonarqubeHotspot20231007{}.TableName(),
[]string{"component"},
func(tmpColumnParams []interface{}) errors.Error {
return db.UpdateColumn(
&sonarqubeHotspot20231007{},
"component",
dal.DalClause{Expr: " ? ", Params: tmpColumnParams},
dal.Where("? != '' ", tmpColumnParams...),
)
},
)
if err != nil {
return err
}
err = migrationhelper.ChangeColumnsType[sonarqubeIssueCodeBlock20231007](
basicRes,
script,
sonarqubeIssueCodeBlock20231007{}.TableName(),
[]string{"component"},
func(tmpColumnParams []interface{}) errors.Error {
return db.UpdateColumn(
&sonarqubeIssueCodeBlock20231007{},
"component",
dal.DalClause{Expr: " ? ", Params: tmpColumnParams},
dal.Where("? != '' ", tmpColumnParams...),
)
},
)
if err != nil {
return err
}
err = migrationhelper.ChangeColumnsType[sonarqubeIssue20231007](
basicRes,
script,
sonarqubeIssue20231007{}.TableName(),
[]string{"component"},
func(tmpColumnParams []interface{}) errors.Error {
return db.UpdateColumn(
&sonarqubeIssue20231007{},
"component",
dal.DalClause{Expr: " ? ", Params: tmpColumnParams},
dal.Where("? != '' ", tmpColumnParams...),
)
},
)
if err != nil {
return err
}
return nil
}
func (*modifyComponentLength) Version() uint64 {
return 20231007145127
}
func (*modifyComponentLength) Name() string {
return "modify component type to varchar(500)"
}
This script increases the length of the component
column to 500 characters, which should resolve the "Data too long for column 'component'" error. Additionally, if you encounter similar issues with other columns or tables, you can refer to the Configuration and Blueprint Troubleshooting documentation for more detailed solutions and workarounds [1][2].
To continue talking to Dosu, mention @dosu.
from incubator-devlake.
Related Issues (20)
- [Bug][Config UI] I can still add an existing scope in AzureDevops
- [Feature][GitLab] Add assignees and reviewers to table.pull_requests
- [Bug][Module Name] my data doesnt show on the dashboard can someone help me please HOT 3
- [Refactor][DORA] Refactor CalculateChangeLeadTimeMeta subtask HOT 2
- [Feature][PagerDuty] Change Incident Times HOT 10
- [Bug][PagerDuty] not enough info for Pagerduty execution (400) HOT 3
- [Bug][Module Name] AxiosError: Request failed with status code 500 HOT 2
- [Bug][CircleCI] CircleCI regex is not working to collect data HOT 3
- [Feature][StarRocks] support starrocks replication num
- [Feature][CustomizePlugin] Data extraction 'rawDataParams' does not support wild cards
- [Bug][GitLab] account ID is not normalized HOT 1
- [Bug][Sonarqube] data too long HOT 5
- [Bug][opsgenie] Testing API Key not working HOT 2
- [Bug][API] GET /projects exposes GitLab token in the gitextractor plugin HOT 1
- [Bug][Jenkins] MavenModuleSet should be treated as a scope HOT 3
- [Bug][Jenkins] ValidateTaskOptions not working as expected HOT 2
- [Bug][Bitbucket Server] Activities collector fails when PR is corrupt HOT 7
- [Question][REST API] I can't find a way to attach Connection to DevLake Project. HOT 15
- [Bug][gitextractor] Unable to disable CollectDeployment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from incubator-devlake.