Merge pull request #252 from aplanas/master
Some fix after json changes
This commit is contained in:
commit
eafe1b51f8
@ -70,13 +70,15 @@ class OpenQAReport(object):
|
||||
|
||||
def get_broken_package_status(self, info):
|
||||
status = info['broken_packages']
|
||||
for subproject in info['subprojects']:
|
||||
subproject = info['subproject']
|
||||
if subproject:
|
||||
status.extend(subproject['broken_packages'])
|
||||
return status
|
||||
|
||||
def get_openQA_status(self, info):
|
||||
status = info['openqa_jobs']
|
||||
for subproject in info['subprojects']:
|
||||
subproject = info['subproject']
|
||||
if subproject:
|
||||
status.extend(subproject['openqa_jobs'])
|
||||
return status
|
||||
|
||||
@ -166,6 +168,10 @@ class OpenQAReport(object):
|
||||
report = '\n\n'.join((report_broken_packages, report_openQA))
|
||||
report = report.strip()
|
||||
if report:
|
||||
if osc.conf.config['debug']:
|
||||
print project
|
||||
print '-' * len(project)
|
||||
print report
|
||||
self.update_status_comment(project, report)
|
||||
|
||||
|
||||
|
@ -32,10 +32,12 @@ class AcceptCommand(object):
|
||||
return rqs
|
||||
|
||||
def perform(self, project):
|
||||
"""
|
||||
Accept the staging LETTER for review and submit to factory
|
||||
"""Accept the staging LETTER for review and submit to Factory /
|
||||
openSUSE 13.2 ...
|
||||
|
||||
Then disable the build to disabled
|
||||
:param project: staging project we are working with
|
||||
|
||||
"""
|
||||
|
||||
status = self.api.check_project_status(project)
|
||||
@ -55,12 +57,13 @@ class AcceptCommand(object):
|
||||
print(msg)
|
||||
|
||||
for req in requests:
|
||||
change_request_state(self.api.apiurl, str(req), 'accepted', message='Accept to factory')
|
||||
change_request_state(self.api.apiurl, str(req), 'accepted', message='Accept to %s' % self.api.opensuse)
|
||||
|
||||
# A single comment should be enough to notify everybody, since they are
|
||||
# already mentioned in the comments created by select/unselect
|
||||
# A single comment should be enough to notify everybody, since
|
||||
# they are already mentioned in the comments created by
|
||||
# select/unselect
|
||||
pkg_list = ", ".join(packages)
|
||||
cmmt = 'Project "{}" accepted. The following packages have been submitted to factory: {}.'.format(project, pkg_list)
|
||||
cmmt = 'Project "{}" accepted. The following packages have been submitted to {}: {}.'.format(project, self.api.opensuse, pkg_list)
|
||||
self.comment.add_comment(project_name=project, comment=cmmt)
|
||||
|
||||
# XXX CAUTION - AFAIK the 'accept' command is expected to clean the messages here.
|
||||
@ -76,7 +79,7 @@ class AcceptCommand(object):
|
||||
changed = False
|
||||
for req in self.find_new_requests('openSUSE:{}'.format(self.api.opensuse)):
|
||||
print 'Accepting request %d: %s' % (req['id'], ','.join(req['packages']))
|
||||
change_request_state(self.api.apiurl, str(req['id']), 'accepted', message='Accept to factory')
|
||||
change_request_state(self.api.apiurl, str(req['id']), 'accepted', message='Accept to %s' % self.api.opensuse)
|
||||
changed = True
|
||||
|
||||
return changed
|
||||
|
@ -83,7 +83,8 @@ class CheckCommand(object):
|
||||
report.extend(' %s: fail' % module['name'] for module in job['modules'] if module['result'] == 'fail')
|
||||
break
|
||||
|
||||
for subproject in project['subprojects']:
|
||||
subproject = project['subproject']
|
||||
if subproject:
|
||||
subreport = self._report(subproject, verbose, is_subproject=True)
|
||||
if subreport:
|
||||
report.append('')
|
||||
|
@ -38,6 +38,6 @@ class TestAccept(unittest.TestCase):
|
||||
# But the comment was written at some point
|
||||
self.assertEqual(len(self.obs.comment_bodies), 1)
|
||||
comment = self.obs.comment_bodies[0]
|
||||
self.assertTrue('The following packages have been submitted to factory' in comment)
|
||||
self.assertTrue('The following packages have been submitted to Factory' in comment)
|
||||
self.assertTrue('apparmor' in comment)
|
||||
self.assertTrue('mariadb' in comment)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -103,99 +103,97 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"overall_state": "empty",
|
||||
"broken_packages": [],
|
||||
"building_repositories": [
|
||||
{
|
||||
"arch": "x86_64",
|
||||
"code": "blocked",
|
||||
"repository": "standard",
|
||||
"state": "blocked"
|
||||
},
|
||||
{
|
||||
"arch": "x86_64",
|
||||
"code": "blocked",
|
||||
"repository": "images",
|
||||
"state": "blocked"
|
||||
}
|
||||
],
|
||||
"description": "",
|
||||
"missing_reviews": [],
|
||||
"name": "openSUSE:Factory:Staging:H:DVD",
|
||||
"obsolete_requests": [],
|
||||
"openqa_jobs": [
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10665,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging2-DVD-x86_64-Build110.12-gnome",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10664,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging2-DVD-x86_64-Build110.12-miniuefi",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10662,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging2-DVD-x86_64-Build110.12-kde",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"broken_packages": [],
|
||||
"building_repositories": [
|
||||
{
|
||||
"arch": "x86_64",
|
||||
"code": "blocked",
|
||||
"repository": "standard",
|
||||
"state": "blocked"
|
||||
},
|
||||
{
|
||||
"arch": "x86_64",
|
||||
"code": "blocked",
|
||||
"repository": "images",
|
||||
"state": "blocked"
|
||||
}
|
||||
],
|
||||
"description": "",
|
||||
"missing_reviews": [],
|
||||
"name": "openSUSE:Factory:Staging:H:DVD",
|
||||
"obsolete_requests": [],
|
||||
"openqa_jobs": [
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10665,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging2-DVD-x86_64-Build110.12-gnome",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10664,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging2-DVD-x86_64-Build110.12-miniuefi",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10662,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging2-DVD-x86_64-Build110.12-kde",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
},
|
||||
"untracked_requests": []
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user