Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Improve Artifact generation and saving for content app #3818

Merged
merged 1 commit into from Jan 4, 2019

Conversation

gmbnomis
Copy link

@gmbnomis gmbnomis commented Jan 2, 2019

  • Refactor Artifact generation for "on_demand" policy into method of its own.
    This allows derived plugin content handlers to customize the saving part.

  • Don't fail if the Artifact already exists. This may happen if multiple
    content instances share the same artifact or if the content type does not
    have enough metadata to ensure uniqueness without downloading the actual
    artifact (i.e. no digest in metadata).

fixes #4293
https://pulp.plan.io/issues/4293

- Refactor Artifact generation for "on_demand" policy into method of its own.
  This allows derived plugin content handlers to customize the saving part.

- Don't fail if the Artifact already exists.  This may happen if multiple
  content instances share the same artifact or if the content type does not
  have enough metadata to ensure uniqueness without downloading the actual
  artifact (i.e. no digest in metadata).

fixes #4293
https://pulp.plan.io/issues/4293
@pulpbot
Copy link
Member

pulpbot commented Jan 2, 2019

Can one of the admins verify this patch?

@codecov
Copy link

codecov bot commented Jan 2, 2019

Codecov Report

Merging #3818 into master will increase coverage by 2.78%.
The diff coverage is 92.3%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3818      +/-   ##
==========================================
+ Coverage    52.9%   55.68%   +2.78%     
==========================================
  Files          65       64       -1     
  Lines        2805     2796       -9     
==========================================
+ Hits         1484     1557      +73     
+ Misses       1321     1239      -82
Impacted Files Coverage Δ
pulpcore/content/handler.py 29.05% <92.3%> (+29.05%) ⬆️
pulpcore/content/__init__.py
pulpcore/app/models/base.py 63.46% <0%> (+5.76%) ⬆️
pulpcore/app/models/content.py 56.29% <0%> (+8.88%) ⬆️
pulpcore/app/files.py 58.33% <0%> (+16.66%) ⬆️
pulpcore/app/models/storage.py 82.75% <0%> (+41.37%) ⬆️
pulpcore/app/models/fields.py 93.75% <0%> (+50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccae437...7de35c4. Read the comment docs.

@gmbnomis
Copy link
Author

gmbnomis commented Jan 2, 2019

@bmbouter Here is the PR I mentioned today on IRC

@dralley
Copy link
Contributor

dralley commented Jan 3, 2019

Looks good to me, but I will let @bmbouter review also.

@dralley dralley added the 3.0 label Jan 4, 2019
Copy link
Member

@bmbouter bmbouter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great bugfix and refactor. Thank you so much @gmbnomis ! Your contributions are really making Pulp great. I'm excited.

@bmbouter bmbouter merged commit 202bfdd into pulp:master Jan 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants