airqo-platform / airqo-platform/AirQo-api
Remove dead get_networks() helper — proxied a removed Auth Service endpoint; device-registry owns this data now
- Langage dominant
- JavaScript
- Étoiles
- 26
- Forks
- 24
- Merge moyen
- 5 h 36 min
- PR mergées (30 j)
- 81
Description
## Summary
**Microservice:** `src/workflows/` in this repo. All paths below are relative to that root.
The Auth Service has removed the `GET /users/networks` endpoint entirely, as part of a full removal of the legacy "network" org-membership concept (superseded by groups).
`get_networks()` in `airqo_etl_utils/data_api.py` calls this endpoint. It has been confirmed to have zero live callers anywhere in this codebase — checked every import site of `data_api`, and nothing pulls this function in except its own test file.
## Fix
Safe to delete `get_networks()` and its associated test coverage whenever convenient. It is unreachable dead code today and would only start throwing if something were to newly call it, since the endpoint it depends on no longer exists.
**If this capability is ever needed again:** note that `net_status` param and the `net_name`/`net_status` shape it expects back were never really an Auth Service concept — they map directly onto device-registry's own `Network` model, which already exposes full CRUD at `GET/POST /api/v2/devices/networks` (`net_status` filtering included) and is the canonical owner of this data. A revived version would point there instead of Auth Service.
## Priority
Low — cleanup only, no live pipeline or task depends on this function.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Open src/workflows/airqo_etl_utils/data_api.py and its associated test file; start by locating get_networks() and checking the import references described in the issue. Remove the helper and its test coverage, then run the relevant test file and verify that no live callers remain.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- api, backend
- Type d'issue
- Refactorisation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- Active
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 35/100