summaryrefslogtreecommitdiff
path: root/zuul
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-07-09 10:58:52 -0700
committerJames E. Blair <jim@acmegating.com>2022-07-21 18:16:42 -0700
commitfeb032d9b50fee81420e7ab0340daad360386c01 (patch)
treea595193e25311c2e5e52a76a940649b712c20f46 /zuul
parentcce45ec1dd4b526c75e3d0d5e65b647a1deafcbb (diff)
downloadzuul-feb032d9b50fee81420e7ab0340daad360386c01.tar.gz
Hide skipped jobs in status/reports
For heavy users of "dispatch jobs" (where many jobs are declared as dependencies of a single job which then mutates the child_jobs return value to indicate which few of those should be run), there may be large numbers of "SKIPPED" jobs in the status page and in the final job report, which reduces the usability of both of those. Yet it is important for users to be able to see skipped jobs since they may represent an error (they may be inadvertently skipped). To address this, we remove "SKIPPED" jobs from the status page by default, but add a button at the bottom of the change box which can toggle their display. We remove "SKIPPED" jobs from the report, but add a note at the bottom which says "Skipped X jobs". Users can follow the buildset link to see which ones were skipped. The buildset page will continue to show all the jobs for the buildset. Change-Id: Ie297168cdf5b39d1d6f219e9b2efc44c01e87f35
Diffstat (limited to 'zuul')
-rw-r--r--zuul/driver/github/githubreporter.py5
-rw-r--r--zuul/driver/pagure/pagurereporter.py5
-rw-r--r--zuul/reporter/__init__.py11
3 files changed, 17 insertions, 4 deletions
diff --git a/zuul/driver/github/githubreporter.py b/zuul/driver/github/githubreporter.py
index de62f2565..73d3a6f13 100644
--- a/zuul/driver/github/githubreporter.py
+++ b/zuul/driver/github/githubreporter.py
@@ -135,9 +135,12 @@ class GithubReporter(BaseReporter):
def _formatItemReportJobs(self, item):
# Return the list of jobs portion of the report
ret = ''
- jobs_fields = self._getItemReportJobsFields(item)
+ jobs_fields, skipped = self._getItemReportJobsFields(item)
for job_fields in jobs_fields:
ret += self._formatJobResult(job_fields)
+ if skipped:
+ jobtext = 'job' if skipped == 1 else 'jobs'
+ ret += 'Skipped %i %s\n' % (skipped, jobtext)
return ret
def addPullComment(self, item, comment=None):
diff --git a/zuul/driver/pagure/pagurereporter.py b/zuul/driver/pagure/pagurereporter.py
index 0bfdbc9b8..b38035752 100644
--- a/zuul/driver/pagure/pagurereporter.py
+++ b/zuul/driver/pagure/pagurereporter.py
@@ -67,9 +67,12 @@ class PagureReporter(BaseReporter):
def _formatItemReportJobs(self, item):
# Return the list of jobs portion of the report
ret = ''
- jobs_fields = self._getItemReportJobsFields(item)
+ jobs_fields, skipped = self._getItemReportJobsFields(item)
for job_fields in jobs_fields:
ret += '- [%s](%s) : %s%s%s%s\n' % job_fields[:6]
+ if skipped:
+ jobtext = 'job' if skipped == 1 else 'jobs'
+ ret += 'Skipped %i %s\n' % (skipped, jobtext)
return ret
def addPullComment(self, item, comment=None):
diff --git a/zuul/reporter/__init__.py b/zuul/reporter/__init__.py
index 9b8f2c11c..5723316a3 100644
--- a/zuul/reporter/__init__.py
+++ b/zuul/reporter/__init__.py
@@ -257,9 +257,13 @@ class BaseReporter(object, metaclass=abc.ABCMeta):
# Extract the report elements from an item
config = self.connection.sched.config
jobs_fields = []
+ skipped = 0
for job in item.getJobs():
build = item.current_build_set.getBuild(job.name)
(result, url) = item.formatJobResult(job)
+ if result == 'SKIPPED':
+ skipped += 1
+ continue
if not job.voting:
voting = ' (non-voting)'
else:
@@ -300,12 +304,15 @@ class BaseReporter(object, metaclass=abc.ABCMeta):
success_message = job.success_message
jobs_fields.append(
(name, url, result, error, elapsed, voting, success_message))
- return jobs_fields
+ return jobs_fields, skipped
def _formatItemReportJobs(self, item):
# Return the list of jobs portion of the report
ret = ''
- jobs_fields = self._getItemReportJobsFields(item)
+ jobs_fields, skipped = self._getItemReportJobsFields(item)
for job_fields in jobs_fields:
ret += '- %s%s : %s%s%s%s\n' % job_fields[:6]
+ if skipped:
+ jobtext = 'job' if skipped == 1 else 'jobs'
+ ret += 'Skipped %i %s\n' % (skipped, jobtext)
return ret