Skip to content

Enforce ScheduledCommand.source choices at database level - #11

Merged
TBxy merged 2 commits into
mainfrom
fix/scheduledcommand-source-constraint
Sep 20, 2026
Merged

TBxy merged 2 commits into
mainfrom
fix/scheduledcommand-source-constraint

Conversation

@TBxy

@TBxy TBxy commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a django_admin_runner_scheduledcommand_source_valid CheckConstraint (source IN (code, admin)) to ScheduledCommand.Meta + migration 0011 — fixes the django-extra-checks X060 warning reported by downstream projects.
  • Sync model definitions with the frozen migration state (label default, help texts on label/stop_requested/worker_pid) so makemigrations --check stays clean and downstream makemigrations runs no longer emit spurious AlterFields for this app.
  • Fix _restore_latest in test_migrations.py to migrate to the graph leaf nodes instead of a hardcoded 0006 (which left later tests without the 0007+ tables in file-order runs).
  • Add DB-level constraint tests for source and kind.
  • Refresh uv.lock to 0.2.0 (was still pinned at 0.1.0).

Testing

  • Full suite passes locally; new constraint tests included.

- Add django_admin_runner_scheduledcommand_source_valid CheckConstraint
  (source__in [code, admin]) to ScheduledCommand.Meta + migration 0011.
  Fixes the django-extra-checks field-choices-constraint (X060) warning
  reported by downstream projects.
- Sync model definitions with the frozen migration state (label default,
  help_texts on label/stop_requested/worker_pid) so makemigrations --check
  stays clean and downstream makemigrations runs no longer emit spurious
  AlterFields for this app.
- Fix _restore_latest in test_migrations.py to migrate to the graph leaf
  nodes instead of a hardcoded 0006, which left later tests without the
  0007+ tables when run in file order.
- Add DB-level constraint tests for source and kind.
- Refresh uv.lock to 0.2.0 (was still pinned at 0.1.0).
@TBxy TBxy added the type:bug label Sep 20, 2026
Pyright suppressions are line-scoped (unlike mypy's statement-scoped
ones): after the multi-line reformat of stop_requested, the ignore
comment on the BooleanField( line no longer covered the default=False
argument one line below, failing the quality gate.
@TBxy
TBxy enabled auto-merge (squash) September 20, 2026 22:07
@TBxy
TBxy merged commit d891db6 into main Sep 20, 2026
6 checks passed
@TBxy
TBxy deleted the fix/scheduledcommand-source-constraint branch September 20, 2026 22:11
@tbxy-agent tbxy-agent Bot mentioned this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant