Code review comment for lp:~adiroiban/launchpad/bug-527728

Revision history for this message
Adi Roiban (adiroiban) wrote :

= Bug 527728 =

It looks like the source_package is already exported in API (https://api.launchpad.net/+apidoc/#source_package).

To help with translation reporting tasks (https://dev.launchpad.net/Translations/Specs/ReportingAPI) it would be nice to also have the component name for a source package.

== Proposed fix ==
Add compoment_name in the list of exported attributes for ISourcePackage

== Pre-implementation notes ==
Sinzui suggest exporting the compoment_name as latest_published_component_name, since this is the flattening export for latest_published_component

== Implementation details ==

I don't know how to get rid of those lazr.restful lint warning.
Any suggestion is much appreciated.

== Tests ==
lp-test -t source-package.txt

== Demo and Q/A ==
The Ubuntu Hoary source package is exported via API at:
https://launchpad.dev/api/beta/ubuntu/hoary/+source/evolution

The list of attributes should include the „component_name” and it should match the component name displayed at https://launchpad.dev/ubuntu/lucid/+source/evolution

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/interfaces/sourcepackage.py
  lib/lp/registry/model/sourcepackage.py
  lib/lp/registry/stories/webservice/xx-source-package.txt

== Pylint notices ==

lib/lp/registry/interfaces/sourcepackage.py
    21: [F0401] Unable to import 'lazr.enum' (No module named enum)
    27: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
    28: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)
    188: [C0322, ISourcePackage.getBranch] Operator not preceded by a space
    vocabulary=DBEnumeratedType))
    ^

    @operation_returns_entry(Interface)
    @export_read_operation()
    def getBranch(pocket):
    206: [C0322, ISourcePackage.setBranch] Operator not preceded by a space
    vocabulary=DBEnumeratedType),
    ^
    branch=Reference(Interface, title=_("Branch"), required=False))
    @call_with(registrant=REQUEST_USER)
    @export_write_operation()
    def setBranch(pocket, branch, registrant):

« Back to merge proposal