Skip to content

Store state court documents under the RECAP path layout #7902

Description

@albertisfu

Describe the issue.

Documents from models that inherit from AbstractStateDocument (FloridaDocument, NYCoADocument, and TexasDocument) are currently stored in S3 using state_pdf_path from cl/search/state/shared.py:

us/state/<state_code>/<court_id>/gov.<state_code>.<court_id>.<slug><ext>

We want to move these files to the same path structure we use for RECAP documents, using a directory per docket:

recap/gov.uscourts.<court_id>.<cl_docket_id>/gov.uscourts.<court_id>.<cl_docket_id>.<x>.<x><ext>

Where <cl_docket_id> is the CourtListener docket PK, not the PACER case ID.

Document naming

For RECAP, we use <document_number>.<attachment_number> for the <x>.<x> part.

State docket entries don't have equivalent fields. Florida uses UUIDs, New York has entry_index, and Texas has sequence_number.

We need something that is unique within the docket. I think we can use:

<docket_entry_id>.<document_id>

using the CL PKs.

This needs to be unique because in the follow-up migration we'll do raw S3 copies, where the incrementing storage won't protect us from collisions.

Tasks

  • Agree on the <x>.<x> naming.
  • Update AbstractStateDocument.state_pdf_path to use the new path.
  • Keep the current extension handling since Texas and New York can have non-PDF files.
  • Update the path tests for the three state document models.
  • Deploy this before starting the migration in the follow-up issue, so new documents stop being stored under us/state/.

Notes

  • This issue only changes the path for new files. Existing files will be moved in a separate issue.
  • The recap/ prefix will now be shared between RECAP and state documents.

Related Issue

No response

Screenshots

No response

What type of issue is this?

Research

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions