Skip to content

[Bug][Sonarqube] SonarQube Plugin Data Collection Fails Due to Field Length Exceeding Limit #8452

@narrowizard

Description

@narrowizard

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

When collecting data using the SonarQube plugin, an error occurred indicating that the id field in the cq_file_metrics table (which belongs to the domain layer) exceeded its current length limit of 255 characters. This prevented successful data ingestion.

Upon investigation and review of both the SonarQube tool layer and the DevLake CQ (Code Quality) domain layer models, we identified several fields that might frequently exceed their current length limits based on real-world SonarQube data. These fields and their proposed increased lengths are:

  • cq_projects.name: Current 255, proposed 2000
  • cq_issues.component: Current 255, proposed TEXT (or equivalent long text type)
  • cq_file_metrics.file_name: Current 255, proposed 2000
  • cq_file_metrics.id: Current 255, proposed 3000
  • _tool_sonarqube_file_metrics.file_name: Current 255, proposed 2000
  • _tool_sonarqube_file_metrics.file_metrics_key: Current 500, proposed 3000

The specific error encountered points to cq_file_metrics.id as the immediate blocker, but the others are likely to cause similar issues with varied SonarQube project data.

What do you expect to happen

We expect the SonarQube plugin to successfully collect and ingest all relevant data without encountering field length constraint errors. The DevLake database schema should be robust enough to accommodate the typical lengths of data originating from SonarQube, ensuring seamless data synchronization and analysis.

How to reproduce

  1. Set up an Apache DevLake instance.
  2. Configure the SonarQube plugin by adding a SonarQube connection.
  3. Ensure your SonarQube instance contains projects with components, file names, or metrics keys that generate IDs or names longer than the currently defined field lengths in DevLake's schema (e.g., a file path or an internal metric key that exceeds 255 characters for cq_file_metrics.id or file_name).
  4. Create and run a DevLake blueprint/pipeline to collect data from the configured SonarQube project.
  5. Observe the pipeline execution logs; an error related to Data too long for column 'id' at row 1 (or similar, depending on the database backend) should appear for the cq_file_metrics table during the data transformation or saving phase.

Anything else

No response

Version

main

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Labels

component/pluginsThis issue or PR relates to pluginsseverity/p1This bug affects functionality or significantly affect uxtype/bugThis issue is a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions