Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

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

  • Fetch migration files from PR and base branch via GitHub API
  • Extract migration numbers (e.g., 0100 from 0100_add_field.py)
  • Compare PR migration numbers against base branch to detect conflicts

Semantic Labeling

  • migration: sequence-ok (green) when migrations don't conflict
  • migration: clash (red) when migration numbers collide with base branch
  • Remove outdated labels including legacy migrations label

Automated Resolution Guidance

  • Post comment when conflicts detected listing all conflicting files
  • Include makemigrations --merge instructions and alternatives
  • Use pagination to prevent duplicate comments

Example

When a PR adds website/migrations/0100_add_field.py but base already has 0100_initial.py:

⚠️ Migration Conflict Detected

- website/migrations/0100_add_field.py conflicts with website/migrations/0100_initial.py

### How to resolve:
1. Delete the conflicting migration file(s) from your branch
2. Pull the latest changes from the base branch
3. Run `python manage.py makemigrations --merge` to create a merge migration
4. Commit and push the merge migration

Files Modified

  • .github/workflows/add-migrations-label.yml - Conflict detection and labeling logic
  • docs/github_actions.md - Updated workflow documentation
Original prompt

For the github action that adds the migration label instead of onltbadfing the label mske the label say migration: sequence-ok or migration: clash (tyen addca comment to bunp the migration number and dependency.


💡 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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits December 11, 2025 06:58
…propriate labels

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Copilot AI changed the title [WIP] Add migration label management to GitHub actions Detect migration conflicts and apply descriptive labels with resolution guidance Dec 11, 2025
Copilot AI requested a review from DonnieBLT December 11, 2025 07:07
@github-actions github-actions bot added last-active: 0d PR last updated 0 days ago last-active: 2d PR last updated 2 days ago and removed last-active: 0d PR last updated 0 days ago labels Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

last-active: 2d PR last updated 2 days ago

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants