Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnfdaemon: Update goal.resolve() return value with missing attributes #190

Merged
merged 7 commits into from
Mar 1, 2023

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Dec 6, 2022

Add missing attributes to transaction items returned by goal.resolve().

  • package.from_repo_id
  • reason
  • ability to accomodate not only packages but also groups, environments and modules
  • replaces (packages that are replaced by given transaction item)

@m-blaha m-blaha force-pushed the mblaha/dnfdaemon-groups branch from 0b22799 to 0f5528b Compare December 7, 2022 17:41
@m-blaha m-blaha marked this pull request as ready for review December 7, 2022 17:43
@m-blaha m-blaha force-pushed the mblaha/dnfdaemon-groups branch from 0f5528b to 0aaaa55 Compare December 7, 2022 18:02
@m-blaha m-blaha marked this pull request as draft December 8, 2022 15:40
@m-blaha m-blaha force-pushed the mblaha/dnfdaemon-groups branch from 0aaaa55 to 7ce7c1f Compare December 8, 2022 19:59
@m-blaha m-blaha marked this pull request as ready for review December 8, 2022 20:00
@m-blaha m-blaha force-pushed the mblaha/dnfdaemon-groups branch 2 times, most recently from acec085 to cad2f36 Compare December 9, 2022 07:36
@inknos inknos self-assigned this Dec 19, 2022
@mcurlej mcurlej added this to the Fedora 38 milestone Jan 18, 2023
@inknos inknos removed their assignment Jan 26, 2023
@inknos inknos self-assigned this Feb 13, 2023
m-blaha added 3 commits March 1, 2023 08:36
For transaction serialization in dnf5daemon we need to distinguish which
type of object given transaction item represents.
There was similar enum in LogEvent which is also replaced by the new
TransactionItemType and the same implementation is used everywhere.
Also rename repo to repo_id to have dbus package attribute name
consistent with libdnf5::Package.
@m-blaha m-blaha force-pushed the mblaha/dnfdaemon-groups branch from cad2f36 to 1dde5ad Compare March 1, 2023 07:38
m-blaha added 4 commits March 1, 2023 10:06
To correctly present resolved transaction to the user we need to change
the structure of transaction item returned from goal.resolve(). The new
transaction item structure consists of:

- string object_type. This allows the client to correctly interpret data
  stored in transaction object map. Value is one of
  libdnf::transaction::TransactionItemType enum.
- string action. One of libdnf::transaction::TransactionItemAction
- string reason. One of libdnf::transaction::TransactionItemReason enum
- {string:variant} map with other transaction item attributes. Currently
  used for group id in case of REASON_CHANGE action and GROUP reason.
- {string:variant} map with object - package / group / environment /
  module, according to object_type.

All enum values are passed as string using corresponding
libdnf::transaction::*_to_string() methods. Server and client can use
different versions of libdnf with potentially different enum
definitions. Using strings makes communication more reliable.
New attribute "replaces" of transaction item attributes. Contains list
of ids (int) of packages that are replaced by given transaction item.
Needed to correctly display transaction table.
@m-blaha m-blaha force-pushed the mblaha/dnfdaemon-groups branch from 1dde5ad to fd04b23 Compare March 1, 2023 09:23
@inknos
Copy link
Collaborator

inknos commented Mar 1, 2023

Honestly I don't have comments on it meaning that I find it consistent and I would then merge it.

@inknos inknos merged commit 09a7f0c into main Mar 1, 2023
@inknos inknos deleted the mblaha/dnfdaemon-groups branch March 1, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants