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.
Comment (by David Sanders):
PR: https://github.com/django/django/pull/16723
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:1>
* 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>
* cc: Claude Paroz, Jacob Walls (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:3>
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>
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>
* 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>
* status: closed => new
* resolution: wontfix =>
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:7>
* has_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:8>
* 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>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:10>
* 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>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:12>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:13>
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:14>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:15>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/34457#comment:16>
* 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>
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>
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>