Enhance pending documents API

Ouverte
#277 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
22/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
python
Domaine
api, backend, database

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
Python
Étoiles
55
Forks
10
Merge moyen
1 j 13 h
PR mergées (30 j)
22

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de MuckRock/documentcloud

Toutes les issues de MuckRock/documentcloud

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.