Skip to content

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

Merged
merged 5 commits into from
Jan 28, 2017
Merged

Conversation

agjohnson
Copy link
Contributor

@agjohnson agjohnson commented Jan 25, 2017

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:

  • Dropped pattern of testing for command execution and singular symlinks for testing filesystem snapshot
  • Symlinks are built under isolated tempdirs now
  • All testcases test public/private privacy
  • Privacy level on project/versions is explicit now

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.

@agjohnson agjohnson added the PR: work in progress Pull request is not ready for full review label Jan 25, 2017
@agjohnson agjohnson force-pushed the symlink-translations branch from 52fe4d9 to 31459e1 Compare January 27, 2017 07:36
@agjohnson agjohnson force-pushed the symlink-translations branch from 31459e1 to f4198a9 Compare January 27, 2017 07:41
@agjohnson agjohnson added PR: ready for review and removed PR: work in progress Pull request is not ready for full review labels Jan 27, 2017
@ericholscher
Copy link
Member

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):
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

@ericholscher ericholscher left a 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()
Copy link
Member

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.

Copy link
Contributor Author

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.

@agjohnson
Copy link
Contributor Author

Agree on docs for extension pattern, but can deal with it in #2618 perhaps?

@ericholscher
Copy link
Member

Makes sense

@agjohnson agjohnson merged commit ae67af4 into master Jan 28, 2017
@agjohnson agjohnson deleted the symlink-translations branch January 28, 2017 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants