pypingou / fedora-active-user

Reports the recent activity of a Fedora contributor
23 stars 13 forks source link

checks for BugZilla activity broken since switch to token authentication #24

Open decathorpe opened 2 years ago

decathorpe commented 2 years ago
$ python3 ./fedora_active_user.py --user olem --email o.lemasle@gmail.com

(...)

Bugzilla activity
   20 bugs assigned, cc or on which o.lemasle@gmail.com commented
ERROR:active-user:<Fault Client: "Application failed during request deserialization: 32000: The method 'User.get' is not supported without using API keys and the the authentication header. See https://bugzilla.redhat.com/docs/en/html/api/core/v1/general.html#authentication for details on using the 'Authorization' header. at /usr/share/perl5/vendor_perl/SOAP/Lite.pm line 2855.\n">
sanjayankur31 commented 1 year ago

Seeing this too. Do we have a workaround that we can use in the meantime?

gotmax23 commented 1 year ago

Do you have something like

[bugzilla.redhat.com]
api_key = XXXXXXXXXXXX

in ~/.config/python-bugzilla/bugzillarc?

gotmax23 commented 1 year ago

With a properly configured bugzillarc, I'm not able to reproduce this:

$ python ./fedora_active_user.py --user olem --email o.lemasle@gmail.com --nofas
Last action on koji:
   Wed, 05 Oct 2022 tag_package_owners entry revoked by bodhi

Last package update on bodhi:
   2022-02-02 18:36:31 on package open-policy-agent-0.31.0-2.fc35
Last actions performed according to fedmsg:
  - io.pagure.prod.pagure.issue.comment.added on 2022-10-04 15:47:44
  - Fedora 35 Update: open-policy-agent-0.31.0-2.fc35 on 2022-02-10 19:23:38
  - olem's open-policy-agent-0.31.0-2.fc35 bodhi update completed push to stable on 2022-02-10 19:19:54
  - FEDORA-2022-7adcde1092 has met stable testing requirements on 2022-02-09 19:36:02
  - bodhi submitted FEDORA-2022-7adcde1092 to stable on 2022-02-09 19:36:02
  - olem's open-policy-agent-0.31.0-2.fc35 bodhi update completed push to testing on 2022-02-02 19:34:10
  - Bodhi's open-policy-agent-0.31.0-2.fc35 bodhi update is ready for testing on 2022-02-02 19:33:58
  - olem edited FEDORA-2022-7adcde1092 on 2022-02-02 12:37:46
  - olem submitted FEDORA-2022-7adcde1092 to testing on 2022-02-02 12:36:39
  - FEDORA-2022-caa8151005 has met stable testing requirements on 2022-02-02 11:09:41

Last email on mailing list:
  On 2021-12-02T19:02:33Z o.lemasle@gmail.com emailed as Olivier Lemasle on https://lists.fedoraproject.org/archives/api/list/devel@lists.fedoraproject.org/
  On 2021-06-20T13:29:55Z o.lemasle@gmail.com emailed as Olivier Lemasle on https://lists.fedoraproject.org/archives/api/list/devel@lists.fedoraproject.org/
  On 2020-11-02T21:45:09Z o.lemasle@gmail.com emailed as Olivier Lemasle on https://lists.fedoraproject.org/archives/api/list/golang@lists.fedoraproject.org/
  On 2019-07-15T14:46:11Z o.lemasle@gmail.com emailed as Olivier Lemasle on https://lists.fedoraproject.org/archives/api/list/devel@lists.fedoraproject.org/
  On 2019-07-11T20:32:06Z o.lemasle@gmail.com emailed as Olivier Lemasle on https://lists.fedoraproject.org/archives/api/list/devel@lists.fedoraproject.org/
  On 2017-03-06T22:22:48Z o.lemasle@gmail.com emailed as Olivier Lemasle on https://lists.fedoraproject.org/archives/api/list/devel@lists.fedoraproject.org/
  On 2017-03-05T23:06:33Z o.lemasle@gmail.com emailed as Olivier Lemasle on https://lists.fedoraproject.org/archives/api/list/devel@lists.fedoraproject.org/

Bugzilla activity
   20 bugs assigned, cc or on which o.lemasle@gmail.com commented
Last comment on the most recent ticket on bugzilla:
   #1965682 2021-05-28 o.lemasle@gmail.com
   #1922803 2021-05-10 o.lemasle@gmail.com
   #1922802 2021-05-12 o.lemasle@gmail.com
   #1922801 2021-05-10 o.lemasle@gmail.com
   #1922798 2021-05-10 o.lemasle@gmail.com
   #1922795 2021-05-12 o.lemasle@gmail.com
sanjayankur31 commented 1 year ago

Ah, no, I didn't realise one needs a bugzillarc file. I don't think that's mentioned in the readme etc---maybe that just needs documenting?

decathorpe commented 1 year ago

bugzillarc

I've never heard of this file. Is this documented anywhere?

gotmax23 commented 1 year ago

It's used by the bugzilla Python module. If you have python3-bugzilla-cli, you can also create the file with bugzilla login --api-key. R.e. documentation, there's man bugzilla [1], bugzilla login -h, and docstrings for the Python API[2].

The failures you're having may be related to fedora-devel -- Action Required: Bugzilla - API Authentication changes, or there may have been some other backend change which made this operation require auth when it didn't before.

[1] https://www.mankier.com/1/bugzilla#Authentication_Cache_and_API_Keys [2] https://github.com/python-bugzilla/python-bugzilla/blob/a7c324041175a4157823bc2332a046cc2a54d105/bugzilla/base.py#L79

EDIT: Mention Python docstrings

gotmax23 commented 1 year ago

In any case, I agree that the auth requirement should be documented in this repo.

decathorpe commented 1 year ago

Yeah, that's probably it. I generated a new API key and saved it with bugzilla login --api-key, thanks for the tip.