Inspirated

 
 

June 3, 2010

Summer of Code Progress: Bug collections and attachment search

Filed under: Blog — krkhan @ 7:37 pm

Related Links

Summer of Code Archive Inspirated Code
Report Guidelines Ubuntu Wiki
Original Proposal Ubuntu Wiki

Time Spent

11 hours.

Highlights

Storm is by far the most intuitive way I have ever dealt with relational databases. Because of its pretty integration with Zope in Launchpad, I was able to make modifications to the core in a brief, consistent and non-disruptive way.

Concerns

While searching each attachment on the remote server works uber-fast, I don’t think it’ll be easy to have such a feature merged upstream. It may be argued that going through each file at the server side produces unnecessary load. In order to address such concerns I’ll have to generate relevant statistics after testing the changes extensively.

I still don’t understand Launchpad’s branch structure in detail. I’ve noticed that my branches are forked from devel-db instead of devel. I’m confused about the implications this will have on merge proposals and will consult Bryce about it tonight.

Waiting Items

None.

Stalled Items

None.

Accomplishments

  • Patch: Exported bug collection for product.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    
    <rest-client version="2.3">
    <request>
    <http-version>1.1</http-version>
    <URL>https://api.launchpad.dev/beta/firefox/bugs</URL>
    <method>GET</method>
    <ssl-truststore>/home/krkhan/.keystore</ssl-truststore>
    <ssl-truststore-password>rO0ABXQAB2tyYWNrM2Q=</ssl-truststore-password>
    <ssl-hostname-verifier>ALLOW_ALL</ssl-hostname-verifier>
    <headers>
    <header key="Authorization" value="OAuth realm="OAuth", oauth_nonce="FFFF", oauth_timestamp="1275040360", oauth_consumer_key="just%20testing", oauth_signature_method="PLAINTEXT", oauth_version="1.0", oauth_token="MzwdT4XCNCV2D7m9dK5f", oauth_signature="%260RsqWntpzJWLRnLJV8ML5FBw5700d8qVFFRrNP7mvpbLn2mDCX1DTQXRHTGgPBfx34qMn70fZ4r0DDHM""/>
    <header key="Accept" value="application/json"/>
    <header key="Host" value="api.launchpad.dev"/>
    </headers>
    </request>
    </rest-client>
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    
    <rest-client version="2.3">
    <response>
    <execution-time>1055</execution-time>
    <status code="200">HTTP/1.1 200 Ok</status>
    <headers>
    <header key="Date" value="Thu, 03 Jun 2010 13:08:31 GMT"/>
    <header key="Server" value="zope.server.http (DebugLayerHTTP)"/>
    <header key="X-Powered-By" value="Zope (www.zope.org), Python (www.python.org)"/>
    <header key="Content-Type" value="application/json"/>
    <header key="Content-Length" value="8888"/>
    <header key="Vary" value="Accept,Accept-Encoding"/>
    <header key="Via" value="1.1 launchpad.dev"/>
    <header key="Keep-Alive" value="timeout=15, max=100"/>
    <header key="Connection" value="Keep-Alive"/>
    </headers>
    <body>
    {
       total_size         : 4,
       start              : 0,
       resource_type_link : 'https://api.launchpad.dev/beta/#bug-page-resource',
       entries            : [
          {
             users_unaffected_collection_link          : 'https://api.launchpad.dev/beta/bugs/1/users_unaffected',
             latest_patch_uploaded                     : null,
             users_affected_count_with_dupes           : 0,
             security_related                          : false,
             private                                   : false,
             bug_watches_collection_link               : 'https://api.launchpad.dev/beta/bugs/1/bug_watches',
             date_made_private                         : null,
             linked_branches_collection_link           : 'https://api.launchpad.dev/beta/bugs/1/linked_branches',
             subscriptions_collection_link             : 'https://api.launchpad.dev/beta/bugs/1/subscriptions',
             number_of_duplicates                      : 0,
             id                                        : 1,
             users_unaffected_count                    : 0,
             title                                     : 'Firefox does not support SVG',
             name                                      : null,
             http_etag                                 : '"04c8bb0158a201216e08c5d57e91211a2fa81843-fbd7bf01b3db545656a06d258acd96d362499c81"',
             messages_collection_link                  : 'https://api.launchpad.dev/beta/bugs/1/messages',
             self_link                                 : 'https://api.launchpad.dev/beta/bugs/1',
             who_made_private_link                     : null,
             attachments_collection_link               : 'https://api.launchpad.dev/beta/bugs/1/attachments',
             resource_type_link                        : 'https://api.launchpad.dev/beta/#bug',
             date_last_updated                         : '2006-05-19T06:37:40.344941+00:00',
             description                               : 'Firefox needs to support embedded SVG images, now that the standard has been finalised.\n\nThe SVG standard 1.0 is complete, and draft implementations for Firefox exist. One of these implementations needs to be integrated with the base install of Firefox. Ideally, the implementation needs to include support for the manipulation of SVG objects from JavaScript to enable interactive and dynamic SVG drawings.',
             duplicates_collection_link                : 'https://api.launchpad.dev/beta/bugs/1/duplicates',
             tags                                      : [],
             message_count                             : 2,
             heat                                      : 0,
             bug_tasks_collection_link                 : 'https://api.launchpad.dev/beta/bugs/1/bug_tasks',
             cves_collection_link                      : 'https://api.launchpad.dev/beta/bugs/1/cves',
             users_affected_with_dupes_collection_link : 'https://api.launchpad.dev/beta/bugs/1/users_affected_with_dupes',
             duplicate_of_link                         : null,
             users_affected_count                      : 0,
             owner_link                                : 'https://api.launchpad.dev/beta/~name12',
             date_created                              : '2004-01-01T20:58:04.553583+00:00',
             can_expire                                : false,
             date_last_message                         : null,
             users_affected_collection_link            : 'https://api.launchpad.dev/beta/bugs/1/users_affected'
          },
          <!-- entries omitted -->
       ]
    }
    </body>
    </response>
    </rest-client>
  • Patch: Added findAttachment method for bugs.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    
    <rest-client version="2.3">
    <request>
    <http-version>1.1</http-version>
    <URL>
    https://api.launchpad.dev/beta/bugs/15?ws.op=findAttachments&amp;text=char%20buf
    </URL>
    <method>GET</method>
    <ssl-truststore>/home/krkhan/.keystore</ssl-truststore>
    <ssl-truststore-password>rO0ABXQAB2tyYWNrM2Q=</ssl-truststore-password>
    <ssl-hostname-verifier>ALLOW_ALL</ssl-hostname-verifier>
    <headers>
    <header key="Authorization" value="OAuth realm="OAuth", oauth_nonce="FFFF", oauth_timestamp="1275040360", oauth_consumer_key="just%20testing", oauth_signature_method="PLAINTEXT", oauth_version="1.0", oauth_token="MzwdT4XCNCV2D7m9dK5f", oauth_signature="%260RsqWntpzJWLRnLJV8ML5FBw5700d8qVFFRrNP7mvpbLn2mDCX1DTQXRHTGgPBfx34qMn70fZ4r0DDHM""/>
    <header key="Accept" value="application/json"/>
    <header key="Host" value="api.launchpad.dev"/>
    </headers>
    </request>
    </rest-client>
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    
    <rest-client version="2.3">
    <response>
    <execution-time>698</execution-time>
    <status code="200">HTTP/1.1 200 Ok</status>
    <headers>
    <header key="Date" value="Thu, 03 Jun 2010 13:08:10 GMT"/>
    <header key="Server" value="zope.server.http (DebugLayerHTTP)"/>
    <header key="X-Powered-By" value="Zope (www.zope.org), Python (www.python.org)"/>
    <header key="Content-Type" value="application/json"/>
    <header key="Content-Length" value="553"/>
    <header key="Vary" value="Accept,Accept-Encoding"/>
    <header key="Via" value="1.1 launchpad.dev"/>
    <header key="Keep-Alive" value="timeout=15, max=100"/>
    <header key="Connection" value="Keep-Alive"/>
    </headers>
    <body>
    {
       total_size : 1,
       start      : 0,
       entries    : [
          {
             title              : 'Buffer Overflow Intro.txt',
             bug_link           : 'https://api.launchpad.dev/beta/bugs/15',
             data_link          : 'https://api.launchpad.dev/beta/bugs/15/+attachment/2/data',
             http_etag          : '"0edda8c433532e60707d34a322ce808dbc508ef1-2e61275e2b0bd7cc15cc6322c5fd26c66272dfa6"',
             message_link       : 'https://api.launchpad.dev/beta/redfish/+bug/15/comments/8',
             type               : 'Unspecified',
             self_link          : 'https://api.launchpad.dev/beta/bugs/15/+attachment/2',
             resource_type_link : 'https://api.launchpad.dev/beta/#bug_attachment'
          }
       ]
    }
    </body>
    </response>
    </rest-client>

Minor Tasks

To simplify the task of debugging Launchpad, I gave my Ubuntu VM remote-access and edited Apache configuration accordingly. Now I can just make changes to the sources using NFS mounted branches and test them in my host browser using launchpad.dev.

Actions for the Following Report

I haven’t yet decided whether I should focus on getting these changes merged into trunk yet or instead move on to launchpadlib and arsenal aspect of my project. Guess I’ll just add the matter to the list of items I need to discuss during tonight’s IRC meeting.

Tags: , , , , , , , , ,

May 28, 2010

Summer of Code Progress: REST collections

Filed under: Blog — krkhan @ 6:44 pm

Starting from this post, I will be documenting my SoC progress according to the Ubuntu guidelines. This will enable me to log my activities in an organized manner. The inaugural report:

Related Links

Summer of Code Archive Inspirated Code
Report Guidelines Ubuntu Wiki
Original Proposal Ubuntu Wiki

Time Spent

8 hours.

Highlights

This is my first experience of developing on a Zope project. The fact that the project is already deployed in a large-scale production environment is daunting as well as exciting at the same time. For Launchpad work, I learned only the bare essentials of Zope, i.e., things that are directly related with my project such as interfaces and adapters. After SoC however, I plan on exploring it in more detail.

Concerns

Testing Launchpad modifications is a beast of a task. After making each set of changes to the code, I have to stop the server and relaunch it again which takes at least 30 seconds. It becomes especially frustrating when I’m in the process of making tiny changes in order to explore the API.

I’ve tried to work around this issue by using pdb.set_trace(). Still, it’s no substitute for being able to edit whole files in one go.

Waiting Items

None.

Stalled Tasks

None.

Accomplishments

  • Test locally running Launchpad with a RESTClient.
  • Go through the code-base and figure out the portions which deal with API services.
  • Export a bug collection for every project:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    <rest-client version="2.3"><request>
    <http-version>1.1</http-version>
    <URL>https://api.launchpad.dev/beta/alsa-utils/bugs</URL>
    <method>GET</method>
    <ssl-truststore>/home/inspirated/.keystore</ssl-truststore>
    <ssl-truststore-password>rO0ABXQAB2tyYWNrM2Q=</ssl-truststore-password>
    <ssl-hostname-verifier>ALLOW_ALL</ssl-hostname-verifier>
    <headers>
    <header key="Authorization" value="OAuth realm="OAuth", oauth_nonce="FFFF", oauth_timestamp="1275040360", oauth_consumer_key="just%20testing", oauth_signature_method="PLAINTEXT", oauth_version="1.0", oauth_token="0NWl33zGj3QDtxFWdHCt", oauth_signature="%261XP9XCptHQ3S8g49RjFTr3xFlrK0H73Z5QjbGbxs1pMTc5mzptq0Z5Qs93gjcXDQtqlgFSVVQBPLdK47""/>
    <header key="Accept" value="application/json"/>
    <header key="Host" value="api.launchpad.dev"/>
    </headers>
    </request>
    </rest-client>
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    
    <rest-client version="2.3">
    <response>
    <execution-time>1833</execution-time>
    <status code="200">HTTP/1.1 200 Ok</status>
    <headers>
    <header key="Date" value="Fri, 28 May 2010 12:50:18 GMT"/>
    <header key="Server" value="zope.server.http (DebugLayerHTTP)"/>
    <header key="X-Powered-By" value="Zope (www.zope.org), Python (www.python.org)"/>
    <header key="Content-Type" value="application/json"/>
    <header key="Content-Length" value="10736"/>
    <header key="Vary" value="Accept,Accept-Encoding"/>
    <header key="Via" value="1.1 launchpad.dev"/>
    <header key="Keep-Alive" value="timeout=15, max=100"/>
    <header key="Connection" value="Keep-Alive"/>
    </headers>
    <body>
    {
       total_size           : 15,
       start                : 0,
       resource_type_link   : 'https://api.launchpad.dev/beta/#bug-page-resource',
       next_collection_link : 'https://api.launchpad.dev/beta/alsa-utils/bugs?ws.start=5&amp;ws.size=5',
       entries              : [
          {
             users_unaffected_collection_link          : 'https://api.launchpad.dev/beta/bugs/15/users_unaffected',
             latest_patch_uploaded                     : null,
             users_affected_count_with_dupes           : 0,
             security_related                          : false,
             private                                   : false,
             bug_watches_collection_link               : 'https://api.launchpad.dev/beta/bugs/15/bug_watches',
             date_made_private                         : null,
             linked_branches_collection_link           : 'https://api.launchpad.dev/beta/bugs/15/linked_branches',
             subscriptions_collection_link             : 'https://api.launchpad.dev/beta/bugs/15/subscriptions',
             number_of_duplicates                      : 0,
             id                                        : 15,
             users_unaffected_count                    : 0,
             title                                     : 'Nonsensical bugs are useless',
             name                                      : null,
             http_etag                                 : '"23e175849b60b27f5553ddb56995e044c71d745a-ce4f09c837a78ed5fdf23f759020058f3423a804"',
             messages_collection_link                  : 'https://api.launchpad.dev/beta/bugs/15/messages',
             self_link                                 : 'https://api.launchpad.dev/beta/bugs/15',
             who_made_private_link                     : null,
             attachments_collection_link               : 'https://api.launchpad.dev/beta/bugs/15/attachments',
             resource_type_link                        : 'https://api.launchpad.dev/beta/#bug',
             date_last_updated                         : '2007-12-18T16:31:34.972893+00:00',
             description                               : 'Like this one, natch.',
             duplicates_collection_link                : 'https://api.launchpad.dev/beta/bugs/15/duplicates',
             tags                                      : [],
             message_count                             : 7,
             heat                                      : 0,
             bug_tasks_collection_link                 : 'https://api.launchpad.dev/beta/bugs/15/bug_tasks',
             cves_collection_link                      : 'https://api.launchpad.dev/beta/bugs/15/cves',
             users_affected_with_dupes_collection_link : 'https://api.launchpad.dev/beta/bugs/15/users_affected_with_dupes',
             duplicate_of_link                         : null,
             users_affected_count                      : 0,
             owner_link                                : 'https://api.launchpad.dev/beta/~name16',
             date_created                              : '2007-12-18T16:30:19.103679+00:00',
             can_expire                                : false,
             date_last_message                         : '2007-12-18T16:31:34.790641+00:00',
             users_affected_collection_link            : 'https://api.launchpad.dev/beta/bugs/15/users_affected'
          },
          <!-- entries omitted -->
          {
             users_unaffected_collection_link          : 'https://api.launchpad.dev/beta/bugs/11/users_unaffected',
             latest_patch_uploaded                     : null,
             users_affected_count_with_dupes           : 0,
             security_related                          : false,
             private                                   : false,
             bug_watches_collection_link               : 'https://api.launchpad.dev/beta/bugs/11/bug_watches',
             date_made_private                         : null,
             linked_branches_collection_link           : 'https://api.launchpad.dev/beta/bugs/11/linked_branches',
             subscriptions_collection_link             : 'https://api.launchpad.dev/beta/bugs/11/subscriptions',
             number_of_duplicates                      : 0,
             id                                        : 11,
             users_unaffected_count                    : 0,
             title                                     : 'Make Jokosher use autoaudiosink',
             name                                      : null,
             http_etag                                 : '"8675b8d2649cf0c08d58681036ef1e8bb6a20e78-d7d969f7ed8c2f2def4d9e429f23ac41f7fec4dc"',
             messages_collection_link                  : 'https://api.launchpad.dev/beta/bugs/11/messages',
             self_link                                 : 'https://api.launchpad.dev/beta/bugs/11',
             who_made_private_link                     : null,
             attachments_collection_link               : 'https://api.launchpad.dev/beta/bugs/11/attachments',
             resource_type_link                        : 'https://api.launchpad.dev/beta/#bug',
             date_last_updated                         : '2007-03-15T20:37:51.603369+00:00',
             description                               : 'I\'ve had problems when switching from Jokosher to Totem to play an Ogg.\n\nTotem appears to be playing normally but does not produce any sound.\nIf I close Jokosher then you can hear totem.\n\nI\'ve also had a problem when trying to playback sound within jokosher\nafter switch from another app (I think it was xmms). I get a dialog\nwith the following text:\n\n     Argh! Something went wrong and a serious error occurred:\n\n     Resource busy or not available.\n\n     gstalsasink.c(636): gst_alsasink_open (): /timeline/playbackbin/\n     alsasink0:\n     Device \'hw:0\' is busy\n\nAfter closing and reopening Jokosher, i got the same error again.\nAfter logging out of gnome and logging in again - I still got the same\nerror message.\n\nI had to restart!\n\nIs there some way to reset alsa or the device driver - with out having\nto restart?\n\nRunning on Ubuntu - with Jokosher 0.2 runscript.',
             duplicates_collection_link                : 'https://api.launchpad.dev/beta/bugs/11/duplicates',
             tags                                      : [],
             message_count                             : 7,
             heat                                      : 0,
             bug_tasks_collection_link                 : 'https://api.launchpad.dev/beta/bugs/11/bug_tasks',
             cves_collection_link                      : 'https://api.launchpad.dev/beta/bugs/11/cves',
             users_affected_with_dupes_collection_link : 'https://api.launchpad.dev/beta/bugs/11/users_affected_with_dupes',
             duplicate_of_link                         : null,
             users_affected_count                      : 0,
             owner_link                                : 'https://api.launchpad.dev/beta/~name16',
             date_created                              : '2007-03-15T20:33:56.678930+00:00',
             can_expire                                : false,
             date_last_message                         : null,
             users_affected_collection_link            : 'https://api.launchpad.dev/beta/bugs/11/users_affected'
          }
       ]
    }
    </body>
    </response>
    </rest-client>

Minor Tasks

Having gotten stuck on the task of running RESTClient against my Launchpad instance, I ran into a few issues such as RESTClient’s refusal to accept the local SSL certificate and confusion regarding domain names. The former issue was solved by using keytool to create a trusted keystore while the latter was addressed by using correct domain names as pointed out by William Grant.

Actions for the Following Report

While I have managed to export a web service property for Launchpad projects, I haven’t yet figured out a way to group bugs by projects. This will require a clear understanding of the schemas involved as well as some skills with SQL. My next task therefore will be to export only the bugs that are related to a particular project.

Tags: , , , , , , , ,

May 22, 2010

Summer of Code Progress: Debugging Launchpad’s RESTful API

Filed under: Blog — krkhan @ 8:03 pm

Related Links

Summer of Code Archive Inspirated Code
Original Proposal Ubuntu Wiki

Report

RESTful web services are very fun once they get properly integrated in end-user applications. Testing those services is a whole different thing and I wanted to dive deep into the bare essentials of REST communication performed by Launchpad for its API. The most straightforward way was to write a Python script using urllib2 and/or httplib for the HTTP request/response mantra. Obviously I found it to be a cumbersome solution and then found this little beauty:

RESTClient Screenshot
(Click on the thumbnail for larger version.)

RESTClient does one thing and does it sweetly: it gives you a nice GUI for toying with REST requests. Getting it to work with Launchpad was not as straightforward though as all requests have to be signed to be of any real value. I also had to spent a few hours trying to understand why api.edge.launchpad.net was not recognizing my access tokens until by sheer stroke of luck I used api.staging.launchpad.net and it started working perfectly.

1
2
3
4
5
6
7
8
9
10
11
12
<rest-client version="2.3">
<request>
<http-version>1.1</http-version>
<URL>https://api.staging.launchpad.net/beta/bugs/1</URL>
<method>GET</method>
<headers>
<header key="Authorization" value="OAuth realm="OAuth", oauth_nonce="77848601", oauth_timestamp="1274537900", oauth_consumer_key="just%20testing", oauth_signature_method="PLAINTEXT", oauth_version="1.0", oauth_token="6dwHFn3CPzxjNrrdp3r9", oauth_signature="%26xxxxxx""/>
<header key="Accept" value="application/json"/>
<header key="Host" value="api.staging.launchpad.net"/>
</headers>
</request>
</rest-client>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<rest-client version="2.3">
<response>
<execution-time>897</execution-time>
<status code="200">HTTP/1.1 200 Ok</status>
<headers>
<header key="Date" value="Sat, 22 May 2010 14:26:32 GMT"/>
<header key="Server" value="zope.server.http (HTTP)"/>
<header key="X-Powered-By" value="Zope (www.zope.org), Python (www.python.org)"/>
<header key="Content-Type" value="application/json"/>
<header key="Content-Length" value="2888"/>
<header key="Etag" value=""d9b357c932ada0a71e96401a8c87368d4704a500-dec69b947b887c4addba8eb4aae5ca64c94f616c""/>
<header key="Vary" value="Accept,Accept-Encoding"/>
<header key="Via" value="1.1 wildcard.staging.launchpad.net"/>
<header key="Keep-Alive" value="timeout=15, max=100"/>
<header key="Connection" value="Keep-Alive"/>
</headers>
<body>
{
   users_unaffected_collection_link          : 'https://api.staging.launchpad.net/beta/bugs/1/users_unaffected',
   latest_patch_uploaded                     : null,
   users_affected_count_with_dupes           : 378,
   security_related                          : false,
   private                                   : false,
   bug_watches_collection_link               : 'https://api.staging.launchpad.net/beta/bugs/1/bug_watches',
   date_made_private                         : null,
   linked_branches_collection_link           : 'https://api.staging.launchpad.net/beta/bugs/1/linked_branches',
   subscriptions_collection_link             : 'https://api.staging.launchpad.net/beta/bugs/1/subscriptions',
   number_of_duplicates                      : 0,
   id                                        : 1,
   users_unaffected_count                    : 6,
   title                                     : 'Microsoft has a majority market share',
   name                                      : 'liberation',
   http_etag                                 : '"d9b357c932ada0a71e96401a8c87368d4704a500-dec69b947b887c4addba8eb4aae5ca64c94f616c"',
   messages_collection_link                  : 'https://api.staging.launchpad.net/beta/bugs/1/messages',
   self_link                                 : 'https://api.staging.launchpad.net/beta/bugs/1',
   who_made_private_link                     : null,
   attachments_collection_link               : 'https://api.staging.launchpad.net/beta/bugs/1/attachments',
   resource_type_link                        : 'https://api.staging.launchpad.net/beta/#bug',
   date_last_updated                         : '2010-05-13T23:24:26.362094+00:00',
   description                               : 'Microsoft has a majority market share in the new desktop PC marketplace.\nThis is a bug, which Ubuntu is designed to fix.\n\nNon-free software is holding back innovation in the IT industry, restricting access to IT to a small part of the world\'s population and limiting the ability of software developers to reach their full potential, globally. This bug is widely evident in the PC industry.\n\nSteps to repeat:\n\n1. Visit a local PC store.\n\nWhat happens:\n2. Observe that a majority of PCs for sale have non-free software pre-installed.\n3. Observe very few PCs with Ubuntu and free software pre-installed.\n\nWhat should happen:\n1. A majority of the PCs for sale should include only free software like Ubuntu.\n2. Ubuntu should be marketed in a way such that its amazing features and benefits would be apparent and known by all.\n3. The system shall become more and more user friendly as time passes.\n\n',
   duplicates_collection_link                : 'https://api.staging.launchpad.net/beta/bugs/1/duplicates',
   tags                                      : [
      'iso-testing',
      'ubuntu'
   ],
   message_count                             : 1198,
   heat                                      : 2138,
   bug_tasks_collection_link                 : 'https://api.staging.launchpad.net/beta/bugs/1/bug_tasks',
   cves_collection_link                      : 'https://api.staging.launchpad.net/beta/bugs/1/cves',
   users_affected_with_dupes_collection_link : 'https://api.staging.launchpad.net/beta/bugs/1/users_affected_with_dupes',
   duplicate_of_link                         : null,
   users_affected_count                      : 378,
   owner_link                                : 'https://api.staging.launchpad.net/beta/~sabdfl',
   date_created                              : '2004-08-20T00:00:00+00:00',
   can_expire                                : false,
   date_last_message                         : '2010-05-13T23:24:21.253673+00:00',
   users_affected_collection_link            : 'https://api.staging.launchpad.net/beta/bugs/1/users_affected'
}
</body>
</response>
</rest-client>

With a local Launchpad ready to do my bidding and a debugging process in place for elaborating its API, I’m looking forward to the coding phase. Which, coincidentally, begins on the same day I give my final exam for the current semester.

Rest REST: the sweet sauce of labor.” — Plutarch

Tags: , , , , , , , , ,

May 14, 2010

Summer of Code Progress: Ready to Launch(pad)

Filed under: Blog — krkhan @ 11:51 pm

As the initial stage of my GSoC project is heavily involved with the Launchpad core, the first step for being ready was to get it running in a clean lean virtual machine. Bad rhyming I know. But trust me, trying to setup Launchpad locally with a borked internet connection is worse.

So, after some ∞ attempts at using rocketfuel-setup, I got stuck because my internet gave up on each run before Bazaar repositories could download. To top it off, once the repositories did download the VM decided to become unresponsive as it had only 384 MB of RAM and unpacking a huge repository like Launchpad’s core required a lot more resources than that.

Love for open-source followed as I downloaded the repositories on a separate machine, transferred them to the VM using NFS and then was able to modify the rocketfuel-setup so that it would do only the remaining work. The result:

Virtual Launchpad Snapshot #1
(Click on the thumbnail for larger version.)

The added bonus of doing the whole process on VM was the ability to go back to a clean state in case something went haywire. A few months ago, I had moved over to Sun’s VirtualBox from Redhat’s Virtual Machine Manager and this proved to be helpful on many accounts. Apart from being sleeker and more friendlier, VirtualBox offers advanced features such as PulseAudio integration on host and hierarchical snapshots. Using the shots, now I can just select a state where Launchpad was launched clean … :

Virtual Launchpad Snapshot #2
(Click on the thumbnail for larger version.)

… click on restore and viola, I’ll have the same instance up and running again within a few seconds.

Tags: , , , , , ,

May 11, 2010

Summer of Code Progress: Ubuntu Community Bonding

Filed under: Blog — krkhan @ 8:53 pm

Over the past few days, I have been preparing myself for GSoC work in various ways. Officially, these few weeks are defined as “Community Bonding Period” for Summer of Code participants. Meaning, selected students are expected to spend time for getting everything set for the real development which starts on May 26th.

The first thing on my priority list was to find a way for fail-safe IRC communication. The end solution was documented in my previous post. In a nutshell, now I have this IRC client running all the time to which I can connect occasionally and go-through the activity since my last visit.

Next up was discussing with Bryce the list of things that should be ready before the next stage. Setting up Launchpad locally was pinpointed as the real PITA for beginning the development. He advised me on a few other aspects as well, including why I should aim to complete the major coding portions of my work before the mid-term evaluation. Bryce has been the X.org maintainer for Ubuntu so he’s also new to Launchpad development like me. However, unlike me he has been able to set up a Launchpad instance on Lucid Lynx. I have been trying a bit unsuccessfully to do the same with Karmic Koala for a few days now. The rocketfuel-setup quits on me after complaining about download-cache directory not being available in the devel tree. I’m hoping to look more into that tonight.

As for the miscellaneous things, Google gifted all the participants an year of ACM Student Membership. Without sarcasm, ACM has one of the most confusing user-management system I have ever used. I already had a web-account on ACM and hence my username was not available for using this membership. Doesn’t make sense? Exactly. With that said, on the brighter side of things was the fact that ACM’s help-desk was prompt and solved my registration problems within a few emails of correspondence. The ACM email address still isn’t forwarding emails properly but I guess that’ll take a few days to resolve.

On the community side of things, I thought it would be convenient to have important information about my organization’s projects in one place. On that account, here’s a list of my fellow Ubuntu participants for this year’s Summer of Code:

Student Project Mentor
Sarah Strong The Great Clipboard Fixing Galore Project Ted Gould
Michal Karnicki Android U1: Ubuntu One client for Android Stuart Langridge
Jacob Peddicord services-admin configuration and Upstart-ification David Bensimon
Dylan McCall Harvest user interface improvements Daniel Holbach
Urban Skudnik Home user backup solution/Deja Dup improvements Michael Terry
Dmitrijs Ledkovs USB-creator Improvements Evan Dandrea
Kamran Khan Bug Triaging Improvements for Launchpad/Arsenal Bryce Harrington
Harald Sitter Ubuntu One for the KDE workspace Jonathan Riddell
Peter Gardenier Software Center Improvements Matthew Thomas
Andres Rodriguez Lazo Testdrive Front End Dustin Kirkland

Good luck to everyone on board!

Tags: , , , , , , ,

April 27, 2010

Finally there — Google Summer of Code 2010

Filed under: Blog — krkhan @ 1:02 am

GSoC 2010 Logo

Fate has a curious sense of humor. After having 8 of my proposals rejected in past 3 years for Google Summer of Code, I had 2 of them selected in the same year. In GSoC terminology, I became a “duplicate” student. Now, the standard practice for such cases is that the administrators of both organizations interested in the student get together in a “deduplication” meeting and resolve the conflict. However, Maria Randazzo (the program administrator from the Ubuntu organization) was kind enough to ask my preference regarding the project I’d like to work upon.

This put me in a rather uneasy position as mentors from both organizations (Bryce Harrington from Ubuntu & Alexey Khoroshilov from The Linux Foundation) had been really helpful during the application process. In the end however, I chose Ubuntu since its proposal focused on Arsenal and Python which I found relatively more familiar than Alien and Perl. I had also already collaborated with Bryce for some Arsenal patches before so it was easier for me to get up-to-speed with the Ubuntu proposal.

The proposal itself is in fact publicly viewable at this link. Summarizing my feelings, I’ve never looked forward to a summer as much as this one.

“If a June night could talk, it would probably boast it invented romance code.” —Bern Williams

Tags: , , , , , , , , ,

February 26, 2010

Facebook Friends Graph v0.2 — Deb and RPM packages for Ubuntu and Fedora

Filed under: Blog — krkhan @ 2:36 am

Thanks to Christoph Korn, Ubuntu users can now install the package with a single click from the GetDeb repository. The Deb file itself is available on the release page here, along with an RPM for Fedora users.

The looks:

Facebook Friends Graph v0.2 Screenshot

And the hooks:

Changelog:

  • Fixed:
    • Bug #522735: Facebook: Application Request Limit Reached
    • Bug #523378: Connection reset by peer
    • Bug #522487: Facebook Friends Graph fails when friends have a dash in their name [patch by Little Jawa]
Tags: , , , , , , , , , , , , , , ,

February 21, 2010

Bookmark Undertaker v0.3 — Picking up the threads

Filed under: Blog — krkhan @ 8:09 pm

Threads are love. Threads are speed. And more often than not, threads are a consistent PITA. However, I’ve had an accidental epiphany just a few hours ago:

When in doubt When you need to communicate among threads, use synchronized Queues.”

There. This magic mantra will solve more issues in your life than you can ever imagine, and certainly more than I expected.

Getting back to the topic at hand, adding threading support to the program has sped up the bookmark checking process by a factor of about 435895234. Coupled with fixing of some parsing bugs, Bookmark Undertaker v0.3 is finally capable of providing a quick, stable and consistent way of sanitizing your Firefox favorites:

Boomark Undertaker v0.3 Screenshot

This time, I’ve also tried to provide Deb and RPM packages on the release page for easy installation by the Debian/Ubuntu/Fedora populace.

Ushering in the era of communist applications:

“If everyone gives one thread, the poor person will have a shirt.” — Russian Proverb

Tags: , , , , , , , , , , , , , , , ,

February 19, 2010

Facebook Friends Graph on Ubuntu

Filed under: Blog — krkhan @ 12:04 am

I never really thought anyone other than me would be interested in seeing gargantuan graphs of their friends’ connections until I found out through this post on the OMG! Ubuntu! blog that my application was included in the GetDeb repository for Ubuntu users. I have not used Ubuntu myself since about never, but apparently you can now install the application on Karmic Koala with just a few clicks.

Edit: I have now tested the installation on Karmic myself and can guarantee that it indeed works without any fuss. Gotta love Launchpad/Ubuntu.

The application itself was in a pretty much skeletal state of being so I was a little taken aback by the exposure. Nevertheless, I was reminded of the famous aphorism apropos of open source development:

“Release early, release often.” — Linus Torvalds

And indeed, the bug reports that came from users were a valuable byproduct of the Ubuntu push as I had stopped development on the script after it started working fine for me.

Tags: , , , , , , , , , , , , , , ,

October 31, 2009

HOWTO: Use PyS60’s Bluetooth Console on Fedora/Ubuntu/Debian Linux

Filed under: Blog — krkhan @ 11:03 pm

While developing PyS60 apps is one of the most fun things you could do with your Nokia phone, debugging them isn’t as zippy as one would hope for in a Py development environment. To make up for that, PyS60 gives the developers an option for directly connecting to the interpreter through Bluetooth. Doesn’t sound very appealing? How about this: You connect your laptop with the cellphone, jump in at some place in the code while your app is executing and then use lappy’s big keyboard for exploiting different code and values in the interpreter. Sounds better?

To accomplish this on a Linux distro, you will need the following packages installed on your system:

Name Links
gnome-bluetooth
uucp/cu

After making sure that both are present on your system, install PyS60 on your phone if you haven’t already done so.

Now the fun part:

  1. Switch on Bluetooth in the cellphone.

    PyS60 Bluetooth HOWTO, Mobile screenshot #1

  2. Launch bluetooth-properties and click on “Setup New Device”.

    PyS60 Bluetooth HOWTO, PC screenshot #1

  3. Select your cellphone.

    PyS60 Bluetooth HOWTO, PC screenshot #2

  4. You will be shown a pin.

    PyS60 Bluetooth HOWTO, PC screenshot #3

  5. Enter the pin when queried on the cellphone.

    PyS60 Bluetooth HOWTO, Mobile screenshot #2

  6. The phone should be successfully paired.

    PyS60 Bluetooth HOWTO, PC screenshot #4

  7. Authorize your Linux system to make automatic connections to the phone.

    PyS60 Bluetooth HOWTO, Mobile screenshot #3

  8. As root, run this shell script:
    [root@orthanc ~]# ./rfcomm-listen.sh

    Serial Port service registered
    Waiting for connection on channel 2

  9. Launch PyS60 interpreter and select “Bluetooth Console” from the application menu.

    PyS60 Bluetooth HOWTO, Mobile screenshot #4

  10. Select your Linux machine.

    PyS60 Bluetooth HOWTO, Mobile screenshot #5

    The command you ran in previous step should have new output:

    [root@orthanc ~]# ./rfcomm-listen.sh

    Serial Port service registered
    Waiting for connection on channel 2
    Connection from 00:17:4B:B6:35:31 to /dev/rfcomm0
    Press CTRL-C for hangup

    The cellphone screen should be showing something like this:

    PyS60 Bluetooth HOWTO, Mobile screenshot #6

  11. As root again, open a new terminal and run:
    [root@orthanc ~]# cu -l /dev/rfcomm0

    Connected.

  12. Hit Enter till prompt (>>>) appears, then type:

    >>> import appuifw
    >>> appuifw.query(u'Hello World', 'text')

  13. Viola, you should have an input box on the mobile screen:

    PyS60 Bluetooth HOWTO, Mobile screenshot #7

  14. Enter any text and press the OK key. It should be show up in the terminal you were using to type in code:

    >>> import appuifw
    >>> appuifw.query(u'Hello World', 'text')
    u’Finally’

  15. Exit the interpreter by typing CTRL+D on an empty line:

    >>> import appuifw
    >>> appuifw.query(u'Hello World', 'text')
    u’Finally’
    >>>
    Interactive interpreter finished.
    cu: Got hangup signal

    Disconnected.

Pat yourself on the back. Now, you can use your Bluetooth console to import your modules, execute some stuff and then jump in the middle to test some extra lines or values. In fact, I found it to be a pretty darned good way of learning about PyS60’s API. Res secundae!

Tags: , , , , , , , , , , , , , , , ,
« Previous PageNext Page »