Disallow RPM upload with the same NVR [RHELDST-37824]#403
Conversation
562d78c to
aaca11a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #403 +/- ##
=======================================
Coverage 99.80% 99.80%
=======================================
Files 54 54
Lines 3018 3030 +12
=======================================
+ Hits 3012 3024 +12
Misses 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c08da81 to
9726413
Compare
MichalHaluza
left a comment
There was a problem hiding this comment.
Has this been tested on production-like data? AFAIK, we used to have the same RPMs signed with different GPG keys for different products in the past. This was (and still is) perfectly valid as long as the RPMs with the same NVRA but different signature aren't associated to the same repo. Checking at the time of upload may break these cases.
| This is a workaround until we have a proper support for units with same NVR but different checksum in Pulp. | ||
| Such units are not allowed to be uploaded to Pulp as they would break the integrity of the repository when published. | ||
| """ | ||
| # import pdb; pdb.set_trace() |
There was a problem hiding this comment.
Leftover from debugging
Haven't done any big tests on production data, but the case you mentioned will be disabled with current solution. I can move this check to With new query we will enable upload of NVR duplicates unless the same NVR is present in |
|
Yes, checking only the dest repo would be preferred, however can we actually do that? Are the dest repos already known during the upload step? (Note that the same RPM can be uploaded to multiple repos during a signle push, and in RHEL it oftentimes is - mainline and dot) |
6d44c47 to
3697fda
Compare
Yep, dest repos are known after |
a0e03c2 to
80a79f2
Compare
|
Implementation update - now the error is raised only in case when RPM would create a duplicate in destination repository. This allows to upload of RPMs with same NVR and different gpg signing keys as long as RPMs target different repositories. Although I think this may also lead to problems with re-signed RPMs with the same path to origin even when targeting different repos. We would probably need to check |
This change introduces a functionality that will raise a fatal error when upload of an RPM with identical `cdn_path` of already present unit in pulp is attempted. The RPMs in question differ only with their checksums (and signing keys), further association to live repositories and publish will cause breakage of repository. Duplicates check is by default disabled, and can be enabled by setting PUBTOOLS_PULP_ALLOW_DUPLICATE_UNITS env var. This should be a workaround until proper suport for such scenario is implemented.
80a79f2 to
ae7c8c2
Compare
for more information, see https://pre-commit.ci
bf0eb5c to
8c702ab
Compare
for more information, see https://pre-commit.ci
|
After consultation with @MichalHaluza this should the correct solution:
|
This change introduces a functionality that will raise a fatal error
when upload of an RPM with identical
cdn_pathof already present unit in pulpis attempted.
The RPMs in question differ only with their checksums (and signing keys),
further association to live repositories and publish will cause breakage
of repository.
Duplicates check is by default disabled, and can be enabled by setting
PUBTOOLS_PULP_ALLOW_DUPLICATE_UNITS env var.
This should be a workaround until proper suport for such scenario is
implemented.