-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[dashboard] Don't show 'Continue with Default Image' button while the build is still running #4104
Conversation
…prevent restart spam
ac8802b
to
c6d6cf1
Compare
@@ -267,7 +267,7 @@ export default class StartWorkspace extends React.Component<StartWorkspaceProps, | |||
case "stopped": | |||
phase = StartPhase.Stopped; | |||
if (this.state.hasImageBuildLogs) { | |||
return <ImageBuildView workspaceId={this.state.workspaceInstance.workspaceId} onStartWithDefaultImage={() => this.startWorkspace(true, true)} phase={phase} error={error} />; | |||
return <ImageBuildView workspaceId={this.state.workspaceInstance.workspaceId} onStartWithDefaultImage={e => { (e.target as HTMLButtonElement).disabled = true; this.startWorkspace(true, true); }} phase={phase} error={error} />; |
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.
nit: the disablement is quite hidden now. would extracting to a dedicated handler as a local help to make it more readable?
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.
Works as advertised!
c6d6cf1
to
d0be03f
Compare
… build is still running
d0be03f
to
5774850
Compare
🎰 /werft run 👍 started the job as gitpod-build-jx-dont-continue-with-default-img.4 |
FWIW, Tried this earlier and worked as expected! 🎰 |
Fixes #3777
While going down the rabbit hole of trying to fix the
Continue with Default Image
button while a build is still running in #3993, we realized that running Docker builds cannot be interrupted.image-builder
simply wasn't designed for that.So we have 3 choices:
Change
image-builder
so that it can interrupt builds that are currently in progressJust start a new workspace instance while the old instance is still building, and live with having two instances in this case (breaks many assumptions in the code)
Remove the
Continue with Default Image
button while the build is still running, for now (this was also the case in the previous dashboard design -- button only showed up when the build finished / failed)This PR implements choice 3.
How to test:
Continue with Default Image
button (Docker build will hang for 1h)Continue with Default Image
button and that it works (Docker build will quickly fail)