Enhance pending documents API

オープン
#277 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
22/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
api, backend, database

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
55
フォーク
10
平均マージ
1日 13時間
マージ済み PR(30日)
22

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MuckRock/documentcloud のほかの issue

MuckRock/documentcloud の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。