3263 port web directory.manifest.2 #665
No reviewers
Labels
No Label
Benchmarking and Performance
HTTP Storage Protocol
Nevow Removal
Python 3 Porting
not-for-merge
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: tahoe-lafs/tahoe-lafs#665
Loading…
Reference in New Issue
No description provided.
Delete Branch "ticket3252-port-web-directory.manifest.2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
see https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3263#ticket
Ports the "manifest" part of
allmydata.web.directory
totwisted.web.template
from nevowThis change is
Codecov Report
92.56% <78.18%> (ø)
Continue to review full report at Codecov.
Thanks. Comments left inline. In addition to reading the code, I spun up a node and tried out the manifest functionality. I wasn't able to exercise the "still running" branches easily but the other branches look good to me.
Oof. That was unexpected. Can you file a ticket for replacing
NoNetworkGrid(...)
with an async-friendly API?Bytes or unicode?
Bytes or unicode?
Looks like it returns an empty string (bytes or unicode?) sometimes. I suspect its contract with its caller is that it returns a "flattenable" which is any of a bunch of common types or an object adaptable to
IRenderable
.bytes
andstr
are both in that bunch of common types.Element
itself is new-style. Hopefully the extraobject
here is redundant?timdelta
instead ofint
might be nice for this.int
is more like the old code it should eventually supersede buttimedelta
makes the units self-documenting...For all of the string literals in this method and for the
str
call - bytes or unicode?Pretty much just going to take that one on faith ... I see it is the same as the old code, anyway.
@ -948,0 +1043,4 @@
if cap:
root_url = URL.from_text(u"{}".format(root))
cap_obj = from_string(cap)
if isinstance(cap_obj, (CHKFileURI, WriteableSSKFileURI, ReadonlySSKFileURI)):
What is that monitor attribute?
Seems there was one already: https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2951
I guess this should also probably use
hyperlink
or similar .. and a general question here, because currently theRequest
objects will be Nevow ones (well, actually, Tahoe overrides that withMyRequest
but ..) "until everything is ported", so do I just wrap everything insix.text_type()
.. or is a better pattern to use e.g.u"{}".format(req.prepath[-1]) so that we don't have a bunch of
six` stuff to get rid of later?I'm going to go with the latter ..
@ -948,0 +1043,4 @@
if cap:
root_url = URL.from_text(u"{}".format(root))
cap_obj = from_string(cap)
if isinstance(cap_obj, (CHKFileURI, WriteableSSKFileURI, ReadonlySSKFileURI)):
So ... I think it's supposed to always be an
IMonitor
(which I've documented, now) but also I think sometimes it's an object that just acts like that :/ ...that part, I'm not going to touch.I feel like aborting this PR because of the above is .. overkill? What I put in here was I guess just pragmatic: failing silently on e.g. a syntax error is bad, so this is the minimum to spit out something if grid-setup fails.
👍
(but, i could take it out and do a separate PR .. that should be ultimately fixed by 2951 above?)
I just merged master into this (to get rid of the conflict). (I did this instead of rebasing so comments are hopefully better preserved etc by github)
I agree. Let's not do that.
bump. @exarkun when you have time it would be good to confirm the changes cover your comments. (p.s. the "still running" branches can be seen easily at least for directory-level operations .. for a single file it has to be fairly big)
Thanks. I left a couple minor comments inline but this generally looks good to me. I did notice there is also some missing test coverage ... it was missing before though, too. What's the general thinking here? Should that test coverage be added here or should we make a follow-up ticket and address it later?
Overall, I approve of these changes and wouldn't mind seeing them merged. Address the review feedback as you see fit and then merge. Thanks again.
maybe
allmydata.uri.from_string(...)
? Then there's a bunch ofis_xyz
methods and some interfaces that can be checked.There is a
render_HTML
above which I suppose is now obsolete? I don't see how it could be doing anything, given this newrender_HTML
method, anyway.I think what I meant by that comment was wanting e.g.
is_chk(u"blarg")
or so .. but yeah, I could use.from_string
and make it anisinstance()
instead of astartswith
, which is probably better. Thanks :)