Open daviddavis opened 2 months ago
Not opposed to it, but IMHO the artifacts api should completely be deprecated for removal in pulp 4. Having the user care about bare artifacts adds an unnecessary layer of confusion to the usage patterns of pulp.
I discussed this issue with @daviddavis on chat. He's using this API for uploading artifacts that are needed to create multi-artifact source packages in pulp_deb. A change in pulp_deb API for source packages would be appreciated. @quba42 , what do you think about that?
Have other plugins already solved this? In other words is there already an API endpoint somewhere for creating a multi-artifact content without having to separately create the artifacts first? That is how I understood the request.
I don't think we have an example of this anywhere else. @dralley @ggainey does RPM have anything like this?
So I just had a look at the pulp_deb Source Package API endpoint, and it expects you to provide the .dsc
file as an artifact, and then it will just loop over the files referenced in that .dsc
file, expecting those to already exist as artifacts in Pulp.
Does anyone have any ideas how one might provide a content API endpoint with multiple uploads to create a content and multiple artifacts from?
I did not think about this before, and if it does not already exist elsewhere, I am not at all confident I know a good approach. :smile:
I think the multipart body can accept multiple files in one request just fine. Not sure if DRF covers for that. Also I would kind of expect that for each file you can either upload a file, specify an upload or (for the time being) an artifact.
Somehow we are derailing from the original ask: "Should the Artifact upload be idempotent?" And we can do that.
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: