Bug 190744

Summary: devel/pybugz: Issues with FreeBSD Bugzilla
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Chris Rees <crees>
Status: Closed FIXED    
Severity: Affects Only Me CC: crees, tremere
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: koobs: maintainer-feedback? (crees)
Hardware: Any   
OS: Any   
Bug Depends on: 192346    
Bug Blocks:    
Attachments:
Description Flags
Proper pkg-plist fix none

Description Jan Beich freebsd_committer freebsd_triage 2014-06-07 10:35:57 UTC
|bugz --skip-auth get| works, everything else doesn't.

$ bugz --base https://bugs.freebsd.org/bugzilla/ get 166381
 * Using https://bugs.freebsd.org/bugzilla/
 * Getting bug 166381 ..
 * No username given.
Username: foo@bar
 * No password given.
Password:
 ! Error: Failed to login

$ bugz --skip-auth --base https://bugs.freebsd.org/bugzilla/ search bsd.port.mk
 * Using https://bugs.freebsd.org/bugzilla/
 * Searching for 'bsd.port.mk'
 * Unknown field: product
 * Unknown field: component
 * Unknown field: changeddate
 * No bugs found.

$ bugz --skip-auth --base https://bugs.freebsd.org/bugzilla/ attachment 123116 [details]
 * Using https://bugs.freebsd.org/bugzilla/
 * Getting attachment 123116 [details]
 ! Error: Unable to get attachment

I haven't tried |attach| and |post| commands because they require working authentication.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2014-06-07 12:46:58 UTC
After a bit of debugging it seems:

- |attachment| requires server to provide |Content-legth| in HTTP header
- |search| doesn't like non-default names in |bug_status|

Auth seems harder until I figure out how to manually populate ~/.bugz_cookie e.g.,

  #LWP-Cookies-2.0
  Set-Cookie3: Bugzilla_login=1234; path="/bugzilla/"; domain=".bugs.freebsd.org"; path_spec; discard; HttpOnly=None; version=0
  Set-Cookie3: Bugzilla_logincookie=ABCDEF; path="/bugzilla/"; domain=".bugs.freebsd.org"; path_spec; discard; HttpOnly=None; version=0
Comment 2 Ralf van der Enden 2014-08-22 09:48:10 UTC
Created attachment 146148 [details]
Proper pkg-plist fix

This adds entries for the missing experimental backends in pkg-plist and fixes mentioned issues.
Comment 3 Ralf van der Enden 2014-08-22 09:49:59 UTC
Crap. I was looking into py-bugz for adding a patch to my port, but I cannot login. While adding the patch and comment I missed I was in the wrong bug. Sorry.

My patch and comment should be removed.

Sincerest apologies for messing this one up.
Comment 4 Marcus von Appen freebsd_committer freebsd_triage 2014-10-15 06:40:11 UTC
Over to maintainer of devel/pybugz. Please add or reassign to bugmeister@, if there is anything to be done for the bugzilla instance.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2015-01-07 09:06:38 UTC
No longer an issue since xmlrpc support was added in pybugz-0.10.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2015-01-07 09:18:31 UTC
|get|, |attachment| and |modify| work fine. Not sure about |search|.

$ bugz search bsd.port.mk
 * Using https://bugs.freebsd.org/bugzilla/xmlrpc.cgi
 * Searching for 'bsd.port.mk'
 * No bugs found.

$ bugz modify -s Closed -r FIXED --add-dependson 192346 \
  -c 'No longer an issue since xmlrpc support was added in pybugz-0.10.' \
  190744
 * Using https://bugs.freebsd.org/bugzilla/xmlrpc.cgi
 * Modified the following fields in bug 190744
 * status      : removed New
 * status      : added Closed
 * depends_on  : removed
 * depends_on  : added 192346
 * resolution  : removed
 * resolution  : added FIXED

with comment 1 login details:

$ sqlite3 .mozilla/firefox/*.default/cookies.sqlite \
  'select name,value from moz_cookies where baseDomain="freebsd.org"' |
  fgrep Bugzilla_
Bugzilla_logincookie|ABCDEF
Bugzilla_login|1234

$ cat ~/.bugzrc
[default]
base: https://bugs.freebsd.org/bugzilla/xmlrpc.cgi

$ cat ~/cat .bugz_token
1234-ABCDEF