[Refactor]: Consolidate ingestion routes under `features/ingestion/api/`

Aperta
#481 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Start with backend/app/features/ingestion/api.py and the five routers in backend/app/api/ (ingestion_summary.py, job_health.py, rejected_executions.py, source_directories.py, metadata_backfill.py), then main.py for router registration. The first step is a maintainer decision on the route-placement convention, so confirm it before moving files. Done means no /ingestions/* router remains under backend/app/api/, /openapi.json is unchanged, and make backend-test passes. The issue is blocked by #306.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

refactor
Is your feature request related to a problem?

Ingestion routes are split across two locations:

  • backend/app/features/ingestion/api.py: /ingestions (from-path, from-upload, from-hpc-upload, archive-checkpoints, discovery-results, state).
  • backend/app/api/: five more routers with /ingestions prefixes and the Ingestions tag:
    • ingestion_summary.py
    • job_health.py (/ingestions/jobs)
    • rejected_executions.py
    • source_directories.py
    • metadata_backfill.py (/ingestions/metadata-backfill)

The modules in app/api/ import private helpers from features/ingestion/api.py, so the split already crosses module boundaries.

The convention is also contradictory. AGENTS.md says "New endpoints go in backend/app/api/" and "API routes in backend/app/api/", but every feature (catalog, ingestion, machine, user, and others) owns its routes in features/*/api.py.

Blocked by #306, which adds public features/ingestion/access.py helpers.

Describe the solution you'd like
  1. Decide on the convention and update AGENTS.md. Recommended: feature routes live in features/<feature>/api/, and app/api/ keeps only cross-cutting routes (health.py, meta.py, version.py).
  2. Move the five ingestion routers into features/ingestion/api/ (for example, summary.py, job_health.py, rejected_executions.py, source_directories.py, metadata_backfill.py) and update main.py registration.
  3. Move the related tests to match.
Acceptance criteria
  • AGENTS.md states one route-placement convention, and it matches the code.
  • No /ingestions/* router is defined under backend/app/api/.
  • /openapi.json is identical before and after: same paths, methods, tags, and schemas.
  • make backend-test and make pre-commit-run pass.
Describe alternatives you've considered
  • Keep routes in app/api/ and move feature routes there. This conflicts with the feature-based architecture and would touch every feature.
  • Leave the routes as is and only fix AGENTS.md. This documents the inconsistency instead of fixing it.
Lingua principale
Python
Stelle
2
Fork
2
Merge medio
12h 49m
PR unite (30g)
30

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di E3SM-Project/simboard

Tutte le issue di E3SM-Project/simboard

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.