[Django] #35935: sqlmigrate prevents normal colorization of system checks

11 views
Skip to first unread message

Django

unread,
Nov 24, 2024, 5:06:58 PM11/24/24
to django-...@googlegroups.com
#35935: sqlmigrate prevents normal colorization of system checks
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Jacob Walls
Walls |
Type: | Status: assigned
Cleanup/optimization |
Component: Core | Version: dev
(Management commands) |
Severity: Normal | Keywords: no_color
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
`sqlmigrate` forces `no_color=True` for the sake of not colorizing the sql
keywords `BEGIN;` and `COMMIT;`, but this has the side effect of
preventing system check output from being colorized.

(To reproduce, begin with a project that will emit a system check, and run
sqlmigrate.)

Suggesting a small [https://github.com/django/django/pull/18846 PR] to
preserve the non-colorization of `BEGIN;` and `COMMIT;` while still
colorizing system checks.
--
Ticket URL: <https://code.djangoproject.com/ticket/35935>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 25, 2024, 8:34:19 AM11/25/24
to django-...@googlegroups.com
#35935: sqlmigrate prevents normal colorization of system checks
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: no_color | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* needs_tests: 0 => 1
* stage: Unreviewed => Accepted

Comment:

Thank you Jacob, was able to reproduce adding something like this to an
existing model (an FK with `unique=True`):

{{{#!python
user = models.ForeignKey("auth.User", unique=True,
on_delete=models.CASCADE)
}}}

For the PR, do you think you could also provide a regression test where
there is actually a warning system check emitted and then an assert that
the system check is indeed colorized with your changes?
--
Ticket URL: <https://code.djangoproject.com/ticket/35935#comment:1>

Django

unread,
Nov 25, 2024, 9:13:26 AM11/25/24
to django-...@googlegroups.com
#35935: sqlmigrate prevents normal colorization of system checks
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: no_color | 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):

* needs_tests: 1 => 0

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

Django

unread,
Dec 6, 2024, 10:47:37 AM12/6/24
to django-...@googlegroups.com
#35935: sqlmigrate prevents normal colorization of system checks
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: no_color | 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 Sarah Boyce):

* stage: Accepted => Ready for checkin

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

Django

unread,
Dec 9, 2024, 2:31:35 AM12/9/24
to django-...@googlegroups.com
#35935: sqlmigrate prevents normal colorization of system checks
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: closed
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: fixed
Keywords: no_color | 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 Sarah Boyce <42296566+sarahboyce@…>):

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

Comment:

In [changeset:"d345e5b5f88af64b1c3d95582cdaea4beb773120" d345e5b5]:
{{{#!CommitTicketReference repository=""
revision="d345e5b5f88af64b1c3d95582cdaea4beb773120"
Fixed #35935 -- Colorized system checks when running sqlmigrate.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35935#comment:4>
Reply all
Reply to author
Forward
0 new messages