diff --git a/web/src/containers/build/Console.jsx b/web/src/containers/build/Console.jsx index e5067bd1eb..9843aeb17a 100644 --- a/web/src/containers/build/Console.jsx +++ b/web/src/containers/build/Console.jsx @@ -60,6 +60,20 @@ function hasInterestingKeys (obj, keys) { return ret } +function makeTaskPath (path) { + return path.join('/') +} + +function taskPathMatches (ref, test) { + if (test.length < ref.length) + return false + for (let i=0; i < ref.length; i++) { + if (ref[i] !== test[i]) + return false + } + return true +} + class TaskOutput extends React.Component { static propTypes = { data: PropTypes.object, @@ -180,6 +194,8 @@ class HostTask extends React.Component { task: PropTypes.object, host: PropTypes.object, errorIds: PropTypes.object, + taskPath: PropTypes.array, + displayPath: PropTypes.array, } state = { @@ -201,13 +217,16 @@ class HostTask extends React.Component { constructor (props) { super(props) - const { host } = this.props + const { host, taskPath, displayPath } = this.props hostTaskStats(this.state, host) + + if (taskPathMatches(taskPath, displayPath)) + this.state.showModal = true } render () { - const { hostname, task, host, errorIds } = this.props + const { hostname, task, host, taskPath, errorIds } = this.props const ai = [] if (this.state.skipped) { @@ -244,6 +263,7 @@ class HostTask extends React.Component { ) const expand = errorIds.has(task.task.id) + let name = task.task.name if (!name) { name = host.action @@ -286,7 +306,13 @@ class HostTask extends React.Component { > - {hostname} + {hostname} + + + + + + @@ -301,13 +327,17 @@ class PlayBook extends React.Component { static propTypes = { playbook: PropTypes.object, errorIds: PropTypes.object, + taskPath: PropTypes.array, + displayPath: PropTypes.array, } render () { - const { playbook, errorIds } = this.props + const { playbook, errorIds, taskPath, displayPath } = this.props const expandAll = (playbook.phase === 'run') - const expand = (expandAll || errorIds.has(playbook.phase + playbook.index)) + const expand = (expandAll || + errorIds.has(playbook.phase + playbook.index) || + taskPathMatches(taskPath, displayPath)) const ai = [] if (playbook.trusted) { @@ -340,7 +370,10 @@ class PlayBook extends React.Component { + taskPath={taskPath.concat([ + idx.toString(), idx2.toString(), hostname])} + displayPath={displayPath} task={task} host={host} + errorIds={errorIds}/> ))))} @@ -354,6 +387,7 @@ class PlayBook extends React.Component { class Console extends React.Component { static propTypes = { output: PropTypes.array, + displayPath: PropTypes.array, } constructor (props) { @@ -394,13 +428,14 @@ class Console extends React.Component { } render () { - const { output } = this.props + const { output, displayPath } = this.props return ( {output.map((playbook, idx) => ( - ))} + ))} ) diff --git a/web/src/index.css b/web/src/index.css index 5f917e77e1..9e7ac01380 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -226,6 +226,11 @@ pre.version { { cursor: default; } +.zuul-console-modal-header-link +{ + margin-left: 2em; + font-size: 18px; +} .zuul-console-task-detail { width: 80%; diff --git a/web/src/pages/BuildConsole.jsx b/web/src/pages/BuildConsole.jsx index 7ffba3d261..550197e41f 100644 --- a/web/src/pages/BuildConsole.jsx +++ b/web/src/pages/BuildConsole.jsx @@ -42,6 +42,8 @@ class BuildConsolePage extends Refreshable { render () { const { remoteData } = this.props const build = remoteData.builds[this.props.match.params.buildId] + const hash = this.props.location.hash.substring(1).split('/') + return (
@@ -49,7 +51,7 @@ class BuildConsolePage extends Refreshable {
{build && build.output && - + 0?hash:undefined}/> }
)