pulp / pulp/pulpcore

Make the artifact create endpoint idempotent

Open
#5,780 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
598
Forks
168
Avg merge
1d 4h
Merged PRs (30d)
86

Description

The package creation endpoints are idempotent so I wonder if the artifact create endpoint should be as well. Currently, you get a 400 error if you attempt to upload an artifact that already exists:

$ https --form :/pulp/api/v3/artifacts/ file@~/frigg_1.0_ppc64.deb
{
    "non_field_errors": [
        "Artifact with sha256 checksum of 'a20723d4d174abecc0001bbbe183d04fc26b2ca30d77d87b5c4c9f3be35b67ee' already exists."
    ]
}

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 artifact create endpoint and compare its behavior with the package creation endpoints, which are already idempotent. Reproduce the duplicate-upload case, then identify the existing endpoint logic and tests covering artifact creation. Done means uploading an artifact with an existing checksum no longer returns the current 400 error and the behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.