Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1837a98
feat(tames) add task for case subscription
Brennan-Chesley-FLP Feb 18, 2026
f32887e
feat(tames) cache failed subscriptions and retry on subsequent runs
Brennan-Chesley-FLP Feb 18, 2026
22d36c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 18, 2026
9948eba
feat(scrapers) add account subscription tracking model
Brennan-Chesley-FLP Feb 26, 2026
7f04413
feat(tames) update subscription task to use tracker
Brennan-Chesley-FLP Mar 2, 2026
4b7bafb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 10, 2026
a5d1c95
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 23, 2026
b36f497
test(tames) casemail subscription caching/accounting
Brennan-Chesley-FLP Mar 26, 2026
e794ac1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2026
f69e8a8
fix(tames) address pr feedback (concurrency, namespacing)
Brennan-Chesley-FLP Apr 1, 2026
2f22f22
fix(tames) update migration
Brennan-Chesley-FLP Apr 1, 2026
b9d33db
feat(tames) ongoing case scraper
Brennan-Chesley-FLP Feb 18, 2026
8d79ad4
test(tames) ongoing tames scraper
Brennan-Chesley-FLP Mar 26, 2026
520a716
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 27, 2026
8fc27e4
feat(tames) add task for case subscription
Brennan-Chesley-FLP Feb 18, 2026
4fe2e97
feat(tames) cache failed subscriptions and retry on subsequent runs
Brennan-Chesley-FLP Feb 18, 2026
2f624b5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 18, 2026
a8bb01a
feat(scrapers) add account subscription tracking model
Brennan-Chesley-FLP Feb 26, 2026
40d9151
feat(tames) update subscription task to use tracker
Brennan-Chesley-FLP Mar 2, 2026
c7c2ce7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 10, 2026
7c0cbf6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 23, 2026
55852e8
test(tames) casemail subscription caching/accounting
Brennan-Chesley-FLP Mar 26, 2026
b67b0e1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 26, 2026
db6ee08
fix(tames) address pr feedback (concurrency, namespacing)
Brennan-Chesley-FLP Apr 1, 2026
b336669
fix(tames) update migration
Brennan-Chesley-FLP Apr 1, 2026
0893e04
Merge branch 'feat/tames-subscription-task' into tames/ongoing-scraper
Brennan-Chesley-FLP Apr 6, 2026
a7e3019
feat(TAMES) inline subscriptions into polling
Brennan-Chesley-FLP Apr 6, 2026
6b2a860
feat(tames) use existing celery tasks for new cases
Brennan-Chesley-FLP Apr 6, 2026
439b596
Merge branch 'main' into tames/ongoing-scraper
albertisfu Apr 7, 2026
9e82066
fix(tames) address pr feedback
Brennan-Chesley-FLP Apr 7, 2026
d8612af
Merge branch 'main' into tames/ongoing-scraper
Brennan-Chesley-FLP Apr 7, 2026
b72754c
Merge branch 'main' into tames/ongoing-scraper
Brennan-Chesley-FLP Apr 8, 2026
fda217a
Merge branch 'main' into tames/ongoing-scraper
albertisfu Apr 8, 2026
8c84b81
Merge branch 'main' into tames/ongoing-scraper
Brennan-Chesley-FLP Apr 9, 2026
804a642
fix(tames) remove unreachable branch
Brennan-Chesley-FLP Apr 9, 2026
bbe6aa6
Merge branch 'main' into tames/ongoing-scraper
ERosendo Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ jobs:
cl/corpus_importer/management/commands/import_texas_dockets.py \
cl/corpus_importer/management/utils.py \
cl/lib/decorators.py \
cl/corpus_importer/management/commands/import_scotus_dockets.py
cl/corpus_importer/management/commands/import_scotus_dockets.py \
cl/scrapers/management/commands/tames_poller.py
12 changes: 11 additions & 1 deletion cl/corpus_importer/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4041,6 +4041,9 @@ def download_texas_document_unthrottled(
return _download_texas_document(self, texas_document_pk)


TAMES_PENDING_SUBSCRIPTIONS_KEY = "tames:pending_subscriptions"


class MergeResult[T = int](NamedTuple):
"""Stores data about the result of an attempted merge operation."""

Expand Down Expand Up @@ -4990,6 +4993,7 @@ def texas_ingest_docket_task(
task: Task,
i: tuple[bytes, TexasDocketMeta],
download_attachments: bool = True,
subscription_data: str | None = None,
) -> MergeResult:
"""
Task to parse and merge a Texas docket.
Expand All @@ -5000,6 +5004,8 @@ def texas_ingest_docket_task(
- Bytes string to parse.
- Docket metadata.
:param download_attachments: Whether to download docket entry attachments.
:param subscription_data: Optional JSON string to add to the pending
subscriptions Redis SET when a new docket is created.

:return: The result of the merge operation.
"""
Expand Down Expand Up @@ -5032,9 +5038,13 @@ def texas_ingest_docket_task(
)
task.request.chain = None
return MergeResult.failed()
return merge_texas_docket(
result = merge_texas_docket(
docket_data, download_attachments=download_attachments
)
if subscription_data and result.create and result.pk is not None:
redis = get_redis_interface("CACHE")
redis.sadd(TAMES_PENDING_SUBSCRIPTIONS_KEY, subscription_data)
return result


@app.task(
Expand Down
12 changes: 12 additions & 0 deletions cl/lib/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ class ScrapeFailed(Exception):
pass


class ConfigurationException(Exception):
"""Raised when required configuration is not set."""

pass


class SubscriptionFailure(Exception):
"""Raised when subscribing to case updates fails."""

pass


class NoSuchKey(Exception):
"""Raised when an S3 key does not exist."""

Expand Down
8 changes: 7 additions & 1 deletion cl/scrapers/management/commands/back_scrape_dockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def save_docket_response(
case_meta: dict,
court_id: str = "unknown_court",
skip_meta: bool = False,
) -> None:
) -> tuple[str, str]:
"""Store docket scraper response content and headers in S3.

Args:
Expand All @@ -259,6 +259,10 @@ def save_docket_response(
court_id: Court identifier extracted from response data
case_meta: Optional metadata dict from the scraper (e.g., case_number,
date_filed, etc.) to save alongside the response

Returns:
Tuple of (bucket_name, base_key) for locating stored files. HTML
is at ``{base_key}.html``, meta at ``{base_key}_meta.json``.
"""
storage = S3GlacierInstantRetrievalStorage(
naming_strategy=clobbering_get_name
Expand Down Expand Up @@ -288,6 +292,8 @@ def save_docket_response(
content_name = f"{base_name}.{extension}"
storage.save(content_name, ContentFile(content))

return storage.bucket_name, base_name


def parse_date_filed(date_str: str | None) -> date | None:
"""Parse a date_filed string in '%m/%d/%Y' format to a date object."""
Expand Down
Loading
Loading