Repository navigation
dnf5daemon: Filter package attributes for removed packages - #3076
LUX-ETVERITAS wants to merge 2 commits into
Conversation
PR Summary by QodoFilter removed-package attributes in History.recent_changes
AI Description
Merge Risk
|
| for (const auto & attr : attrs) { | ||
| if (attr == "name") { | ||
| dbus_package.emplace(attr, trans_pkg.get_name()); | ||
| } else if (attr == "arch") { | ||
| dbus_package.emplace(attr, trans_pkg.get_arch()); | ||
| } else if (attr == "evr") { | ||
| dbus_package.emplace(attr, get_evr(trans_pkg)); | ||
| } | ||
| } |
There was a problem hiding this comment.
When an unsupported attribute is passed I believe it silently skips it.
The regular package_to_map throws an exception in such a case, could we add a similar check also here?
There was a problem hiding this comment.
Ok, now its limited to package_attributes but this history_package_to_map supports only a subset (name, arch and evr). If you pass for example url here is will still be silently ignored.
|
/packit retest-failed |
|
The Rawhide |
Honor package_attrs in History.recent_changes when returning removed packages. Keep transaction_time present for every entry, including requests with an empty attribute list. Fixes rpm-software-management#2536 Assisted-by: Codex
9b58e6f to
59aff22
Compare
Honor
package_attrsinHistory.recent_changesfor removed packages. Return the requested subset ofname,arch, andevr, and always includetransaction_time.Use the same attribute lookup as
package_to_mapso that an unknown name raises the same D-Bus error. Recognized attributes unavailable in transaction history, such assummary, are still omitted. This preserves the default response.Added regression scenarios for attribute filtering and rejection of an unknown name. Tested the rebuilt daemon on a private D-Bus with default attributes,
['name'],[],['summary', 'evr'], and['name', 'unknown']. Confirmed that the previous revision silently accepted the unknown name.Fixes #2536