Review Board

beta

Create a draft when uploading a new diff

Updated 1 year, 2 months ago

David Trowbridge Reviewers
trunk reviewboard
73
None Review Board SVN
This changes the two diff upload paths (JSON and view) to
create a new draft and attach the diff to that instead of
writing it to the DiffSetHistory and sending an e-mail
immediately.  This has been requested by a few folks since
they like to look over the diff to make sure it's correct
(viz. changes, trailing whitespace, etc.) before actually
making it public.

As part of this, I'm introducing some more fine-grained
change tracking when we save a draft.
Uploaded diffs, checked that various objects I expected were
in the database.  Added print statements to see whether email
code paths were correct.

This probably needs a lot more; I'll do some on reviewboard-test
to make sure post-review and actual e-mails work.
Posted 1 year, 6 months ago (June 17th, 2007, 3:19 p.m.)
Looks good in general, but how will this work with post-review? Will we end up with a draft that would have to be saved?
  1. David Trowbridge 1 year, 6 months ago (June 17th, 2007, 3:59 p.m.)
    Correct.  I think this is actually what we want (maybe add
    a --publish option for people who don't?).  I know I've
    post-reviewed to update the diff and ended up sending 4 or
    5 emails because I missed something in the diff and had to
    do it again.
    
    Post-reviewing to a draft allows people to look it over,
    then hit publish when they want to actually send the e-mail.
    
    Speaking of e-mail, the main review request template needs
    to be updated to indicate when the draft changed.  Any
    ideas?
Loading diff fragment...
We can move this down further in the function.
Loading diff fragment...
The "or not query" is always going to be true, so there's no point in us having the if statement anymore. We should initialize query here.
Loading diff fragment...
You don't want to take credit for the laziness, leaving it anonymous? ;)
  1. David Trowbridge 1 year, 6 months ago (June 17th, 2007, 4 p.m.)
    Right.
Ship it!
Posted 1 year, 3 months ago (September 24th, 2007, 1:43 a.m.)
Cool, looks good.
Loading diff fragment...
Could shorten this to:

changes[name] = bool(aset.symmetric_difference(bset))