Skip to content

Repo info: add unique NEVRAs count#2731

Open
kontura wants to merge 1 commit into
rpm-software-management:mainfrom
kontura:unique
Open

Repo info: add unique NEVRAs count#2731
kontura wants to merge 1 commit into
rpm-software-management:mainfrom
kontura:unique

Conversation

@kontura

@kontura kontura commented May 11, 2026

Copy link
Copy Markdown
Contributor

@kontura kontura requested a review from a team as a code owner May 11, 2026 09:16
@kontura kontura requested review from jrohel and removed request for a team May 11, 2026 09:16
@jrohel jrohel self-assigned this May 18, 2026

@jrohel jrohel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is simple and looks OK functionally. However, I spot an ABI break at first glance. Two approaches come to mind:

  1. We agree on a point when we will introduce breaking changes. But generally speaking, we should minimize breaking the library's ABI.

  2. We create a new interface, for example IRepoInfo2_1, which will inherit from IRepoInfo and contain the newly added method. This would introduce interface versioning. Usage of the passed interface object (e.g., in libdnf5-cli/output/repo_info.cpp) would then require checking which class it inherits from to determine which methods are available.

This way, we would remain backward compatible. Applications compiled with an older version of the library (using the original IRepoInfo) would continue to work with the new library. (Of course, in this case, the new library wouldn't report the number of unique NEVRs, because it wouldn't receive them from the old application using the old interface).

virtual uint64_t get_size() const = 0;
virtual uint64_t get_pkgs() const = 0;
virtual uint64_t get_available_pkgs() const = 0;
virtual uint64_t get_unique_nevras() const = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a virtual method to a public interface class causes a public ABI break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants