harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
36 stars 30 forks source link

CourtListener API integration prototype #1994

Closed lizadaly closed 1 year ago

lizadaly commented 1 year ago

This functions as a proof of concept, but it's very rough. There's a lot to do in terms of mapping CourtListener's API fields to our own, and figuring out what transformations need to happen on the content itself.

What this does do:

What this doesn't do:

What this happens to do:

Screenshot 2023-04-13 at 1 47 36 PM

Next steps

I think we'll need a few days to decide whether we want to merge a version of this. The code can easily go live as-is and as long as the source is left in the default inactive state, it won't be visible on prod, but could be enabled on staging. We'd want to give all parties a heads-up before doing so and maybe see if there's a more performant API key available; the response time from the one I set up is pretty variable but perhaps it's being rate-limited.

codecov-commenter commented 1 year ago

Codecov Report

Merging #1994 (473dc1f) into develop (f8ee11c) will decrease coverage by 0.32%. The diff coverage is 21.87%.

@@             Coverage Diff             @@
##           develop    #1994      +/-   ##
===========================================
- Coverage    76.82%   76.51%   -0.32%     
===========================================
  Files           62       63       +1     
  Lines         6927     6975      +48     
===========================================
+ Hits          5322     5337      +15     
- Misses        1605     1638      +33     
Impacted Files Coverage Δ
web/main/legal_document_sources.py 21.38% <21.38%> (ø)
web/main/models.py 82.67% <100.00%> (+8.72%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

lizadaly commented 1 year ago

This is ready to review. It should be deployable to staging without the API key; since the source defaults to inactive the relevant code won't be called and this should just be a no-op.

I created a separate issue for generating and populating API keys for staging and prod and then we can flip the source to "active" on staging and start reviewing the actually behavior and content for what final acceptance criteria should be.