Detect migration conflicts and apply descriptive labels with resolution guidance #5259
+201
−40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The workflow previously only added a generic "migrations" label. It now detects Django migration number conflicts and applies semantic labels with automated resolution guidance.
Changes
Conflict Detection
0100from0100_add_field.py)Semantic Labeling
migration: sequence-ok(green) when migrations don't conflictmigration: clash(red) when migration numbers collide with base branchmigrationslabelAutomated Resolution Guidance
makemigrations --mergeinstructions and alternativesExample
When a PR adds
website/migrations/0100_add_field.pybut base already has0100_initial.py:Files Modified
.github/workflows/add-migrations-label.yml- Conflict detection and labeling logicdocs/github_actions.md- Updated workflow documentationOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.