add username to http-request header

Bug #233948 reported by Markus Korn
2
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Fix Released
Undecided
Markus Korn

Bug Description

currently the http-request header looks in almost all cases like:
  'bughelper/unknown (Python-urllib2/2.5)'

to have a chance to track the load and traffic on launchpad better it is usefull to add the username to this header. Also remove 'bughelper' by 'python-launchpad-bugs' and fix the version part, so the header should look like:
  'python-launchpad-bugs/0.2.33r93 (Python-urllib2/2.5) (user: thekorn)'
or
  'python-launchpad-bugs/0.2.33r93 (Python-urllib2/2.5) (user: unknown)'
if the user is not identified

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

this patch against .main rev93 changes the header as described.
To identify run:
  $echo <username> > ~/.python-launchpad-bugs-cookie

Brian, does this header have all the information the lp guys need?

Markus

Changed in python-launchpad-bugs:
assignee: nobody → thekorn
status: New → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote :

I think the python-launchpad-bugs-cookie file name could be confusing with a launchpad cookie file, so would prefer that it changed to something else.

Revision history for this message
Markus Korn (thekorn) wrote :

I agree, I will think about it over the weekend again. when we add a better testing framework to py-lp-bugs we will need a configuration file anyway. So maybe we should go for only one file.

Markus

Revision history for this message
Markus Korn (thekorn) wrote :

------------------------------------------------------------
revno: 101
committer: Markus Korn <email address hidden>
branch nick: main
timestamp: Fri 2008-06-20 21:04:26 +0200
message:
  launchpadbugs/http_connection.py: added (optional) username to
  http-request header and fixed function to get version of py-lp-bugs
  (LP: #233948)
------------------------------------------------------------

Changed in python-launchpad-bugs:
status: In Progress → Fix Committed
Revision history for this message
Markus Korn (thekorn) wrote :

details to the implementation added by rev101

the header now looks like:
'python-launchpad-bugs/0.2.33r93 (Python-urllib2/2.5) (user: unknown)'

if a user runs something similar to:
$echo MyUserName > ~/.python-launchpad-bugs.conf

the header is changed to:
'python-launchpad-bugs/0.2.33r93 (Python-urllib2/2.5) (user: MyUserName)'

Markus

Revision history for this message
Brian Murray (brian-murray) wrote :

Log files from the servers show this as working now:

w.x.y.z - - [20/Jun/2008:21:42:52 +0100] "GET /+ HTTP/1.1" 404 5000 "-" "python-launchpad-bugs/0.2.33r211 (Python-urllib2/2.5) (user: bdmurray - bugmaster)"
w.x.y.z - - [20/Jun/2008:21:42:53 +0100] "GET /ubuntu/+source/bughelper/+bugs-text HTTP/1.1" 200 27 "-" "python-launchpad-bugs/0.2.33r211 (Python-urllib2/2.5) (user: bdmurray - bugmaster)"

Revision history for this message
Markus Korn (thekorn) wrote :

just a side-note: there will only be one configfile (~/.python-launchpad-bugs.conf) when a fix for bug 245552 will be implemented.

Revision history for this message
Markus Korn (thekorn) wrote :

Fix released in py-lp-bugs 0.3

Changed in python-launchpad-bugs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.