nycmeshnet / meshdb

A convenient, stable, and sane database for tracking Members and Nodes for use with robots and humans
https://db.mesh.nycmesh.net
MIT License
8 stars 13 forks source link

Add Celery Worker to Automatically Import from UISP #466

Closed Andrew-Dickinson closed 2 weeks ago

Andrew-Dickinson commented 1 month ago

We should now be able to synchronize automatically with UISP on an hourly basis

When there is a diff with MeshDB, we take the UISP values, and we notify admins of the fact this has occurred, via the new slack notification system introduced in #450

Stole some import logic from the existing import script. However, a lot of that is tightly coupled to spreadsheet nonsense and should be shipped out to sea, which means most of this is new code anyway.

Also adds types for the UISP API, made in collaboration with ChatGPT :)

Closes #383

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 90.88235% with 31 lines in your changes missing coverage. Please review.

Project coverage is 92.78%. Comparing base (f55a199) to head (aa60bb2). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/meshapi/util/uisp_import/fetch_uisp.py 45.71% 19 Missing :warning:
src/meshapi/tasks.py 33.33% 8 Missing :warning:
src/meshapi/admin/los.py 55.55% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #466 +/- ## ========================================== - Coverage 93.02% 92.78% -0.24% ========================================== Files 64 69 +5 Lines 2350 2690 +340 ========================================== + Hits 2186 2496 +310 - Misses 164 194 +30 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Andrew-Dickinson commented 3 weeks ago

Ran the celery task locally. Seems to work, and takes ~5 minutes on my laptop