Skip to content

fix(azuredevops): add missing migrations for Job model fields from #8671#1

Open
magiskboy wants to merge 1 commit into
mainfrom
fix/azuredevops-jobs-migration
Open

fix(azuredevops): add missing migrations for Job model fields from #8671#1
magiskboy wants to merge 1 commit into
mainfrom
fix/azuredevops-jobs-migration

Conversation

@magiskboy

Copy link
Copy Markdown
Owner

Summary

Fixes a schema mismatch introduced by upstream PR apache#8671 where the Azure DevOps Python plugin's Job model gained identifier, type, and parent_id fields, and GitRepositoryConfig gained environment_pattern, but no database migrations were added.

This caused the Convert Jobs subtask to fail on MySQL with:

Unknown column '_tool_azuredevops_jobs.identifier' in 'field list'

Affected releases: v1.0.3-beta9 through v1.0.3-beta12.

Changes

  • Add migration 20251231120000 to add identifier, type, and parent_id columns to _tool_azuredevops_jobs
  • Add migration 20251231120001 to add environment_pattern column to _tool_azuredevops_gitrepositoryconfigs

Uses add_column operations which skip columns that already exist (safe for users who applied manual SQL workarounds).

Test plan

  • Start DevLake with an existing DB missing these columns and confirm migrations run on startup
  • Run Azure DevOps pipeline collect including Convert Jobs — should complete without SQL errors
  • Verify fresh install also gets columns via migrations (init schema + new migrations)
  • Confirm scope config with environment_pattern can be saved after migration

Made with Cursor

…ache#8671

PR apache#8671 added identifier, type, and parent_id to the Job model and
environment_pattern to scope config without database migrations, causing
Convert Jobs to fail with "Unknown column identifier" on existing deployments.

Co-authored-by: Cursor <cursoragent@cursor.com>
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