Disables the system checks for most of our commands, as the image has already run them, so we're good enough without them

This commit is contained in:
Trenton H
2026-03-12 13:38:01 -07:00
parent f15394fa5c
commit 17c628b686
7 changed files with 41 additions and 5 deletions

View File

@@ -72,6 +72,30 @@ PAPERLESS_DBHOST: postgres
See [`PAPERLESS_DBENGINE`](configuration.md#PAPERLESS_DBENGINE) for accepted values.
## Management Command: `--skip-checks` Removed
The `--skip-checks` flag has been removed from all Paperless-ngx management commands
(`document_exporter`, `document_importer`, `document_retagger`, `document_archiver`,
`document_thumbnails`, `document_index`, `document_renamer`, `document_sanity_checker`,
`document_fuzzy_match`, and others).
These commands now set `requires_system_checks = []` internally, which both skips
redundant checks at runtime (they are already run as a dedicated step during Docker
startup via `init-system-checks`) and removes `--skip-checks` from the argument parser.
#### Action Required
Remove `--skip-checks` from any scripts, cron jobs, or automation that invokes
these commands:
```bash
# v2
document_exporter /backup --skip-checks
# v3
document_exporter /backup
```
## Database Advanced Options
The individual SSL, timeout, and pooling variables have been removed in favor of a

View File

@@ -151,6 +151,10 @@ class PaperlessCommand(RichCommand):
supports_progress_bar: Adds --no-progress-bar argument (default: True)
supports_multiprocessing: Adds --processes argument (default: False)
System checks are skipped by default (requires_system_checks = []) because
these commands run post-startup where checks have already been performed by
the application server. Subclasses that genuinely need checks can override.
Example usage:
class Command(PaperlessCommand):
@@ -189,6 +193,8 @@ class PaperlessCommand(RichCommand):
stats.imported += 1
"""
requires_system_checks: ClassVar[list] = []
supports_progress_bar: ClassVar[bool] = True
supports_multiprocessing: ClassVar[bool] = False

View File

@@ -205,7 +205,7 @@ class Command(CryptMixin, PaperlessCommand):
ContentType.objects.all().delete()
Permission.objects.all().delete()
for manifest_path in self.manifest_paths:
call_command("loaddata", manifest_path)
call_command("loaddata", manifest_path, skip_checks=True)
except (FieldDoesNotExist, DeserializationError, IntegrityError) as e:
self.stdout.write(self.style.ERROR("Database import failed"))
if (

View File

@@ -12,7 +12,12 @@ class TestApiSchema(APITestCase):
Test that the schema is valid
"""
try:
call_command("spectacular", "--validate", "--fail-on-warn")
call_command(
"spectacular",
"--validate",
"--fail-on-warn",
skip_checks=True,
)
except CommandError as e:
self.fail(f"Schema validation failed: {e}")

View File

@@ -140,7 +140,7 @@ class TestCreateClassifier(TestCase):
"documents.management.commands.document_create_classifier.train_classifier",
)
def test_create_classifier(self, m) -> None:
call_command("document_create_classifier")
call_command("document_create_classifier", skip_checks=True)
m.assert_called_once()
@@ -152,7 +152,7 @@ class TestConvertMariaDBUUID(TestCase):
m.alter_field.return_value = None
stdout = StringIO()
call_command("convert_mariadb_uuid", stdout=stdout)
call_command("convert_mariadb_uuid", stdout=stdout, skip_checks=True)
m.assert_called_once()

View File

@@ -20,6 +20,7 @@ class TestManageSuperUser(DirectoriesMixin, TestCase):
"--no-color",
stdout=out,
stderr=StringIO(),
skip_checks=True,
)
return out.getvalue()

View File

@@ -1665,7 +1665,7 @@ class TestManagementCommand(TestCase):
"paperless_mail.management.commands.mail_fetcher.tasks.process_mail_accounts",
)
def test_mail_fetcher(self, m) -> None:
call_command("mail_fetcher")
call_command("mail_fetcher", skip_checks=True)
m.assert_called_once()