New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug/jenkins 37425 run stop toast changes #515
Bug/jenkins 37425 run stop toast changes #515
Conversation
…L to the corresponding UI URL, to avoid encoding bugs
…s; add some assets for testing and in prep of "Run Pipeline" refactor
…iple "libraries" (e.g. JDL and CoreJS) in the src/main/webapp/assets directory
… be shared across plugins; support multiple subscriptions; still needs testing
…d to be caused by two SSE connections being made using the same clientId
… style collisions with button tag
…plicate listener for each subscription added
…and "stopped" toasts
…prevents them from being added; in place until we find a more elegant fix in upstream code
…ithin ToastService (for now)
…o it can toggle or show only run or stop; update Activity tab to use new RunButton at top for non multi-branch
# Conflicts: # blueocean-core-js/package.json # blueocean-core-js/src/js/components/ReplayButton.jsx # blueocean-core-js/src/js/components/RunButton.jsx # blueocean-dashboard/package.json # blueocean-personalization/package.json # blueocean-web/package.json
…w handled directly by RunButton / ReplayButton; delint
…od; fix a bug on Run Details where replaying multiple times would not work because the button was not having its state reset when bound to a new Run
…ardCards down into PipelineCard - where it's more sensible to be; update all shrinkwraps
# Conflicts: # blueocean-dashboard/npm-shrinkwrap.json # blueocean-personalization/npm-shrinkwrap.json # blueocean-web/npm-shrinkwrap.json
@@ -7,34 +7,14 @@ import { connect } from 'react-redux'; | |||
import { createSelector } from 'reselect'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a lot of logic from this component down into PipelineCard
. Instead of this component picking out the data and passing a ton of props down into the card, it made sense to just pass the object down and let PipelineCard
do that work.
text: `Stopping "${name}" #${runId}...`, | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Run/ReplayButton components do all the work of run, stop and replay... so this code can go.
> | ||
{favoriteCards} | ||
</TransitionGroup> | ||
</div> | ||
</FavoritesProvider> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this component is just rendering a stack of cards the render
method is a lot simpler.
Fetch.fetch(stopPipelineUrl, fetchOptions); | ||
}; | ||
}, | ||
|
||
updateRun(jobRun) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this is handled by Run/ReplayButton now.
|
||
.svg-icon-inner { | ||
fill: #CCC; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some hover states for the start / stop / replay icons.
background-image: url('./icons/stop-button-blue-dark.svg'); | ||
} | ||
} | ||
/* asset has different padding than material-icon asset used in .run-button: nudge it slightly */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop button now uses a SVG inline to again avoid the need for 4 different external SVG assets. The SVG is tiny, so it shouldn't be bad at all.
toastService.newToast({ | ||
text: `Queued "${name}"`, | ||
}); | ||
runApi.startRun(this.props.runnable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the most significant change above: since we create "Started" and "Stopping" toasts immediately when the REST API call returns, we don't need to listen to SSE to create these toasts. The old code was a lot more complex than it needed to be.
}); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug where the button got stuck in replaying state if going through the start -> stop -> rerun cycle more than once.
|
||
const shortNameMatches = flattenedCapabilities.filter(longName => shortNames.indexOf(longName) !== -1); | ||
if (shortNameMatches.length > 0) { | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy for someone to pass an array as the first argument rather than spreading it, so this logic handles either case (and has associated tests).
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
Passed ATH locally. |
autoNavigate | ||
/> | ||
</IfCapability> | ||
<ReplayButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick chance of anon read only access - seems ok (from what I can tell)
That's a lot of code to review - so so not sure if my read of it counts, but it seems sensible (lots of removed messy code, which seems nice) and seems to work. I assume you ran the latest ATH - after doing a clean -DcleanNode? (I also kicked off: https://ci.blueocean.io/job/ATH-Jenkinsfile/job/master/6/ on CI - just to be sure). This gets a 🐝 from me, but I would like @sophistifunk or @scherler to take a look if they are around if possible. (also using -beta dependency that needs to change, may need updating to master as a few other changes went in, yada yada YMMV) |
Code looks OK to me 🐝 |
# Conflicts: # blueocean-dashboard/src/main/js/components/RunDetails.jsx
ATH passed locally. |
Description
Submitter checklist
Reviewer checklist
@jenkinsci/code-reviewers @reviewbybees