diff options
author | Zuul <zuul@review.opendev.org> | 2022-10-25 04:10:18 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-10-25 04:10:18 +0000 |
commit | b70d8de85bcfd551fa55b2a865ad86c494790de0 (patch) | |
tree | eeaa889c15d70ccc2b86d5bb02589230bcffc7c9 /web | |
parent | 9d7fbc42343655af86b95008f919c3be5ed8cd96 (diff) | |
parent | 0738d31b08605c406da90009cb3e4792f2bdf029 (diff) | |
download | zuul-b70d8de85bcfd551fa55b2a865ad86c494790de0.tar.gz |
Merge "Include skipped builds in database and web ui"
Diffstat (limited to 'web')
-rw-r--r-- | web/src/containers/FilterToolbar.jsx | 7 | ||||
-rw-r--r-- | web/src/containers/build/BuildList.jsx | 32 |
2 files changed, 37 insertions, 2 deletions
diff --git a/web/src/containers/FilterToolbar.jsx b/web/src/containers/FilterToolbar.jsx index 9568997cc..4cc1e3f25 100644 --- a/web/src/containers/FilterToolbar.jsx +++ b/web/src/containers/FilterToolbar.jsx @@ -319,14 +319,21 @@ function writeFiltersToUrl(filters, location, history) { function buildQueryString(filters) { let queryString = '&complete=true' + let resultFilter = false if (filters) { Object.keys(filters).map((key) => { filters[key].forEach((value) => { + if (value === 'result') { + resultFilter = true + } queryString += '&' + key + '=' + value }) return queryString }) } + if (!resultFilter) { + queryString += '&exclude_result=SKIPPED' + } return queryString } diff --git a/web/src/containers/build/BuildList.jsx b/web/src/containers/build/BuildList.jsx index 69f1795bf..ccb734679 100644 --- a/web/src/containers/build/BuildList.jsx +++ b/web/src/containers/build/BuildList.jsx @@ -57,15 +57,24 @@ class BuildList extends React.Component { return self.indexOf(build) === idx }) + let skippedJobs = builds.filter((build) => { + return build.result === 'SKIPPED' + }).map((build) => (build.job_name) + ).filter((build, idx, self) => { + return self.indexOf(build) === idx + }) + this.state = { visibleNonFinalBuilds: retriedJobs, retriedJobs: retriedJobs, + skippedJobs: skippedJobs, + showSkipped: false, } } sortedBuilds = () => { const { builds } = this.props - const { visibleNonFinalBuilds } = this.state + const { visibleNonFinalBuilds, showSkipped } = this.state return builds.sort((a, b) => { // Group builds by job name, then order by decreasing start time; this will ensure retries are together @@ -85,6 +94,9 @@ class BuildList extends React.Component { } }).filter((build) => { if (build.final || visibleNonFinalBuilds.indexOf(build.job_name) >= 0) { + if (build.result === 'SKIPPED' && !showSkipped) { + return false + } return true } else { @@ -98,6 +110,10 @@ class BuildList extends React.Component { this.setState({ visibleNonFinalBuilds: (isChecked ? retriedJobs : []) }) } + handleSkippedSwitch = isChecked => { + this.setState({ showSkipped: isChecked }) + } + handleToggleVisibleNonFinalBuilds = (jobName) => { const { visibleNonFinalBuilds } = this.state const index = visibleNonFinalBuilds.indexOf(jobName) @@ -138,7 +154,7 @@ class BuildList extends React.Component { render() { const { tenant } = this.props - const { visibleNonFinalBuilds, retriedJobs } = this.state + const { visibleNonFinalBuilds, retriedJobs, skippedJobs, showSkipped } = this.state let retrySwitch = retriedJobs.length > 0 ? <FlexItem align={{ default: 'alignRight' }}> @@ -151,10 +167,22 @@ class BuildList extends React.Component { </FlexItem> : <></> + let skippedSwitch = skippedJobs.length > 0 ? + <FlexItem align={{ default: 'alignRight' }}> + <span>Show skipped jobs </span> + <Switch + isChecked={showSkipped} + onChange={this.handleSkippedSwitch} + isReversed + /> + </FlexItem> : + <></> + const sortedBuilds = this.sortedBuilds() return ( <Flex direction={{ default: 'column' }}> + {skippedSwitch} {retrySwitch} <FlexItem> <DataList |