Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Issue 10704252: Extensions Docs Server: Internal file system (Closed)

Created:
8 years, 5 months ago by cduvall
Modified:
8 years, 5 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org, chebert, clintstaley
Visibility:
Public.

Description

Extensions Docs Server: Internal file system The docs server now uses an internal file system to handle fetching and caching resources. This greatly speeds up fetching from SVN. BUG=131095 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=147471

Patch Set 1 #

Patch Set 2 : Tests #

Total comments: 85

Patch Set 3 : Addressed comments #

Patch Set 4 : memcache fix #

Total comments: 14

Patch Set 5 : fixed up #

Unified diffs Side-by-side diffs Delta from patch set Stats (+669 lines, -423 lines) Patch
M chrome/common/extensions/docs/server2/api_data_source.py View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/common/extensions/docs/server2/api_data_source_test.py View 1 2 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/common/extensions/docs/server2/app.yaml View 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/appengine_memcache.py View 1 2 3 4 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/appengine_url_fetcher.py View 1 2 3 4 1 chunk +35 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/branch_utility.py View 1 2 3 4 1 chunk +55 lines, -43 lines 0 comments Download
M chrome/common/extensions/docs/server2/branch_utility_test.py View 1 2 1 chunk +18 lines, -20 lines 0 comments Download
M chrome/common/extensions/docs/server2/build_server.py View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/docs/server2/echo_handler.py View 1 2 6 chunks +46 lines, -21 lines 0 comments Download
M chrome/common/extensions/docs/server2/example_zipper.py View 1 2 2 chunks +7 lines, -9 lines 0 comments Download
A chrome/common/extensions/docs/server2/fake_url_fetcher.py View 1 2 3 4 1 chunk +43 lines, -0 lines 0 comments Download
D chrome/common/extensions/docs/server2/fetcher_cache.py View 1 2 1 chunk +0 lines, -55 lines 0 comments Download
A chrome/common/extensions/docs/server2/file_system.py View 1 2 1 chunk +25 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/file_system_cache.py View 1 2 1 chunk +72 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/future.py View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/in_memory_memcache.py View 1 2 1 chunk +24 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/intro_data_source.py View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
D chrome/common/extensions/docs/server2/local_fetcher.py View 1 chunk +0 lines, -49 lines 0 comments Download
D chrome/common/extensions/docs/server2/local_fetcher_test.py View 1 chunk +0 lines, -37 lines 0 comments Download
A chrome/common/extensions/docs/server2/local_file_system.py View 1 2 1 chunk +44 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/local_file_system_test.py View 1 2 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/memcache_file_system.py View 1 2 1 chunk +56 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/memcache_file_system_test.py View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/samples_data_source.py View 1 2 2 chunks +11 lines, -10 lines 0 comments Download
M chrome/common/extensions/docs/server2/server_instance.py View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
D chrome/common/extensions/docs/server2/subversion_fetcher.py View 1 chunk +0 lines, -49 lines 0 comments Download
D chrome/common/extensions/docs/server2/subversion_fetcher_test.py View 1 chunk +0 lines, -41 lines 0 comments Download
A chrome/common/extensions/docs/server2/subversion_file_system.py View 1 2 1 chunk +52 lines, -0 lines 0 comments Download
A chrome/common/extensions/docs/server2/subversion_file_system_test.py View 1 2 1 chunk +39 lines, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/template_data_source.py View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/common/extensions/docs/server2/template_data_source_test.py View 1 2 4 chunks +9 lines, -9 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/dir/empty.txt View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/file0.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/file1.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/file2.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/file3.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/file4.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/file5.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/list/file6.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/test1.txt View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/test2.txt View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + chrome/common/extensions/docs/server2/test_data/file_system/test3.txt View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/file0.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/file1.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/file2.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/file3.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/file4.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/file5.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/file6.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/list/file0.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/list/file1.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/list/file2.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/list/file3.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/list/file4.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/list/file5.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/recursive_list/list/file6.html View 1 0 chunks +-1 lines, --1 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/test1.txt View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/test2.txt View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/local_fetcher/test3.txt View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/branch1/test.json View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/branch1/test.txt View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/branch2/test.json View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/branch2/test.txt View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/trunk/recursive_list.html View 1 1 chunk +0 lines, -15 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/trunk/recursive_list/list View 1 1 chunk +0 lines, -14 lines 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/trunk/test.json View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_data/subversion_fetcher/trunk/test.txt View 1 1 chunk +0 lines, -1 line 0 comments Download
D chrome/common/extensions/docs/server2/test_urlfetch.py View 1 chunk +0 lines, -23 lines 0 comments Download
D chrome/common/extensions/docs/server2/urlfetch.py View 1 chunk +0 lines, -26 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
cduvall
Thanks for the review!
8 years, 5 months ago (2012-07-17 20:07:10 UTC) #1
not at google - send to devlin
i didn't look at any of the tests, but this is enough comments for now. ...
8 years, 5 months ago (2012-07-18 10:39:15 UTC) #2
cduvall
http://codereview.chromium.org/10704252/diff/3041/chrome/common/extensions/docs/server2/api_data_source_test.py File chrome/common/extensions/docs/server2/api_data_source_test.py (right): http://codereview.chromium.org/10704252/diff/3041/chrome/common/extensions/docs/server2/api_data_source_test.py#newcode23 chrome/common/extensions/docs/server2/api_data_source_test.py:23: fetcher = LocalFileSystem(self._base_path) On 2012/07/18 10:39:15, kalman wrote: > ...
8 years, 5 months ago (2012-07-18 21:26:09 UTC) #3
not at google - send to devlin
Most of my comments are either fairly cosmetic or should be done in a follow-up, ...
8 years, 5 months ago (2012-07-19 03:55:18 UTC) #4
cduvall
8 years, 5 months ago (2012-07-19 17:18:28 UTC) #5
http://codereview.chromium.org/10704252/diff/3041/chrome/common/extensions/do...
File chrome/common/extensions/docs/server2/async_fetch_value.py (right):

http://codereview.chromium.org/10704252/diff/3041/chrome/common/extensions/do...
chrome/common/extensions/docs/server2/async_fetch_value.py:38: if self._error is
not None:
On 2012/07/19 03:55:18, kalman wrote:
> On 2012/07/18 21:26:10, cduvall wrote:
> > On 2012/07/18 10:39:15, kalman wrote:
> > > what's wrong with !=
> > 
> > From PEP 8: "Comparisons to singletons like None should always be done with
is
> > or is not, never the equality operators."
> 
> wtf python. "is not" is an operator? That could equally be read as
> 
> if self._error is (not None):
> 
> which is clearly none. Except apparnetly Python has the world's strangest
> operator. They shoud have made it "isnt", they have "elif", why not...
> 
> kinda kidding. but also kinda not.
> 
> </rant>
> 
> or maybe that should be
> 
> {{/rant}}

haha {{/rant}}

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
File chrome/common/extensions/docs/server2/appengine_memcache.py (right):

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
chrome/common/extensions/docs/server2/appengine_memcache.py:21:
namespace=self._branch + namespace,
On 2012/07/19 03:55:19, kalman wrote:
> could you put the branch at the end (with a . separating), i think that might
> look better when viewing stuff that's memcached.
> 
> Which I presume you can do.

Done.

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
File chrome/common/extensions/docs/server2/appengine_url_fetcher.py (right):

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
chrome/common/extensions/docs/server2/appengine_url_fetcher.py:29: class
_AsyncFetchDelegate(object):
On 2012/07/19 03:55:19, kalman wrote:
> nit: at top, outside the class scope

Done.

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
File chrome/common/extensions/docs/server2/branch_utility.py (right):

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
chrome/common/extensions/docs/server2/branch_utility.py:62: return
sorted_branches[0][0]
On 2012/07/19 03:55:19, kalman wrote:
> can you cache this value rather than the unparsed json?

Done.

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
File chrome/common/extensions/docs/server2/fake_url_fetcher.py (right):

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
chrome/common/extensions/docs/server2/fake_url_fetcher.py:32: self.status_code =
200
On 2012/07/19 03:55:19, kalman wrote:
> nit: can go outside the class at the top

Done.

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
File chrome/common/extensions/docs/server2/memcache_file_system_test.py (right):

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
chrome/common/extensions/docs/server2/memcache_file_system_test.py:37:
(self._file_system._memcache._cache[memcache.MEMCACHE_FILE_SYSTEM_READ]
On 2012/07/19 03:55:19, kalman wrote:
> Shoudn't need to access local variables like this. That's why we would hold
onto
> the memcache ourselves locally, in setUp():
> 
> self._memcache = InMemoryMemcache()
> self._file_system = ..
> 
> then use _memcache here.
> 
> However, likewise, don't access private members of it. Either add
test-friendly
> methods to it, or utilise its interface methods; I think the latter would work
> fine in this particular case?
> 
> expected.remove('file0.html')
> self._memcache.Set('list/', expected, memcache.MEMCACHE_FILE_SYSTEM_READ)
> 
> etc.

Done.

http://codereview.chromium.org/10704252/diff/18076/chrome/common/extensions/d...
chrome/common/extensions/docs/server2/memcache_file_system_test.py:43: 
On 2012/07/19 03:55:19, kalman wrote:
> In any case, these tests don't really test the point of MemcacheFileSystem, in
> that it's supposed to be efficient.
> 
> Like, test that if Stat returns the same thing, Read doesn't get called.
> 
> For that you might want more of a Mock object, or at least, an object that
> records how many times "read" has been called or something.
> 
> But I think you should add those kind of tests after we resolve what the
> interface to Stat should be.

Ok, sounds good.

Powered by Google App Engine
This is Rietveld 408576698