-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Changes and fixes to symlinking and serving #2611
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
Conversation
52fe4d9
to
31459e1
Compare
31459e1
to
f4198a9
Compare
I feel like this stuff needs to be documented, as reading through it it's really hard to infer why it was designed this particular way. I'd suggest adding it to either a design or architecture doc in our actual documentation. |
} | ||
defaults.update(kwargs) | ||
return self.create(**defaults) | ||
def for_project(self, project): |
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.
This doesn't appear to be used anywhere?
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's used on the overrides for rtd.com, but I believe the same bug exists in the .org as well. I'm testing it now.
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.
So, the serving bug would exist here, but because we are only serving public projects, it's can't be reproduced. The bug is most noticeable when there is a mismatch in privacy levels on versions.
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 overall. Needs some docs explaining the code concepts, and why they were required I think before merging. e.g. why is it required that we proxy classmethod's and use proxy classes in this design?
self.assertFilesystem(filesystem) | ||
|
||
|
||
@override_settings() |
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.
Does this do anything when called without arguments? I thought it was used to set settings explicitly.
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.
Wrapping a class/method like this isolates changes to settings
from leaking out. On decorating, setUp
/tearDown
additions are added and the standard settings._wrapped
-- the underlying object on the django lazy settings object -- is temporarily replaced.
Agree on docs for extension pattern, but can deal with it in #2618 perhaps? |
Makes sense |
This allows for override of the symlinking classes, as we need to be able to
override how public and private symlinks are determined. Test coverage is expanded greatly on symlinking here:
Our extension pattern was tuned up and simplified here, the django lazy object didn't allow for passing of classmethods.
This also moves the Version manager into a Version queryset + manager pattern, as we need to be able to chain queries from the managers, which isn't possible without a queryset object. This is a pattern we should adopt on the remaining managers, but I didn't touch that here. I'll open a ticket to address this.