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

repo: Add option to download all repository metadata #1879

Merged
merged 4 commits into from
Nov 22, 2024
Merged

Conversation

m-blaha
Copy link
Member

@m-blaha m-blaha commented Nov 20, 2024

Needed for dnf5 reposync --download-metadata command.

Needed for `dnf5 reposync --download-metadata` command.
@kontura kontura self-assigned this Nov 21, 2024
Copy link
Contributor

@kontura kontura left a comment

Choose a reason for hiding this comment

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

It would make sense to me that when all is set it will not only download all metadata types but it will also load and use them. Basically there is a few more places that check what does optional_metadata_types config option contain and they should take all into account.
I think it is important for API users.

Plus it would be good to document the new type in the optional_metadata_types config option docs.

Comment on lines 68 to 69
const std::set<std::string> OPTIONAL_METADATA_TYPES{
METADATA_TYPE_COMPS, METADATA_TYPE_FILELISTS, METADATA_TYPE_OTHER, METADATA_TYPE_PRESTO, METADATA_TYPE_UPDATEINFO};
Copy link
Contributor

@kontura kontura Nov 22, 2024

Choose a reason for hiding this comment

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

It looks like this set is meant to represent all the optional metadata types but its just the ones known to libdnf5, so it is different to the new all.

(Also I think both of its uses are questionable. At least the changelog plugin doesn't need to download/load all of these metadata types, I think it needs just METADATA_TYPE_OTHER.)

This is not that related so I don't believe it should block this PR but some comment that describes the difference between all and OPTIONAL_METADATA_TYPES would be nice.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, I'm thinking about getting rid of OPTIONAL_METADATA_TYPES - changelog definitely doesn't need it and system repo loading should be fine with METADATA_TYPE_ALL.
I can remove it's usage, but since it is on public API I can only mark it deprecated. But the set itself needs to stay for a while.

Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding the system repo I am not sure what its supposed to mean. I think the system repo can only load comps: https://github.com/rpm-software-management/dnf5/blob/main/libdnf5/repo/solv_repo.cpp#L286-L318
I don't think the RepoDownloader::get_optional_metadata() is ever used for system repo.

I haven't really investigated it but in my mind RepoDownloader doesn't seem applicable to system repo.

@m-blaha
Copy link
Member Author

m-blaha commented Nov 22, 2024

@kontura thanks for the review!
I've added documentation for new "all" metadata type, ensure it's taken into account when testing optional_metadata_types value, and removed usage of OPTIONAL_METADATA_TYPES from the changelog plugin.

@kontura kontura added this pull request to the merge queue Nov 22, 2024
Merged via the queue into main with commit d40a0e3 Nov 22, 2024
18 of 20 checks passed
@kontura kontura deleted the mblaha/metadata-all branch November 22, 2024 11:19
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