Skip to content

Fix/#8994 - #9013

Closed
bujjibabukatta wants to merge 3 commits into
apache:mainfrom
bujjibabukatta:fix/#8994
Closed

bujjibabukatta wants to merge 3 commits into
apache:mainfrom
bujjibabukatta:fix/#8994

Conversation

@bujjibabukatta

Copy link
Copy Markdown
Contributor

Summary

Closes #8994. Several component columns across the domain and tool layers were still varchar(N) instead of text, causing potential truncation and inconsistency with the rest of the codebase, where component has already been standardized to text for issue-tracking tables.

Changes

Struct type changes (Component field → text):

  • core/models/domainlayer/code/pull_request.go
  • core/models/domainlayer/ticket/incident.go
  • core/models/domainlayer/codequality/cq_issues.go
  • plugins/gitlab/models/mr.go
  • plugins/bitbucket/models/pr.go
  • plugins/bitbucket_server/models/pr.go
  • plugins/gitee/models/pull_request.go
  • plugins/github/models/pr.go
  • plugins/sonarqube/models/sonarqube_hotspot.go (also drops the now-unnecessary index on component, since a text column can't be indexed the same way as varchar)

New migration scripts (8), one per affected table, each calling ModifyColumnType to alter the column at the DB level for existing installations:

  • core/models/migrationscripts/20260722_change_pull_request_component_to_text.go
  • core/models/migrationscripts/20260722_change_incident_component_to_text.go
  • plugins/gitlab/models/migrationscripts/20260722_change_mr_component_to_text.go
  • plugins/bitbucket/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/bitbucket_server/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/gitee/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/github/models/migrationscripts/20260722_change_pr_component_to_text.go
  • plugins/sonarqube/models/migrationscripts/20260722_change_hotspot_component_to_text.go (drops the component index before altering the column type)

Registered each new migration script in its corresponding register.go.

Testing

  • go build ./... passes cleanly.
  • Verified struct tags match the intended text type for all 9 affected models.
  • Verified each migration script's target table name matches the model's TableName().

@bujjibabukatta

Copy link
Copy Markdown
Contributor Author

@klesh can you please review and approve ?

@klesh

klesh commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Please rebase and resolve all conflicts first.

@klesh

klesh commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution! This PR was asked to rebase in July. Since then, several CI checks have failed (commit message, lint, unit tests and e2e), and there have been no updates since mid-August. The linked issue #8994 was also closed. Closing as stale. Feel free to reopen it, or open a new PR rebased on main with passing CI.

@klesh klesh closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor][Database columns] Standardize component column type across all database tables

2 participants