-
-
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
Call distinct to the end of the querysets #5872
Conversation
This allow us to extend easily the querysets and use `|` (or) to merge to querysets (this can't be done after calling distinct) This needs changes in .com
I did some builds and navigate the site, everything keeps working |
Seems like this could likely use some additional tests. I'm guessing the |
So, Another reason for this is to be consistent too, we sometimes are returning |
Coverage is good https://codecov.io/gh/readthedocs/readthedocs.org/pull/5872/diff, but it can be improved |
I don't care about coverage as much as making sure we actually have a test for the logic we care about. We should make sure we have a test that is creating duplicated objects, and then confirming they are removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for writing up these tests. I like having this stuff extra tested. 🔒
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a comment in the code (on the class maybe) explaining a little more why this is done in one place (each method) and not in the other (_add_user_repos).
@humitos feel free to add the comment. We have git log and tests to prevent future us from breaking this. |
git log and tests are not docs 😉 |
This allow us to extend easily the querysets
and use
|
(or) to merge to querysets(this can't be done after calling distinct)
This needs changes in .com