[Django] #34457: makemigrations --check no longer prints the changes

26 views
Skip to first unread message

Django

unread,
Apr 4, 2023, 8:54:45 AM4/4/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-----------------------------------------+------------------------
Reporter: David Sanders | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 4.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
As a result of #34051 the `--check` flag on makemigrations simply exits 1
without writing any changes.

This makes sense as it's consistent with other uses of `--check`.

However one consequence of this change is that my CI server no longer
prints the changes it thinks I need to make – and this makes the
situations where the local dev & CI are different, harder to debug.

I'd like to propose reverting this change and instead forcing `--dry-run`
to be set if `--check` is supplied. This way makemigrations goes through
the motions of what it needs to write, outputting those changes to the log
but the dry flag prevents any migrations from being written.

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

Django

unread,
Apr 4, 2023, 9:01:52 AM4/4/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------+--------------------------------------

Reporter: David Sanders | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 4.2
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by David Sanders):

PR: https://github.com/django/django/pull/16723

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

Django

unread,
Apr 4, 2023, 10:29:27 AM4/4/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------

Reporter: David Sanders | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* type: Uncategorized => Cleanup/optimization
* resolution: => wontfix


Comment:

Thanks for the ticket, however I don't think it's worth the inconsistency.
You could re-run `makemigrations` when `makemigrations --check` exists
with 1, e.g.
{{{
RESULT=`makemigrations --check`
if [ "$RESULT" -gt 0 ]; then
makemigrations --dry-run
fi;
exit $RESULT
}}}

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

Django

unread,
Apr 4, 2023, 10:46:27 AM4/4/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Claude Paroz, Jacob Walls (added)


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

Django

unread,
Apr 5, 2023, 9:09:30 AM4/5/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jacob Walls):

Or instead of a bash script, use something like `if: failure()` in your CI
pipeline. Forcing `--dry-run` to once again be provided when `--check` is
provided goes against the original motivation for the change: it's
unintuitive (to me) that for `--check` you would need to guard against
files being written your tree and therefore even know about the `--dry-
run` option.

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

Django

unread,
Apr 5, 2023, 9:15:47 AM4/5/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Migrations | Version: 4.2
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by David Sanders):

> Forcing --dry-run to once again be provided when --check is provided
goes against the original motivation for the change

By forcing I mean makemigrations does the forcing… see the PR for what I
mean ;)

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

Django

unread,
Nov 3, 2023, 10:02:50 AM11/3/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
--------------------------------------+------------------------------------

Reporter: David Sanders | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Migrations | Version: 4.2
Severity: Normal | Resolution: wontfix
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 Jacob Walls):

* stage: Unreviewed => Accepted


Comment:

Accepting based on [https://forum.djangoproject.com/t/makemigrations-
check-output-regression-in-4-2/24894 forum discussion].

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

Django

unread,
Nov 3, 2023, 10:04:59 AM11/3/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
--------------------------------------+------------------------------------
Reporter: David Sanders | Owner: nobody
Type: Cleanup/optimization | Status: new

Component: Migrations | Version: 4.2
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 Jacob Walls):

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


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

Django

unread,
Nov 3, 2023, 11:32:01 AM11/3/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
--------------------------------------+------------------------------------
Reporter: David Sanders | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Migrations | Version: 4.2
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 Mariusz Felisiak):

* has_patch: 1 => 0


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

Django

unread,
Nov 5, 2023, 4:59:21 PM11/5/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
---------------------------------+------------------------------------
Reporter: David Sanders | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Release blocker | 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 Adam Johnson):

* type: Cleanup/optimization => Bug
* severity: Normal => Release blocker


Comment:

Marking as a release blocker because I consider it a regression, as
discussed on the forum.

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

Django

unread,
Nov 5, 2023, 5:04:24 PM11/5/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
---------------------------------+------------------------------------
Reporter: David Sanders | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 4.2
Severity: Release blocker | 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 Adam Johnson):

* has_patch: 0 => 1


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

Django

unread,
Nov 5, 2023, 6:15:09 PM11/5/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Adam
| Johnson
Type: Bug | Status: assigned

Component: Migrations | Version: 4.2
Severity: Release blocker | 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 Jacob Walls):

* owner: nobody => Adam Johnson
* status: new => assigned
* stage: Accepted => Ready for checkin


Comment:

[https://github.com/django/django/pull/17448 new PR]

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

Django

unread,
Nov 6, 2023, 8:57:05 AM11/6/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


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

Django

unread,
Nov 8, 2023, 9:41:54 AM11/8/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: 4.2
Severity: Release blocker | 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 Adam Johnson):

* needs_better_patch: 1 => 0


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

Django

unread,
Nov 8, 2023, 2:23:26 PM11/8/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
---------------------------------+----------------------------------------

Reporter: David Sanders | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: 4.2
Severity: Release blocker | 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 Natalia Bidart):

* needs_better_patch: 0 => 1

* stage: Ready for checkin => Accepted


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

Django

unread,
Nov 8, 2023, 5:22:53 PM11/8/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
---------------------------------+----------------------------------------
Reporter: David Sanders | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: 4.2
Severity: Release blocker | 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 Adam Johnson):

* needs_better_patch: 1 => 0


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

Django

unread,
Nov 9, 2023, 8:24:23 AM11/9/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------

Reporter: David Sanders | Owner: Adam
| Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: 4.2
Severity: Release blocker | 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 Natalia Bidart):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:16>

Django

unread,
Nov 9, 2023, 8:42:31 AM11/9/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Migrations | Version: 4.2
Severity: Release blocker | Resolution: fixed

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 Natalia <124304+nessita@…>):

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


Comment:

In [changeset:"f7389c4b07ceeb036436e065898e411b247bca78" f7389c4]:
{{{
#!CommitTicketReference repository=""
revision="f7389c4b07ceeb036436e065898e411b247bca78"
Fixed #34457 -- Restored output for makemigrations --check.

Co-authored-by: David Sanders <shang.xia...@gmail.com>
Co-authored-by: Natalia <124304+...@users.noreply.github.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:17>

Django

unread,
Nov 9, 2023, 9:05:51 AM11/9/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Migrations | Version: 4.2
Severity: Release blocker | Resolution: fixed
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
-------------------------------------+-------------------------------------

Comment (by Natalia <124304+nessita@…>):

In [changeset:"8eba6efbf08d3fe5d64bd92948c2c86ab4f07608" 8eba6ef]:
{{{
#!CommitTicketReference repository=""
revision="8eba6efbf08d3fe5d64bd92948c2c86ab4f07608"
[5.0.x] Fixed #34457 -- Restored output for makemigrations --check.

Co-authored-by: David Sanders <shang.xia...@gmail.com>
Co-authored-by: Natalia <124304+...@users.noreply.github.com>

Backport of f7389c4b07ceeb036436e065898e411b247bca78 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:18>

Django

unread,
Nov 9, 2023, 9:06:33 AM11/9/23
to django-...@googlegroups.com
#34457: makemigrations --check no longer prints the changes
-------------------------------------+-------------------------------------
Reporter: David Sanders | Owner: Adam
| Johnson
Type: Bug | Status: closed
Component: Migrations | Version: 4.2
Severity: Release blocker | Resolution: fixed
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
-------------------------------------+-------------------------------------

Comment (by Natalia <124304+nessita@…>):

In [changeset:"90c3d71dfe6452a644f519425156c0f21748b711" 90c3d71d]:
{{{
#!CommitTicketReference repository=""
revision="90c3d71dfe6452a644f519425156c0f21748b711"
[4.2.x] Fixed #34457 -- Restored output for makemigrations --check.

Co-authored-by: David Sanders <shang.xia...@gmail.com>
Co-authored-by: Natalia <124304+...@users.noreply.github.com>

Backport of f7389c4b07ceeb036436e065898e411b247bca78 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:19>

Reply all
Reply to author
Forward
0 new messages