-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add version slug filtering to APIv3 #11275
Conversation
Hopefully this doesn't collide with anything else, but I did notice the results seem backwards while working on the version form. You can reproduce this with: https://beta.readthedocs.org/api/v3/projects/test-builds/versions/ I see the `yaml-v2` branch first. - Refs readthedocs/ext-theme#287
Can we make this change into the model itself instead of this view? Is there any reason to keep this reversed ordering readthedocs.org/readthedocs/builds/models.py Line 210 in 94a0c00
|
I had no clue how to answer that one myself, so just stuck with changing the API for now. I'd agree that's a better place to change it, but why would we have ordered versions like that at all? |
@stsewd do you see any blocker on changing the default sorting for versions instead only on the API response? |
No that I can think of. Maybe API v2. |
If we have no clue why we did this, I am happy to make this change. However, if it cascades into fixing a lot of tests or we aren't 100% on the model change, I would prefer to merge this and address the model change later. |
So yeah, a number of test failures here. But now some of the test failures (especially search unit tests) seem to imply the version list is backwards now: Are we somehow double reversing the ordering? So yeah, I lean towards doing the easiest thing here first and just altering the API response for now. I'm only trying to affect the version listing in the version UI and API listing. Okay to revert 11f78c7? |
Yes. Please, revert and merge the change for the API queryset for now. We can move forward with that and revisit later. Can you open an issue for this? It seems that most of the tests that fail are related with search, so maybe @stsewd can take a look at them. |
I ended up switching the version dropdown to not use our API, so this change also doesn't fix the ordering issue. readthedocs/ext-theme#343 now just uses a queryset from a FilterSet instead. |
So, though the API response is indeed backwards, this fix doesn't address the issue I noticed now. I will close this and we should fix this at the model level to resolve the issue everywhere. I opened #11339 |
Hopefully this doesn't collide with anything else, but I did notice the
results seem backwards while working on the version form. You can
reproduce this with:
https://beta.readthedocs.org/api/v3/projects/test-builds/versions/
I see the
yaml-v2
branch first.