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)
|
||||
|
@ -80,8 +80,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -158,10 +157,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -241,8 +239,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -319,10 +316,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -406,8 +402,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -484,10 +479,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -567,8 +561,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -645,10 +638,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -728,8 +720,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -806,10 +797,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -1015,8 +1005,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -1093,10 +1082,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -1227,8 +1215,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -1305,10 +1292,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -1434,8 +1420,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -1525,10 +1510,9 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -1607,8 +1591,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"selected_requests": [],
|
||||
"broken_packages": [],
|
||||
@ -1643,10 +1626,9 @@
|
||||
"state": "done"
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
},
|
||||
{
|
||||
@ -1767,7 +1749,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
]
|
||||
|
@ -103,8 +103,7 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [
|
||||
{
|
||||
"subproject": {
|
||||
"overall_state": "empty",
|
||||
"broken_packages": [],
|
||||
"building_repositories": [
|
||||
@ -193,9 +192,8 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"subprojects": [],
|
||||
"subproject": null,
|
||||
"untracked_requests": []
|
||||
}
|
||||
],
|
||||
},
|
||||
"untracked_requests": []
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user