Merge lp:~pcjc2/launchpad/allow-empty-comments into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Graham Binns on 2010-12-16 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 12128 |
| Proposed branch: | lp:~pcjc2/launchpad/allow-empty-comments |
| Merge into: | lp:launchpad |
| Diff against target: |
218 lines (+92/-42) 3 files modified
lib/lp/bugs/scripts/bugimport.py (+3/-1) lib/lp/bugs/scripts/tests/test_bugimport.py (+77/-30) scripts/bug-import.py (+12/-11) |
| To merge this branch: | bzr merge lp:~pcjc2/launchpad/allow-empty-comments |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Graham Binns (community) | code | 2010-12-11 | Approve on 2010-12-16 |
| Peter Clifton (community) | Abstain on 2010-12-16 | ||
|
Review via email:
|
|||
Commit Message
[r=gmb][ui=none][bug=692951] Avoid insersion of an "<empty comment>" placeholder for imported bug comments which contain an attachment.
Description of the Change
Without this change, it is not possible for the import to give the same clean, uncluttered blank comments you see when adding files directly from within the launchpad web-interface.
| Peter Clifton (pcjc2) wrote : | # |
Thanks for the review, I'll get onto that when I get a moment.
Is there any chance of getting it merged soon when that is fixed?
I've got our SourceForge bug data for two upstream projects I'm working on (and hoping to move to Launchpad), but they will not import properly without this patch. Is there a particular development / release cycle which will need to be synced up with before we can (for example), use this modification to do an import to Staging for testing?
| Peter Clifton (pcjc2) wrote : | # |
I have updated branch with the following changes:
1. Reformated option arguments as per previous code review
2. Removed --allow-
3. Instead, added a test for attachments when generating the comment message.
This then drops the place-holder "<empty comment>" for those with attachments.
4. Extended the bugimport unit test to check the new behaviour.
| Graham Binns (gmb) wrote : | # |
Hi Peter,
I'm really pleased with this branch - nice work! I've got a couple of stylistic nitpicks but it's nothing major. Once those are fixed I'll push it into our merge machinery for you.
9 + # If there is no attachment and no comment text, use a place-holder
10 + no_attachments = get_element (commentnode, 'attachment') == None
It took me a couple of seconds to parse this. I think it would be better as part of the conditional that follows it, thus:
# If there is no attachment and no comment text, use a place-holder.
if (get_element(
(text is None or text == '')):
...
66 + self.assertEqua
67 + '<email address hidden>')
68 + self.assertEqua
69 + '2005-01-
70 + self.assertEqua
71 + self.assertEqua
72 + self.assertEqua
73 +
74 + # Message 5:
75 + self.assertEqua
76 + '<email address hidden>')
77 + self.assertEqua
78 + '2005-01-
I know that all the other asserts in the test are formatted like this, and I don't expect you to correct those too (I'll file a bug about cleaning it up), but these should be formatted as I said in my other review:
self.
And so on.
| Jelmer Vernooij (jelmer) wrote : | # |
Hi Graham, are you landing this branch ?
| Graham Binns (gmb) wrote : | # |
On Monday, 20 December 2010, Jelmer Vernooij <email address hidden> wrote:
> Hi Graham, are you landing this branch ?
Yes. I was waiting for confirmation of the contributors' agreement
dance having been concluded. I'll land this tomorrow.
--
Graham Binns
http://
| Graham Binns (gmb) wrote : | # |
Hi Peter,
I've passed this on to Gavin Panella (allenap) and Deryck Hodge (deryck) to handle, as I'm taking the day off sick. Hopefully we can find out what's happened with your Contributor Agreement paperwork and get this landed ASAP.
Cheers,
Graham

Hi Peter,
Thanks for this branch. I'm marking it "Needs Fixing" because your
change is untested. We're very strict about adding tests for new
features in Launchpad, and there needs to be a unit test for this new
code before it can land.
The new test should go in lib/lp/ bugs/scripts/ tests/test_ bugimport. py,
along with the other bug import tests. If you need any help writing the
test feel free to ping me (gmb) or Gavin (allenap) in #launchpad-dev on
Freenode.
Besides the test issue I've got one other comment:
37 self.parser. add_option( '--dont- verify- users', dest='verify_ users', 'store_ false', default=True) add_option( '--allow- empty-comments' , empty_comments' , 'store_ true', default=False)
38 help="Don't verify newly created users",
39 action=
40 + self.parser.
41 + dest='allow_
42 + help="Allow empty bug comments",
43 + action=
It would be really great if you could format this, and the lines above
it (which are formatted incorrectly) according to our style guide, which
is thus: