RPM `other.xml` updater 'refactored'
What does this MR do and why?
This MR is an refactored version for !98272 (merged) that is merged and for !98882 (closed) that is currently open. In the last MR you can find answers why this one is created. The main change here is for base_builder
service that was refactored to xml_manager
service.
Previous flow:
- create empty xml
empty = Packages::Rpm::RepositoryMetadata::BuildPrimaryXml.new.execute
- update xml
new_xml = Packages::Rpm::RepositoryMetadata::BuildPrimaryXml.new(xml: empty, data: data).execute
Current flow:
- create empty xml
empty = Packages::Rpm::RepositoryMetadata::XmlManager.new(filename: :primary).execute
- update xml
new_xml = Packages::Rpm::RepositoryMetadata::XmlManager.new(filename: :primary, xml: empty, data: data).execute
Added function remove_existing_packages
that checks if node with provided pkgid
exists in the xml and remove it to update with provided params.
Screenshots or screen recordings
- Generate empty xml
- Set payload data to update
- Update
empty
xml ->new_xml
updated with new node - Update
new_xml
with the same data -> No changes applied
- Update data
name
attribute and leavepkgid
same - Update
new_xml
with new data -> Still have 1 node but with updatedname
tag
- Update data
pkgid
attribute - Update
new_xml
with new data -> New node added
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #372735 (closed)
Edited by bohdan-barylo