Skip to content

fix: widen unbounded GitHub and CI/CD string columns - #9063

Open
dncrews wants to merge 3 commits into
apache:mainfrom
dncrews:fix/varchar-to-text-many
Open

fix: widen unbounded GitHub and CI/CD string columns#9063
dncrews wants to merge 3 commits into
apache:mainfrom
dncrews:fix/varchar-to-text-many

Conversation

@dncrews

@dncrews dncrews commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Several GitHub API fields and CI/CD domain fields can exceed 255 characters, but their database columns were defined as varchar(255). This causes collection or conversion failures when DevLake receives longer values.

This PR:

  • Changes the affected live GORM model fields to explicitly use type:text.
  • Adds a GitHub plugin migration for:
    • _tool_github_jobs: name, runner_name, environment
    • _tool_github_runs: head_branch, path
    • _tool_github_pull_requests: head_ref, base_ref, author_name, merged_by_name
    • _tool_github_deployments: environment, ref_name, description
    • _tool_github_accounts: company, name
  • Adds a core migration for:
    • cicd_tasks.name
    • cicd_scopes.name
    • cicd_releases.name
    • cicd_releases.display_title
    • cicd_deployment_commits.name
    • cicd_deployment_commits.subtask_name
    • cicd_deployment_commits.ref_name
    • incidents.component
  • Corrects an existing model/migration mismatch for cicd_pipelines.name. Migration 20230821_modify_cicd_pipelines_to_text already changes existing databases to TEXT, but CICDPipeline.Name still declared varchar(255).
  • Adds regression tests for both migration registration/calls and the affected GORM model tags.

The migrations use the DAL ModifyColumnType operation and stop on the first failed column alteration.

Does this close any open issues?

N/A

Screenshots

N/A — database schema and backend model changes only.

Other Information

This PR is stacked on #9059 and should initially be reviewed against fix/pipeline-index.

Verification performed:

go test ./plugins/github/models \
  ./plugins/github/models/migrationscripts \
  ./core/models/migrationscripts \
  ./core/models/domainlayer/devops \
  ./core/models/domainlayer/ticket \
  -count=1

GET /blueprints/:blueprintId/pipelines runs COUNT(*) and a filtered
SELECT on _devlake_pipelines.blueprint_id, but the column was
unindexed. On instances with tens of thousands of pipeline rows this
forces a full table scan on every request; observed ~30s for a table
of 34k rows, causing upstream request timeouts in config-ui.

Add a gorm index tag on Pipeline.BlueprintId for fresh installs and a
migration script to add the index to existing installs.

Signed-off-by: Dan Crews <crewsd@gmail.com>
Signed-off-by: Dan Crews <crewsd@gmail.com>
Signed-off-by: Dan Crews <crewsd@gmail.com>
@dncrews
dncrews force-pushed the fix/varchar-to-text-many branch from 5e1fb96 to b0005c1 Compare August 19, 2026 20:36
@dncrews dncrews changed the title Fix/varchar to text many fix: widen unbounded GitHub and CI/CD string columns Aug 19, 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.

1 participant