openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Batch imports queue

Open scottbarnes opened this issue 1 year ago • 0 comments

Problem

A clear and concise description of what you want to happen

In #8122 we added a batch import endpoint at /import/batch/new (this needs renaming to /imports/batch/new), which accepts import records as JSONL.

This issue builds on that one. There should be a separate dashboard at /imports/review which will do something like SELECT * WHERE status=needs_review and GROUP BY or JOIN on batch_name, and then show us a list of all the batch names and the counts of queued import records within each batch.

Clicking on any items in this list would then show a paginated view of the items in that batch (i.e. the items with that batch_name which also have a status of needs_review).

If the batch is approved (let's say this requires membership in the admin usergroup for now), then create a stub in the /merges table to reflect who merged the batch.

When merging happens, the status should change to pending.

This also presupposes that when records are imported via /imports/batch/new, they are added to the queue with a status of need_review so they are not automatically imported and instead sit in this queue.

Additionally, it supposes anyone with an account can submit a named batch of imports (by default named {username}:{descriptor} – the descriptor they choose, the username is enforced.

Expected behaviour / screenshots (ex: Figma design screenshots for UI feature)

Additional Context

Proposal & Constraints

No response

Leads

Related files

Stakeholders


@mekarpeles

Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

scottbarnes avatar Jun 27 '24 04:06 scottbarnes