Skip to content

Commit

Permalink
Merge pull request #1414 from nationalarchives/hotfix/disable-enrichm…
Browse files Browse the repository at this point in the history
…ent-queue

Disable enrichment queue
  • Loading branch information
dragon-dxw authored Mar 13, 2024
2 parents ae70e3f + 1119295 commit c9f5d3b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ class Command(BaseCommand):
help = "Sends the next document in the re-enrichment queue to be enriched"

def handle(self, *args, **options):
"""
2024-03-13: Disabled this function in order to make sure that documents were not being sent to enrichment
(and therefore locked) before editors had a chance to edit them. We intend to revisit this decision later
so keeping the code intact makes sense.
"""
self.stdout.write("enrich_next_in_reenrichment_queue.py: currently disabled")
return

target_enrichment_version = api_client.get_highest_enrichment_version()
target_parser_version = api_client.get_highest_parser_version()

Expand Down
3 changes: 3 additions & 0 deletions judgments/tests/test_commands.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from unittest.mock import call, patch

import pytest
from django.core.management import call_command
from django.test import TestCase
from factories import DocumentFactory


class CommandsTestCase(TestCase):
@pytest.mark.xfail(reason="disabled reenrichment queue")
@patch("judgments.management.commands.enrich_next_in_reenrichment_queue.api_client")
@patch(
"judgments.management.commands.enrich_next_in_reenrichment_queue.NUMBER_TO_ENRICH",
Expand All @@ -32,6 +34,7 @@ def test_enrich_next_in_reenrichment_queue(self, mock_api_client):
document_1.enrich.assert_called_once()
document_2.enrich.assert_called_once()

@pytest.mark.xfail(reason="disabled reenrichment queue")
@patch("judgments.management.commands.enrich_next_in_reenrichment_queue.api_client")
@patch(
"judgments.management.commands.enrich_next_in_reenrichment_queue.NUMBER_TO_ENRICH",
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ indent=2
custom_blocks="flag"

[tool.ruff]

[tool.ruff.lint]
ignore = ["E501", "G004", "PLR2004", "RUF005", "RUF012", "UP040"] # long lines, fstrings in logs, magic values, consider not concat, mutable classbits, type instead of TypeAlias
extend-select = ["W", "B", "Q", "C90", "I", "UP", "YTT", "ASYNC", "S", "BLE", "A", "COM", "C4", "DTZ", "T10", "DJ", "EM", "EXE", "FA",
"ISC", "ICN", "G", "INP", "PIE", "T20", "PYI", "PT", "Q", "RSE", "RET", "SLF", "SLOT", "SIM", "TID", "TCH", "INT", "PTH",
Expand All @@ -28,9 +30,7 @@ unfixable = ["ERA"]
# PD, NPY, AIR: ignored, panda / numpy / airflow specific
# FURB: not yet out of preview



[tool.ruff.extend-per-file-ignores]
[tool.ruff.lint.extend-per-file-ignores]
"config/*" = ["PGH004", # vague NOQA
"FIX002"] # TODO: fix this"
"*" = ["RET505"] # disagree with if X: return Y else: return Z being wrong
Expand All @@ -43,7 +43,7 @@ unfixable = ["ERA"]
"judgments/*" = ["FIX002"] # TODOs, should fix
"conftest.py" = ["PT004"] # not even sure what this code is doing.

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["ds-caselaw-editor-ui", "config"]

[tool.ruff.pycodestyle]
[tool.ruff.lint.pycodestyle]

0 comments on commit c9f5d3b

Please sign in to comment.