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

Revisit all API list calls to deal with the pagination #2981

Open
lubosmj opened this issue Feb 23, 2023 · 1 comment
Open

Revisit all API list calls to deal with the pagination #2981

lubosmj opened this issue Feb 23, 2023 · 1 comment

Comments

@lubosmj
Copy link
Member

lubosmj commented Feb 23, 2023

A generic fixture will be added to pulpcore. Concrete implementation will be done on the plugin side.

In this task, we will revisit all calls, like: rpm_package_api.list(repository_version=repository.latest_version_href).results. De-pagination should be done in the background in case of multiple items are being returned from the API.

    def get_upstream_distributions(self, labels=None):
        if labels:
            params = {"pulp_label_select": labels}
        else:
            params = {}
        offset = 0
        list_size = 100
        while True:
            distributions = self.distribution_ctx_cls(self.pulp_ctx).list(list_size, offset, params)
            for distro in distributions:
                yield distro
            if len(distributions) < list_size:
                break
            offset += list_size
@lubosmj
Copy link
Member Author

lubosmj commented Mar 7, 2023

I am unassigning myself from the task because it is not prioritized.

@lubosmj lubosmj removed their assignment Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants