-
Notifications
You must be signed in to change notification settings - Fork 3
API implementation for pagination is broken #134
Comments
👍 this is affecting all installs of my PHP role; hopefully I'm the first person to hit the pagination bug from so many tags :) Thanks for reporting, @oxyc |
The issue is definitely the number of versions exceeding the page size of 50. Part of the problem is an upgrade of django rest framework awhile back changed some field method names and inadvertently changed the 'next' and 'previous' URLs returned by the Galaxy API. The URL started including the protocol and server. I have a fix for that. The next issue is that the API should include /api/v1 at the start of the 'next' and 'previous' URL. However, the ansible-galaxy client has '/api/v1' in it's 'base_url' value that it prepends to the 'next' URL returned by the API. The result will be '/api/v1/api/v1/'. Unfortunately, I think an update to ansible-galaxy is in order. Will open a ticket and submit a PR with the change. |
On second thought, maybe that's not so great. The API could drop the '/api/v1' for now. It's not great, but it should fix the problem for now. |
Fix pushed to galaxy-qa.ansible.com and ready for testing. I tried it out with ansible 1.9.4 and the latest devel branch, and it works for me. I'll push this fix out this evening and update this issue when done. |
Awesome, thanks a lot for finding a solution so quickly! |
I'll also delete a couple tags in the PHP and Node.js roles. |
Hmm... deleting the tags didn't fix the problem—it seems they're permanently stuck in Galaxy for some reason:
If I look at the role page (after reimporting manually), it still lists all those tags: https://galaxy.ansible.com/geerlingguy/php/ Hopefully tonight's fix will get things back in order :) |
This is fixed for users of ansible 2. Unfortunately ansible 1.9.4 is still broke and will require a fix. |
Thanks @chouseknecht, I can confirm this is now resolved for ansible 2 -- https://circleci.com/gh/beetboxvm/beetbox/168 |
Any chance we can have fix for versions older than 2? I am using ansible_local provision with vagrant which isn't playing nice with ansible 2 because of this issue hashicorp/vagrant#6793 |
The fix has been applied to the stable-1.9 branch in https://github.com/ansible/ansible. If you run from that, it will work. I believe this change will be included in the 1.9.5 release. Not sure of the exact release date. You can probably ask in #ansible-devel on IRC. Here is the change in stable-1.9: |
And as patch: |
Pagination seems to be broken for related fields.
Steps to reproduce:
ansible-galaxy install geerlingguy.php -vvv
Output
Note the generated url
https://galaxy.ansible.com/api/v1https://galaxy.ansible.com/api/v1/roles/432/versions/?page=2&page_size=50
.Offending line:
The text was updated successfully, but these errors were encountered: