Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error getting gerrit items #34

Closed
ibarkan-redhat opened this issue Sep 21, 2015 · 2 comments
Closed

error getting gerrit items #34

ibarkan-redhat opened this issue Sep 21, 2015 · 2 comments
Assignees
Labels

Comments

@ibarkan-redhat
Copy link

[DEBUG] url = https://gerrit.ovirt.org/changes/I9348a09e331195695c16862ef986df3b4abfa991/detail#/
[DEBUG] changelog = {u'status': u'NEW', u'topic': u'tc-tests', u'updated': u'2015-09-21 09:45:34.676000000', u'insertions': 49, u'messages': [{u'date': u'2015-09-21 08:58:42.371000000', u'_revision_number': 1, u'message': u'Uploaded patch set 1.', u'id': u'499865f5_1706631f', u'author': {u'username': u'ibarkan', u'email': u'ibarkan@redhat.com', u'name': u'Ido Barkan', u'_account_id': 1000618}}, {u'date': u'2015-09-21 08:58:59.549000000', u'_revision_number': 1, u'message': u"Patch Set 1:\n\n* Update tracker::IGNORE, no Bug-Url found\n* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.\n* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])", u'id': u'499865f5_171f4359', u'author': {u'username': u'gerrit-hooks', u'email': u'automation@ovirt.org', u'name': u'gerrit-hooks', u'_account_id': 1000458}}, {u'date': u'2015-09-21 09:40:59.984000000', u'_revision_number': 1, u'message': u'Patch Set 1:\n\nBuild Started -> http://jenkins.ovirt.org/job/vdsm_master_check-patch-fc22-x86_64/687/', u'id': u'499865f5_97519363', u'author': {u'username': u'jenkins', u'name': u'Jenkins CI', u'_account_id': 1000132}}, {u'date': u'2015-09-21 09:45:34.676000000', u'_revision_number': 1, u'message': u'Patch Set 1: Continuous-Integration-1\n\nBuild Failed \n\nhttp://jenkins.ovirt.org/job/vdsm_master_check-patch-fc22-x86_64/687/ : FAILURE', u'id': u'499865f5_77d5e7b4', u'author': {u'username': u'jenkins', u'name': u'Jenkins CI', u'_account_id': 1000132}}], u'created': u'2015-09-21 08:58:42.371000000', u'change_id': u'I9348a09e331195695c16862ef986df3b4abfa991', u'labels': {u'Continuous-Integration': {u'default_value': 0, u'all': [{u'username': u'osvoboda', u'name': u'Ond\u0159ej Svoboda', u'_account_id': 1000529, u'value': 0, u'date': u'2015-09-21 09:07:09.728000000', u'email': u'osvoboda@redhat.com'}, {u'date': u'2015-09-21 09:45:34.676000000', u'username': u'jenkins', u'name': u'Jenkins CI', u'value': -1, u'_account_id': 1000132}, {u'username': u'gerrit-hooks', u'email': u'automation@ovirt.org', u'name': u'gerrit-hooks', u'value': 0, u'_account_id': 1000458}, {u'username': u'phoracek', u'name': u'Petr Hor\xe1\u010dek', u'_account_id': 1000595, u'value': 0, u'date': u'2015-09-21 09:07:07.137000000', u'email': u'phoracek@redhat.com'}], u'values': {u' 0': u'Did not run yet', u'-1': u'Failed CI tests', u'+1': u'Passed CI tests'}, u'rejected': {u'username': u'jenkins', u'name': u'Jenkins CI', u'_account_id': 1000132}}, u'Verified': {u'default_value': 0, u'all': [{u'username': u'osvoboda', u'email': u'osvoboda@redhat.com', u'name': u'Ond\u0159ej Svoboda', u'value': 0, u'_account_id': 1000529}, {u'username': u'jenkins', u'name': u'Jenkins CI', u'value': 0, u'_account_id': 1000132}, {u'username': u'gerrit-hooks', u'name': u'gerrit-hooks', u'_account_id': 1000458, u'value': 0, u'date': u'2015-09-21 08:58:59.549000000', u'email': u'automation@ovirt.org'}, {u'username': u'phoracek', u'email': u'phoracek@redhat.com', u'name': u'Petr Hor\xe1\u010dek', u'value': 0, u'_account_id': 1000595}], u'values': {u' 0': u'No score', u'-1': u'Fails', u'+1': u'Verified'}}, u'Code-Review': {u'default_value': 0, u'all': [{u'username': u'osvoboda', u'email': u'osvoboda@redhat.com', u'name': u'Ond\u0159ej Svoboda', u'value': 0, u'_account_id': 1000529}, {u'username': u'jenkins', u'name': u'Jenkins CI', u'value': 0, u'_account_id': 1000132}, {u'username': u'gerrit-hooks', u'email': u'automation@ovirt.org', u'name': u'gerrit-hooks', u'value': 0, u'_account_id': 1000458}, {u'username': u'phoracek', u'email': u'phoracek@redhat.com', u'name': u'Petr Hor\xe1\u010dek', u'value': 0, u'_account_id': 1000595}], u'values': {u'+2': u'Looks good to me, approved', u' 0': u'No score', u'-1': u"I would prefer that you didn't submit this", u'+1': u'Looks good to me, but someone else must approve', u'-2': u'Do not submit'}}}, u'deletions': 2, u'project': u'vdsm', u'owner': {u'username': u'ibarkan', u'email': u'ibarkan@redhat.com', u'name': u'Ido Barkan', u'_account_id': 1000618}, u'permitted_labels': {}, u'mergeable': False, u'branch': u'master', u'removable_reviewers': [], u'_sortkey': u'0037f3890000b571', u'_number': 46449, u'id': u'vdsmmasterI9348a09e331195695c16862ef986df3b4abfa991', u'subject': u'net: tests: test tc upper limit using iperf'}
[DEBUG] changes.messages = [{u'_revision_number': 1,
u'author': {u'_account_id': 1000618,
u'email': u'ibarkan@redhat.com',
u'name': u'Ido Barkan',
u'username': u'ibarkan'},
u'date': u'2015-09-21 08:58:42.371000000',
u'id': u'499865f5_1706631f',
u'message': u'Uploaded patch set 1.'},
{u'_revision_number': 1,
u'author': {u'_account_id': 1000458,
u'email': u'automation@ovirt.org',
u'name': u'gerrit-hooks',
u'username': u'gerrit-hooks'},
u'date': u'2015-09-21 08:58:59.549000000',
u'id': u'499865f5_171f4359',
u'message': u"Patch Set 1:\n\n* Update tracker::IGNORE, no Bug-Url found\n* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.\n* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])"},
{u'_revision_number': 1,
u'author': {u'_account_id': 1000132,
u'name': u'Jenkins CI',
u'username': u'jenkins'},
u'date': u'2015-09-21 09:40:59.984000000',
u'id': u'499865f5_97519363',
u'message': u'Patch Set 1:\n\nBuild Started -> http://jenkins.ovirt.org/job/vdsm_master_check-patch-fc22-x86_64/687/'},
{u'_revision_number': 1,
u'author': {u'_account_id': 1000132,
u'name': u'Jenkins CI',
u'username': u'jenkins'},
u'date': u'2015-09-21 09:45:34.676000000',
u'id': u'499865f5_77d5e7b4',
u'message': u'Patch Set 1: Continuous-Integration-1\n\nBuild Failed \n\nhttp://jenkins.ovirt.org/job/vdsm_master_check-patch-fc22-x86_64/687/ : FAILURE'}]
Traceback (most recent call last):
File "/home/ibarkan/pycharm-community-4.5.3/helpers/pydev/pydevd.py", line 2358, in
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/ibarkan/pycharm-community-4.5.3/helpers/pydev/pydevd.py", line 1778, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/usr/bin/did", line 36, in
did.cli.main()
File "/usr/lib/python2.7/site-packages/did/cli.py", line 183, in main
user_stats.check()
File "/usr/lib/python2.7/site-packages/did/stats.py", line 135, in check
stat.check()
File "/usr/lib/python2.7/site-packages/did/stats.py", line 135, in check
stat.check()
File "/usr/lib/python2.7/site-packages/did/stats.py", line 80, in check
self.fetch()
File "/usr/lib/python2.7/site-packages/did/plugins/gerrit.py", line 277, in fetch
if 'author' in chg and owner == chg['author']['email'] and
KeyError: 'email'

@ibarkan-redhat
Copy link
Author

I think that an author doesn't always have an email. Jenkins does not :-) :
"messages": [
{
"id": "499865f5_1706631f",
"author": {
"_account_id": 1000618,
"name": "Ido Barkan",
"email": "ibarkan@redhat.com",
"username": "ibarkan"
},
"date": "2015-09-21 08:58:42.371000000",
"message": "Uploaded patch set 1.",
"_revision_number": 1
},
{
"id": "499865f5_171f4359",
"author": {
"_account_id": 1000458,
"name": "gerrit-hooks",
"email": "automation@ovirt.org",
"username": "gerrit-hooks"
},
"date": "2015-09-21 08:58:59.549000000",
"message": "Patch Set 1:\n\n* Update tracker::IGNORE, no Bug-Url found\n* Check Bug-Url::WARN, no bug url found, make sure header matches \u0027Bug-Url: \u0027 and is a valid url.\n* Check merged to previous::IGNORE, Not in stable branch ([\u0027ovirt-3.5\u0027, \u0027ovirt-3.4\u0027, \u0027ovirt-3.3\u0027])",
"_revision_number": 1
},
{
"id": "499865f5_97519363",
"author": {
"_account_id": 1000132,
"name": "Jenkins CI",
"username": "jenkins"
},
"date": "2015-09-21 09:40:59.984000000",
"message": "Patch Set 1:\n\nBuild Started -\u003e http://jenkins.ovirt.org/job/vdsm_master_check-patch-fc22-x86_64/687/",
"_revision_number": 1
},
{
"id": "499865f5_77d5e7b4",
"author": {
"_account_id": 1000132,
"name": "Jenkins CI",
"username": "jenkins"
},
"date": "2015-09-21 09:45:34.676000000",
"message": "Patch Set 1: Continuous-Integration-1\n\nBuild Failed \n\nhttp://jenkins.ovirt.org/job/vdsm_master_check-patch-fc22-x86_64/687/ : FAILURE",
"_revision_number": 1
}
]

@ibarkan-redhat
Copy link
Author

you should be more defensive in gerrit:
did/plugins/gerrit.py line 319 and 277
chg.get('author', {}).get('email', ''):

@psss psss closed this as completed in 95bc636 Sep 22, 2015
@psss psss self-assigned this Sep 22, 2015
@psss psss added the bug label Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants