#25604: Add --check flag to makemigrations; return 0 exit status for no new
migrations
--------------------------------------------+--------------------
     Reporter:  jdufresne                   |      Owner:  nobody
         Type:  New feature                 |     Status:  new
    Component:  Core (Management commands)  |    Version:  master
     Severity:  Normal                      |   Keywords:
 Triage Stage:  Unreviewed                  |  Has patch:  0
Easy pickings:  0                           |      UI/UX:  0
--------------------------------------------+--------------------
 Django developers discussion: https://groups.google.com/forum/#!msg
 /django-developers/zczdY6c9KSg/ZXCXQsGDDAAJ

 Proposal: add {{{--check}}} flag to the {{{makemigrations}}} management
 command. This flag will return 0 if no new migrations will be created. It
 will return non-zero if models contain changes without migrations. This
 will deprecrate the {{{--exit}}} flag originally discussed here:
 https://groups.google.com/forum/#!topic/django-developers/I3M6B-
 wYYd8/discussion. The problem with {{{--exit}}} is that it return the
 opposite exit status from what continuous integration servers typically
 expect.

 My use case:

 Continuous integration server check's developers' commits for correctness.
 One aspect of correctness is that all model changes have migrations.

 In shell scripting and CI servers an exit status of 0 indicates true/pass
 and an exit status of non-zero indicates false/failure.

 Therefore, the command should return 0 when everything is OK and correct
 and non-zero otherwise. Commits are correct when all model changes are
 accounted for.

 The current --exit behavior, returns non-zero when everything is correct.
 To account for this in CI, one must negate the exit status with !, this
 goes against conventional behavior.

 Further, if something goes terribly wrong and there is an unhandled
 exception, negating the exit status will make the CI stage appear to pass.
 This is backwards! CI can't tell the difference between "all changes
 accounted for" and "Python had an unhandled exception".

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.601dbabae4a644d1ac78344723cf4d37%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to