SciCatProject / SciCatProject/backend

Add endpoint to get a fresh PID without creating a dataset

Open
#314 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
27
Forks
37
Avg merge
17h 32m
Merged PRs (30d)
38

Description

When uploading datasets, Scitacean first generates a dataset PID locally before uploading to SciCat. It does this because it uses the id to determine where to place the files. And it uploads the files before the dataset because a file upload can be reverted more easily than an upload to SciCat.

This approach can potentially lead to the dataset being rejected because the id is already in use. So it would be useful to have an endpoint that returns a new, unused id but doesn't actually create a dataset in the database.

If feasible, it would be extra nice, to avoid race conditions, to also reserve the id. But then it may need to be freed up if the dataset is not actually uploaded, e.g. after 1 day or so.

This is mainly useful for datasets. I personally see no need to support it with other models as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the backend dataset upload flow and how dataset PIDs are generated and checked. Define an endpoint that returns an unused dataset PID without creating a dataset, and determine whether temporary reservation and expiry are required. Done means the behavior, race-condition handling, and cleanup expectations are specified and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.