Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Management commands to clone opinions and dockets in local environment #2436

Merged
merged 28 commits into from
Jan 19, 2023

Conversation

quevon24
Copy link
Member

@quevon24 quevon24 commented Dec 30, 2022

This are two useful management commands for development purposes, these commands allows you to clone opinion clusters or only dockets in case of need.

For example:

docker-compose -f docker/courtlistener/docker-compose.yml exec cl-django python manage.py clone_from_cl --type OpinionCluster --id 9355884
docker-compose -f docker/courtlistener/docker-compose.yml exec cl-django python manage.py clone_from_cl --type Docket --id 5377675
docker-compose -f docker/courtlistener/docker-compose.yml exec cl-django python manage.py clone_from_cl --type Person --id 16207
docker-compose -f docker/courtlistener/docker-compose.yml exec cl-django python manage.py clone_from_cl --type Court --id usnmcmilrev

These commands only work if you have the env variable DEVELOPMENT set to True.

@quevon24 quevon24 self-assigned this Dec 30, 2022
@quevon24 quevon24 requested a review from flooie December 30, 2022 20:01
@mlissner
Copy link
Member

I haven't looked at the code yet, but any reason you can't put these into one management command?

Just notionally:

manage.py clone_from_cl --obj-type search.Opinion --id 123

manage.py clone_from_cl --object-type search.Docket --id 123

I guess it'd be nice if it used object types similar to those in other management commands. I think the cl_update_search command has some examples (they might even be in an enum or a class that you could re-use?

@quevon24 quevon24 marked this pull request as draft January 4, 2023 19:52
@quevon24 quevon24 marked this pull request as ready for review January 9, 2023 19:21
Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, LOTS of comments here, but I think this will be a good one to drive home a few good practices. Let me know what you think, and thanks for putting together this useful tool.

cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
@quevon24
Copy link
Member Author

the changes you requested are ready @mlissner

@mlissner
Copy link
Member

There are still some unresolved comments. Can you please take another look and get those resolved?

@quevon24
Copy link
Member Author

There are still some unresolved comments. Can you please take another look and get those resolved?

Yes, I think there were many comments and that's why some were hidden and that's why I didn't see them🤦, i'm on it 👍

@quevon24
Copy link
Member Author

All changes should be ready @mlissner

Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is about 1,000× better, thank you @quevon24! I think it's good now, but I made a few more comments that I think will make it great.

Thanks for sticking with this one. It's small, but it's covering a lot of ground in terms of our norms and standards around here that I think will help with many of your future PRs.

cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
cl/scrapers/management/commands/clone_from_cl.py Outdated Show resolved Hide resolved
@quevon24
Copy link
Member Author

This is about 1,000× better, thank you @quevon24! I think it's good now, but I made a few more comments that I think will make it great.

Thanks for sticking with this one. It's small, but it's covering a lot of ground in terms of our norms and standards around here that I think will help with many of your future PRs.

I appreciate all your comments, I know this will help me improve my skills and code better 😊

@quevon24
Copy link
Member Author

Almost all requested changes are complete @mlissner I only left you a comment on one of the requested changes

@mlissner
Copy link
Member

Two of our CI tools broke, so I fixed them in another branch that I just merged and then rebased this on.

This is set to auto-merge as of now. I'll check back and make sure it gets into the system.

Thank you for taking the initiative to write and land these tools.

@mlissner mlissner merged commit 14ee16d into main Jan 19, 2023
@mlissner mlissner deleted the development-tools branch January 19, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants