freelawproject / courtlistener

A fully-searchable and accessible archive of court data including growing repositories of opinions, oral arguments, judges, judicial financial records, and federal filings.
https://www.courtlistener.com
Other
552 stars 151 forks source link

fix(make_dev_data): Prevent factories from uploading to AWS #4613

Closed ERosendo closed 1 month ago

ERosendo commented 1 month ago

This PR addresses the dependency of the make_dev_data command on AWS credentials for creating dummy database entries.

The docket and audio factories were creating fake files using the FileField class, which triggered unnecessary S3 uploads. To address this, the FileField is removed from both factories and post-generation hooks are implemented. These hooks attach a stub file to the fake object, ensuring that factories still return objects with files when requested and allowing developers to use familiar declarations like filepath__data for testing purposes.

This refinement maintains compatibility and flexibility for factory usage

cweider commented 1 month ago

Yup, checks out over here on my non-AWS entitled instance.