-
Notifications
You must be signed in to change notification settings - Fork 902
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
Use the user-provided page size when querying repositories #3502
Comments
We only support the latest version for open-source. Please upgrade and update the issue description and logs. Please also provide the installed packages list and the System Details and the configuration of Sleet. Your logs don't contain |
Hello @pauby , Thanks for your reply. I upgraded the choco version to the latest one. 2.3.0. And I still see the same issues. Choco search can only list 30 packages eventhough the sleet source contains more than 30 packages. Sleet json config is used as { nupkgs are pushed to this bucket using the command Sleet Push d:/nupkgfile |
Have you tried to query the source using What happens if you use |
Hi @pauby I just tried using nuget.exe and it cqan list fewer than 30 packages.. |
Did you mean more than 30 packages? How many did it list? What command did you use?
The 1000 limit is for package versions, nor packages. Worth |
our packages have multiple versions. Fot eg., Package1 will have 10 versions and Package2 will have 20 version. However the total packages in the Bucket is 192 and the total version is 1612. But Choc search list only first 30 packages and choco search --all-versions lists only 452 packages which are the total of first 30 packages, |
I also tested with a new bucket which has only 32 packages with a total of 400 packages and I still go 1000 limit error. So choco somehow limits to list only the first 30 packages. Is there a configuration that I am missing to make it list everything? Choco config do not have any setting for page size of package list limit. |
There is no configuration option you're missing. Thanks for testing all of that. Leave it with me as we'll need to reproduce your setup and the issue to see what is going on. |
@pauby Thank you for your support. Sleet Init command to initialse your bucket. Set up your choco source as Use command "Choco Search" and it will list only 30 packages with an message |
Hi @pauby Any luck with this? were you able to reproduce this issue? Thanks! |
@prsshini thank you for bringing up this issue. I have done some investigation work, and I can report that I am able to reproduce this issue. Based on some discussions internally, we have decided on a path forward, which I wanted to lay out here. To confirm what was done for our internal testing...
Now that this was up and running, the following results were observed...
In summary, based on these tests, it would appear that nuget.exe is working correctly, and choco.exe is not working correctly. However, there are some technical details here that I think need to be explained, as it is a combination of the way that choco.exe is working, and how sleet is working, that cause the problem. The first thing to point out is that the search in sleet, by default, doesn't actually do anything except return all the packages that exist on the static feed. It doesn't look at the incoming query parameters and filter the results to match what is requested. It simply returns all the packages. This is documented on the sleet GitHub repository, and a link is provided to this blog post to allow true search results to be returned. Am I right in saying that you aren't using the Sleet.Search package, and instead using the default sleet search? I am assuming that this is the case, as that is what matches the replication steps that I have done. In principal, returning an unfiltered list of packages in each search query that is done would appear to give exactly what you are looking for, however, this causes problem in how Chocolatey CLI operates. Let me try to explain... Due to this section of code, the maximum page size for a request from Chocolatey CLI is 30 packages. This is due to some historical problems with larger page sizes against Chocolatey Community Repository as well as some other Repository Managers, like Nexus. As a result, when you attempt to run the following command:
There are actually two outgoing queries, which can be seen here: The result of these two queries is that a total of 40 packages should be returned. However, since sleet is returning the exact same information from both queries, Chocolatey CLI actually only sees the first 30 packages, since the packages that are returned are essentially duplicates, and they are ignored. When nuget.exe does the following command:
There is only 1 outgoing query: Which means that nuget.exe can see all the packages, as there are no duplicates. I hope this serves to illustrate what is going on here, if not, please let me know, and I can try to explain further. In terms of what we plan to do to improve this experience...
Keep in mind, due to the upper limit of allowed packages in the response to a search query, as well as the upper limit on allowed page sizes, you may still not be able to return all packages from sleet. However, this is purely down to the responses that sleet is providing by default. The change here is to try to make things better, but it is not a guarantee that things will work as you want. The best recommendation would be to introduce the Sleet.Search package, as mentioned earlier. |
@gep13 Thank you for your detailed response. Just to confirm your question, we are not using Sleet.Search and just using the default sleet search. So your assumption is right. In terms to the fix that you are proposing, When you say page-size, it doesnt literally mean "page", correct? it means number of packages it can display in one query. When we use 2 sources, (primary and secondary) when the number of distinct packages from both the sources can exceed 100, isnt that a common business use case? When do you think the proposed fixes be pushed? In the meantime, we will try to explore Sleet.Search to see if it fits our need. Thanks for your time and support. |
Here, I am referring to the number of results that should be returned from the search query. For example, if I did:
I would expect 5 results to be returned, even if there were more than 5 results available. While this paging is typically done on the Repository Manager (but as described, Sleet isn't doing this), the truncation to that page size is also done on the client side, to make sure that the correct number of requested results are returned.
The
I have added this issue to the 2.4.0 milestone, which will be the next release of Chocolatey CLI, but I can't offer any indication on when this will be released.
I believe that will be the best course of action, given your use case here. |
While I have a script running to populate my test repository, I want to expand on some of the steps @gep13 mentioned here: #3502 (comment) Between steps 1 and 3 I found I needed to initialize the sleet configuration. I followed the steps here: https://github.com/emgarten/Sleet/blob/main/doc/feed-type-local.md In particular I needed: sleet createconfig
notepad sleet.json # edit the config to match their example
sleet init --config .\sleet.json --source myLocalFeed The contents of my
Then for step 4, I opened |
If a page size has been specified, use it. Also emit a warning if it's something other than 30 as there are known issues with some feeds.
The integration test for PageSize broke because the message was changed in chocolatey#3507. This updated the test to use the new wording.
If a page size has been specified, use it. Also emit a warning if it's something other than 30 as there are known issues with some feeds.
The integration test for PageSize broke because the message was changed in chocolatey#3507. This updated the test to use the new wording.
If a page size has been specified, use it. Also emit a warning if it's something other than 30 as there are known issues with some feeds.
The integration test for PageSize broke because the message was changed in chocolatey#3507. This updated the test to use the new wording.
Add tests to exercise the messages added for page sizes and ensure they are behaving as expected.
If a page size has been specified, use it. Also emit a warning if it's something other than 30 as there are known issues with some feeds.
The integration test for PageSize broke because the message was changed in chocolatey#3507. This updated the test to use the new wording.
Add tests to exercise the messages added for page sizes and ensure they are behaving as expected.
(#3502) Return the PageSize if specified
The CommandName is null when the list method is called during alternate source commands.
The Test Kitchen environment has both `hermes` and `hermes-all` enabled. This results in a duplication of the warning message. This disables all the sources and then enables just the `hermes` source. # Please enter the commit message for your changes. Lines starting
The Test Kitchen environment has both `hermes` and `hermes-all` enabled. This results in a duplication of the warning message. This disables all the sources and then enables just the `hermes` source. # Please enter the commit message for your changes. Lines starting
The Test Kitchen environment has both `hermes` and `hermes-all` enabled. This results in a duplication of the warning message. This disables all the sources and then enables just the `hermes` source. # Please enter the commit message for your changes. Lines starting
The Test Kitchen environment has both `hermes` and `hermes-all` enabled. This results in a duplication of the warning message. This disables all the sources and then enables just the `hermes` source. # Please enter the commit message for your changes. Lines starting
🎉 This issue has been resolved in version 2.4.0 🎉 The release is available on: |
Checklist
What You Are Seeing?
Our S3 bucket source contains 1612 packages with 194 folders (with different versions of nupkgs in each folder).
Choco source is set as Sleet source, however, when running Chocolatey CLI, we get the following:
Choco search command can only list 30 packages . Rest of the packages in the S3 bucket is not getting listed.
We tried
and
All of them have the same behavior to list only 30 packages.
Could you let me know if any choco settings that is preventing to list all the packages?
What is Expected?
To List all the 194 packages.
How Did You Get This To Happen?
The source contains 194 packages. And the source is an s3 bucket with packages pushed via Sleet.
Using chocolatey version 2.2.2
System Details
Installed Packages
N/A
Output Log
Additional Context
I am able to search a package from Sleet S3 source using the command:
This is lists as expected.
@gep13 added:
See the comment here which provides more information about the investigation into this issue, as well as a plan for steps moving forward.
The text was updated successfully, but these errors were encountered: