Issue #1725
closedPackages attribute miscalculation in repodata xml files
Description
It was discovered that during subsequent publishes of a repository that hasn't changed, the packages attribute in the root element gets 'updated' in the repodata/{filelist,other,primary}.xml files to a 0.
This leads us to not being able to consistently generate identical data on a repeatable action (i.e. first publish, subsequent publishes)
I'm also curious as what this value would end up being with an extra package added.
Steps to reproduce:
pulp-admin rpm repo create --repo-id=zoo --feed=https://repos.fedorapeople.org/repos/pulp/pulp/demo_repos/zoo/
pulp-admin rpm repo sync run --repo-id=zoo
Take note of the data in repomd.xml (Specifically size, and open-size)
Gunzip the filelist.xml,other.xml and primary.xml files and take note of the root element attribute 'packages' (should be 32, at current state of zoo repo)
pulp-admin rpm repo publish run --repo-id=zoo
Take note of the data in repomd.xml (Specifically size, and open-size)
Gunzip the filelist.xml,other.xml and primary.xml files and take note of the root element attribute 'packages' (is now 0)
repomod.xml open-size attributes should be off by one byte less as well (in this case, since we are going from a two digit number to a one digit number)
Package elements still exists in the files
I am currently unaware of anything that relies on the packages attribute, as well as it's significance. But it does reflect a curious miss-counting issue here.
I've attached a diff showing the difference in the files.
Files
Fixes unit count in pulished metadata on publish of unchanged repo
https://pulp.plan.io/issues/1725
fixes #1725