[Twisted-Python] Refactoring Documentation

Glyph Lefkowitz glyph at twistedmatrix.com
Sat Jan 22 22:02:17 EST 2011


On Jan 22, 2011, at 3:18 PM, Tom Davis wrote:

> On Fri, Jan 21, 2011 at 10:00 PM, Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:
> On Jan 20, 2011, at 11:20 PM, Tom Davis wrote:
> 
> If branches that are out there don't meet these standards, commenting on their tickets and getting them deleted or closed as invalid (as appropriate) would be a big help too.  Lots of languishing tickets that nobody knows what to do with is not a good thing, and there's plenty of opportunities for interested parties to reopen tickets, attach new patches, and object in various ways, so you shouldn't be too concerned about stepping on toes.  Focus is a valuable commodity.
> 
> I was wondering to what extent it would be helpful to actually reply to all the tickets, or just the ones that seem to have actionable next steps. I will try to find something to ask or opine on in each of the documentation tickets so we can get them moving along or removed.

Getting rid of dead tickets is almost as important as actually getting valid tickets moved along.  I think this effort will be hugely valuable.

> Part of my comment about low-hanging fruit was to help you get familiar with and integrated into the development process.  Going through the process of getting patches reviewed and accepted will be _much_ easier if you go through the motions of doing a few trivial things first.  In fact you may want to just pick up a couple of trivial non-docs patches as well, which might help you on documenting the development process :). <bit.ly/easy-twisted-tickets> might help you there.
> 
> I will find an easy ticket or few to bang out. I just replied here (http://twistedmatrix.com/trac/ticket/2491) in an attempt to get started on one that doesn't already have a long history.
> 
> After spending about an hour going over the "easy" tickets, it seems many of them are in odd states. Either they're done and waiting on something undefined or there is an incomplete debate in the comments or the owner disappeared or... well, there are lots of examples. Maybe this is just me being dense or whatever, but I think (at least as a newcomer) I could mass-update all these tickets with "Guidance!" and it would more often than not be a relevant comment given the state of the ticket.

No, this is not you being dense.  At least among the core developers in Boston, this is a widely-recognized and frequently-complained-about problem, and it's something I'd like everyone doing ticket reviews to please think about.

Reviewers: if you make a comment on a ticket, but you don't say what you want to happen next, then you have effectively killed progress on that ticket until some other reviewer comes along and contradicts you to get things moving again.  This is especially true if you make one trivial comment on the ticket and remove the review keyword, but don't say "please address these issues and then merge" or "please address these issues and then resubmit for review".  If you've done a partial review, and made a comment like "I don't like this aspect of the design" or "please update copyright dates" or "your docstring formatting is wrong", please note in your comment that this is not a complete review, and don't remove the review keyword.  Removing the keyword will introduce additional latency for the contributor, when other reviewers might still come along and attach more comprehensive feedback.  There are few things more discouraging than having one free weekend every six months to work on a ticket, and to come back every time to "oops, you forgot to update the copyright date and insert a blank line in one file of your 300-line patch".

So, Tom: mass updating those tickets wouldn't be helpful, but an update every couple of days with a specific question on one of these I-don't-know-what-to-do tickets would be great.  Your question on tm.tl/2491 was a definite step forward.

> Here's a great example of what I'm talking about (and I apologize for the mid-message digression, but I think it's relevant...): http://twistedmatrix.com/trac/ticket/4636. This seems totally trivial, but five months later __all__ was never changed in t.i.main and JP's buildbot link is broken. Whether the offending class should be removed from __all__ or imported instead was never even mentioned. Anyway, I took a stab at it and attached a trivial patch so this isn't just another complaint (and it looks like JP closed it while I was drafting this email, so that's great!). But I do agree that working tickets would really help document the process!

As you have discovered here, drawing attention to a ticket in this "stuck" state will often cause it to get un-stuck.  So please keep doing that.

> Mostly, I really don't want you to write a gigantic pile of new documentation and then find, when you're "done", that you missed some nuance of the coding standard, or the patch is too big to be reasonably reviewed, and that now you have three months of additional work to do before it's all really done.  Experience with the process will mitigate that problem significantly.  (And in fact I hope that you don't actually have a gigantic pile of stuff to commit all at once at any point, and can continue this work incrementally as a series of small tickets, but I realize that later on some of the index reorganization stuff may need to be big.  This is mostly just restating what Kevin already said in his message, but it bears repeating.)
> 
> The more I think about this, the more I agree with you. My initial inclination was just to start from scratch and move over existing docs that I found I could use. This doesn't conflict with the reuse I've been supportive of (and for good reason: there's a lot of decent documentation already there) but it does conflict with the Twisted development policies.
> 
> At the end of the day, I can't really submit patches to existing documentation until said documentation is in Sphinx form.

Aaaaaaaauuuuugh.

When you say this, the first thing I think is "okay then, the sphinx migration is now introducing roadblocks into the documentation process and preventing people from contributing documentation, so let's just cancel it".  So please don't say things like this :).  The whole reason that we insisted on the current process for the sphinx migration was to avoid this kind of blockage.

You can submit documentation patches right now, in Lore format - which, I would like to remind you, is 99% plain-vanilla HTML and very easy to edit - and get them accepted.  You can see on the sphinx buildbot (once a few minor issues are fixed, as discussed earlier in this thread) what those changes will look like once converted to ReST->Sphinx.  Or you can simply run the conversion yourself locally - hopefully Kevin will chime in on how to set that up so I don't need to look it up :).  As long as you aren't trying to do anything fancy with diagrams or tables (and most of the documentation really should not need elaborate diagrams or tables), you shouldn't run into any issues.

Heck, if you want to write your documentation patches as ReST snippets and attach them to tickets, I'm sure you will find many willing contributors (myself included) who will jump in and do the format-munging manually to get them integrated into exiting lore documents so that they can make it to trunk immediately.

Or, you can just jump in with ticket reviews, or breaking up chunk tickets, to move along the Sphinx migration quicker.  But "I will work over here in a corner until somehow this gigantic pile of work gets finished by somebody else" is not a good strategy.  (I'm not saying that that's exactly what you're proposing to do, but the aspects of what your proposing which align with that may not be the best way to proceed.)

> I guess one way this could work to the happiness of all involved is:
> Get re-org nailed down; basic samples for whatever pages I think should have standardized format / elements.
> Mixed in here, find existing docs and non-docs tickets to work on trunk.
> When the re-org structure is ready, create a new branch from whatever the current Sphinx conversion branch is (hopefully it'll be "done" at this point)
> Migrate new structure to branch, moving the existing docs to semi-logical-but-possibly-temporary places in the new structure.
> Submit tickets / patches against existing documentation in said branch to move docs to new(er) locations, submit new TDD-style code samples, general edits, new docs, etc.
> When everything is complete, submit a final ticket to merge to trunk
> Does that make sense or am I still cognitively off the mark in terms of existing development practices?

With the caveat of what I said above, most of these things sound like generally good things to do.  Except, first, I'd still like to see a ticket for what "the re-org" is actually going to be and what the point of it is.  If I've only learned one thing in maintaining Twisted for 10 years, it's that a description of what we are trying to do separate from how we are going to do it early on is essential to make sure that others can give you useful feedback - and, more importantly, provide you with resources.  In this case, those resources would be pointers to other areas in the documentation that you may not have noticed which already do some of what you are trying to do, but may be poorly integrated.

> I will be fleshing out those goals more in the coming days, but some of it is implicit within the new documentation structure that's already in my repo.

$ python -c 'import this' | grep Explicit # :-)

> As for a statement of goals when replacing/removing specific documentation, sure, I can do that as necessary. It's impossible to completely remove the element of taste but I will certainly avoid the "because I like this better" argument for making changes.

Again, this is more about having a good statement of purpose up front, so that everyone is focused on the same thing, than having an argument that you can trot out later once everyone starts nitpicking from a hundred different perspectives :).  Plus, such a statement of purpose can serve as a focus for you as well.

>> You will probably have to press us core developers on this one, and you may spark some debates. These tend to sputter out with no clear resolution as everyone is frustrated that nobody's solution (not even their own) is ideal, but you would be doing us all a great service if you really forced us to develop a consensus about certain things (like "what's the best way to build a twisted command-line program", for example) and agree to agree on the current documented "best practice" for those things.
>> 
>> Debates are great!
> 
> Debates that reach some kind of conclusion are great :).  Debates that just go in circles until everybody feels crappy about the topic aren't.  So I'm really just asking you to help us make these debates into the great kind.  (The rest of your reply seems to agree with that, I just wanted to be clear.)
> 
> Yeah, as I've already mentioned in this reply, the "limbo syndrome" of many tickets drives me nuts. I'm sure you guys hate it too, but having somebody new around who isn't afraid to ruffle some feathers for the greater good and isn't yet at some "acceptance" level with it should be helpful! That being said, I will do my best not to be a jerk about it; you guys have been doing this for much, much longer and I respect that.

Tickets in limbo need to be eliminated.  I think you will find that just about everyone is happy to pick up these discussions with an injection of a little bit of attention and energy from a contributor.  We all know that these sap the will of new contributors and thereby decrease the overall pool of available time, so I think you may have to try really, really hard to actually ruffle any feathers :).

>> If you like Python and DNS or SMTP or whatever the hell else, what has the potential to be a more awesome implementation than its Twisted one? Let's help people find out for themselves that the answer is nothing. Then they'll want it to be their project.
> 
> If you do this, you will be my hero forever.
> 
> Twisted is a naturally-superior Python choice for most supported protocols by virtue of the fact that most network "stuff" benefits from event-based solutions. Like, find me a Python DNS server that isn't implemented in Twisted. People have these weird misconceptions about Twisted; it's really hard to grasp, ugly, unmaintained, etc. Ultimately, I want to correct these misconceptions, have twisted.names show up first on Google for "Python DNS Server", and all the other shit that really should be the case but isn't. Resolving these issues should ultimately resolve the problem of maintainers, community involvement, etc.

+10000.

> I can't promise that in the course of this crusade I won't cause grief by trying to change things, but I will always strive to have a rational reason for wanting to do so!

Please keep the grief coming!  It'll all be worth it, I'm sure :).  Everything that you've said so far that I disagree with has just been an opportunity to communicate some of the Twisted development philosophy which may not yet be written down - and should probably be part of the documentation eventually.  So you have yet to do anything which has put me out even in the slightest.  We need more new contributors feeling comfortable being bold and trying to Just Do It.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110122/c66fbdda/attachment-0001.htm 


More information about the Twisted-Python mailing list