Code review comment for lp:~andrea.corbellini/launchpad/fix-406523

Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

= Summary =

Bugs, blueprints and answers needs attachments to be inserted in comments. Currently to limit the size bug comments attachments there's a validator in `canonical.launchpad.validators.bugattachments`. It wouldn't be useful to create new validators that do the same thing in the same way for blueprints and answers too.

== Pre-implementation notes ==

I've discussed this change with sinzui and he agreed.

== Implementation details ==

With this branch I've renamed `bugattachments` to `attachments`, making it more generic. I've also renamed the function `bug_attachment_size_constraint()` to `attachment_size_constraint()` and the configuration item `max_bug_attachment_size` to `max_attachment_size`.

== Tests ==

$ bin/test -vv -t lib/lp/bugs/tests/../stories/bugs/xx-bug-comment-attach-file.txt -t lib/lp/bugs/tests/../doc/bugattachments.txt
Running tests at level 1

Running canonical.testing.layers.LaunchpadFunctionalLayer tests:
  Set up canonical.testing.layers.BaseLayer in 0.004 seconds.
  Set up canonical.testing.layers.DatabaseLayer in 0.806 seconds.
  Set up canonical.testing.layers.LibrarianLayer in 9.755 seconds.
  Set up canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
  Set up canonical.testing.layers.FunctionalLayer in 7.743 seconds.
  Set up canonical.testing.layers.GoogleServiceLayer in 1.539 seconds.
  Set up canonical.testing.layers.LaunchpadFunctionalLayer in 0.000 seconds.
  Running:
 lib/lp/bugs/tests/../doc/bugattachments.txt
  Ran 27 tests with 0 failures and 0 errors in 6.076 seconds.
Running canonical.testing.layers.PageTestLayer tests:
  Set up canonical.testing.layers.PageTestLayer in 0.001 seconds.
  Running:
 lib/lp/bugs/tests/../stories/bugs/xx-bug-comment-attach-file.txt
  Ran 8 tests with 0 failures and 0 errors in 20.382 seconds.
Tearing down left over layers:
  Tear down canonical.testing.layers.PageTestLayer in 0.000 seconds.
  Tear down canonical.testing.layers.LaunchpadFunctionalLayer in 0.000 seconds.
  Tear down canonical.testing.layers.LaunchpadLayer in 0.000 seconds.
  Tear down canonical.testing.layers.LibrarianLayer in 0.410 seconds.
  Tear down canonical.testing.layers.GoogleServiceLayer in 0.087 seconds.
  Tear down canonical.testing.layers.FunctionalLayer ... not supported
  Tear down canonical.testing.layers.DatabaseLayer in 0.048 seconds.
  Tear down canonical.testing.layers.BaseLayer in 0.000 seconds.
Total: 35 tests, 0 failures, 0 errors in 48.292 seconds.

== lint ==

`make lint` did not return any error in my code.

« Back to merge proposal