Enhance pending documents API

Aperta
#277 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
api, backend, database

Direzione di ricerca

This is a design-level API change: infer current pending-document handling from the existing documents list/filter by pending status, then introduce a processing-jobs model (start/end, progress, origin, unread/dismissed) plus date/origin filters and a streaming list endpoint. Start by locating the current pending-documents API and any related polling clients; done means jobs persist after processing, clients can filter and stream without polling, and bulk reprocess no longer floods the web indicator. No files or tests are named in the issue.

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

Descrizione

processing
Problems
  • We have to poll for changes to processing state. If the API provided a streaming response, we could avoid hitting the endpoint multiple times.
  • Once the document is done processing, it’s removed from the results. Because we’re polling for data, once the document is done, it disappears from our processing list.
  • When dispatching a bulk reprocess from the API, all those documents will appear in the web indicator
  • https://github.com/MuckRock/documentcloud/issues/230
  • https://github.com/MuckRock/documentcloud/issues/211
Proposed Solutions
  • Document processing jobs are inferred by filtering documents for a “pending” status. We should consider creating a new table for processing jobs, that track details like:
    • start time and end time
    • a value to track job progress
    • relation to the document, or documents, involved in the job
    • track the client origin of a processing job: did it come from the web client, an API client, someplace else
    • optionally, some kind of human-readable summary or description of the job: “Applying OCR to 15 documents”
    • a boolean “unread” or “dismissed” status, so that clients know which completed jobs to display to users
  • Provide date and origin filters for processing jobs, so that the client can make a request like “send me all pending or non-dismissed completed jobs created from the frontend client in the last week”
  • Provide a streaming endpoint so that the client only has to make one request for the list of processing documents, instead of continuously polling the endpoint.
Lingua principale
Python
Stelle
55
Fork
10
Merge medio
1g 13h
PR unite (30g)
22

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 MuckRock/documentcloud

Tutte le issue di MuckRock/documentcloud

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.