[Django] #28535: Message on conflicting migrations is misleading for rebase workflows

33 views
Skip to first unread message

Django

unread,
Aug 26, 2017, 11:37:44 AM8/26/17
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
------------------------------------------------+------------------------
Reporter: karyon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
When there are conflicting migrations, it says
{{{
Conflicting migrations detected; multiple leaf nodes in the migration
graph: (%s). To fix them run 'python manage.py makemigrations --merge'
}}}

I lead a project where we have frequent newcomers. on a few occasions they
encountered this message and the reason was always that they rebased their
feature branch on a new master, and the master brought a new migration
which conflicted with a new migration in the feature branch.

we generally don't see why we would want the merge migrations and advise
them to migrate to the common ancestor, rename their migration and change
the dependency, and then run migrate again. that's easy enough and the end
result is simpler.

i think makemigrations --merge matches well to a git workflow with
merging. in our project, we use rebasing instead, and there the merge
migrations don't make much sense.

I propose to change the message to {{{To fix them by creating a merge
migration, run 'python manage.py makemigrations --merge'}}} to make it
more clearer what will happen, and add {{{Alternatively, you can resolve
the conflict manually}}}.

an automatic solution could look like this: {{{mergemigrations --rebase
<number_of_migration_to_rebase>}}}, which would ask for confirmation
{{{this will rebase migration <name_of_migration_to_rebase> onto migration
<name_of_new_base_migration>}}}, or {{{this will set
<name_of_new_base_migration> as new dependency of
<name_of_migration_to_rebase>}}}.

--
Ticket URL: <https://code.djangoproject.com/ticket/28535>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 28, 2017, 9:59:28 AM8/28/17
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
--------------------------------------+------------------------------------

Reporter: karyon | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:1>

Django

unread,
Sep 20, 2017, 11:15:32 AM9/20/17
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-------------------------------------+-------------------------------------
Reporter: karyon | Owner: Masashi
Type: | SHIBATA
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Masashi SHIBATA):

* status: new => assigned
* owner: nobody => Masashi SHIBATA


Comment:

Hi! I implement this feature at:

https://github.com/django/django/compare/master...c-bata:ticket_28535?expand=1

I'll submit a PR after adding tests and refactoring.
So I assign this to myself.

Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:2>

Django

unread,
Sep 23, 2017, 1:38:12 AM9/23/17
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-------------------------------------+-------------------------------------
Reporter: karyon | Owner: Masashi
Type: | SHIBATA
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Masashi SHIBATA):

I sent PR at:

https://github.com/django/django/pull/9131

--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:3>

Django

unread,
Oct 9, 2017, 2:45:15 PM10/9/17
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-------------------------------------+-------------------------------------
Reporter: karyon | Owner: Masashi
Type: | SHIBATA
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Masashi SHIBATA):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:4>

Django

unread,
Jan 30, 2018, 3:19:08 PM1/30/18
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-------------------------------------+-------------------------------------
Reporter: karyon | Owner: Masashi
Type: | SHIBATA
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by karyon):

*bump* this needs a review.

--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:5>

Django

unread,
Jan 30, 2018, 5:27:38 PM1/30/18
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-------------------------------------+-------------------------------------
Reporter: karyon | Owner: Masashi
Type: | SHIBATA
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

Bump isn't helpful. There are 52 patches needing review at this time.
You're welcome to help. Use the PatchReviewChecklist and mark the ticket
as "ready for checkin" if it looks okay.

--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:6>

Django

unread,
Mar 14, 2018, 4:02:10 AM3/14/18
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-------------------------------------+-------------------------------------
Reporter: karyon | Owner: Masashi
Type: | SHIBATA
Cleanup/optimization | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:7>

Django

unread,
Nov 21, 2019, 4:27:30 AM11/21/19
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+-------------------------------------------
Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: assigned
Component: Migrations | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------
Changes (by Masashi SHIBATA):

* type: Cleanup/optimization => New feature
* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:8>

Django

unread,
Nov 21, 2019, 12:48:04 PM11/21/19
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+-------------------------------------------
Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: assigned
Component: Migrations | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------
Changes (by Masashi SHIBATA):

* version: 1.11 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:9>

Django

unread,
Dec 11, 2019, 1:23:50 AM12/11/19
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+-------------------------------------------
Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------
Changes (by Masashi SHIBATA):

* needs_docs: 1 => 0
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:10>

Django

unread,
Dec 24, 2019, 1:07:40 AM12/24/19
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+---------------------------------------------

Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Masashi SHIBATA):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:11>

Django

unread,
Dec 24, 2019, 3:04:12 AM12/24/19
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+-------------------------------------------

Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------
Changes (by Claude Paroz):

* stage: Ready for checkin => Accepted


Comment:

Sorry, but you are not supposed to set `Ready for checkin` for your own
patches.

--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:12>

Django

unread,
Dec 27, 2019, 1:57:05 AM12/27/19
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+-------------------------------------------
Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------

Comment (by Masashi SHIBATA):

Sorry I misunderstood the meaning of "Ready for Checkin". Thank you,
Claude Paroz.

--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:13>

Django

unread,
Jan 22, 2020, 7:43:02 AM1/22/20
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+-------------------------------------------
Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:14>

Django

unread,
Jan 22, 2020, 7:57:06 AM1/22/20
to django-...@googlegroups.com
#28535: Message on conflicting migrations is misleading for rebase workflows
-----------------------------+-------------------------------------------
Reporter: karyon | Owner: Masashi SHIBATA
Type: New feature | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------
Changes (by felixxm):

* status: assigned => closed
* resolution: => wontfix


Comment:

I don't think it's feasible to add `migrate --rebase` with more
complicated scenarios. We found many issues when testing only base use
cases. This would be complicated and error-prone.

--
Ticket URL: <https://code.djangoproject.com/ticket/28535#comment:15>

Reply all
Reply to author
Forward
0 new messages