Redeploying the same coordinates with different content returns 201 but keeps serving the old file
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start with the MavenArtifact identity and upload serializer lookups described in the issue, then trace how repository versions select artifacts by path. Compare the metadata content checksum handling mentioned in the issue and inspect tests for deploying the same coordinates twice. Done means changed content is served in a new repository version, while identical redeploys remain a no-op—or the upload returns an error instead of claiming success.
Written by the indexing model from the issue text.
Description
Version
pulp_maven main (0fc577a), pulpcore 3.122.2.
Describe the bug
A second deploy of the same coordinates with different content is accepted with 201 Created but discarded. The repository keeps serving the file deployed first, and no new repository version is created.
MavenArtifact is identified by its coordinates and filename alone. The second upload therefore resolves to the existing content unit, finds its file slot occupied, and leaves it untouched. The upload serializer has the same lookup.
Snapshot development is the most visible victim, because it republishes the same coordinates by design. mvn deploy reports success while the repository keeps the previous build. Nothing tells the publisher that the new build was not stored.
Related: #309.
To Reproduce
- Create a repository and a distribution:
http POST :8080/pulp/api/v3/repositories/maven/maven/ name=demo http POST :8080/pulp/api/v3/distributions/maven/maven/ name=demo base_path=demo repository=<repository href> - Deploy one file, then a different file to the same path:
Both answerP=com/example/demo/1.0-SNAPSHOT/demo-1.0-SNAPSHOT.jar echo first | curl -s -o /dev/null -w '%{http_code}\n' -u admin:password -X PUT --data-binary @- :8080/pulp/maven/demo/$P echo second | curl -s -o /dev/null -w '%{http_code}\n' -u admin:password -X PUT --data-binary @- :8080/pulp/maven/demo/$P201. curl :8080/pulp/content/demo/$Preturnsfirst. The repository has only the version created by the first upload.
Expected behavior
The second deploy either replaces the file the repository serves, with a new repository version, or is refused with an error. It should not report success while discarding the upload. Redeploying identical content can stay a no-op.
Additional context
I have a patch that makes a redeploy replace the previous file:
- The file's checksum becomes part of the artifact's identity, as it already is for metadata content. Identical content still resolves to the same unit.
- The repository key fields stay without the checksum, so different content displaces the unit it supersedes. Every repository version keeps exactly one artifact per path.
Refusing redeploys of released versions is a reasonable policy too, but it is a separate feature. This patch only stops the silent discard. I can open it as a PR.
- Dominant language
- Python
- Stars
- 5
- Forks
- 30
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 36
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pulp/pulp_maven
-
Instrument Maven path-index cache behaviorPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
pulp/pulp_maven#570 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
pulp/pulp_maven#568 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
pulp/pulp_maven#563 ·
Maintainers usually reply within 1 day
-
Directory index pages keep listing directories whose content was removedPossibly taken @aevnsvi claimed this 16 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
pulp/pulp_maven#549 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
pulp/pulp_maven#539 · 2 comments ·
Maintainers usually reply within 1 day
Similar issues
-
follow-up needs-triage S3: minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
manaflow-ai/cmux#36856 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Shell framework build fails at "copy the shader libraries": the iOS shader libraries are now one file b-<chain>.imgPossibly taken @xiaofeng-han claimed this today. Openbuild ios
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day