-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[prebuild] Support opening a specfic prebuild #13768
Conversation
a2712f0
to
a8bb384
Compare
Change works now as intended. I've also changed the wording on the button. I am not particularly fond of the hoops I had to introduce to make the overall change happen! |
Awesome news, many thanks @csweichel! 🎉 The Werft build failed with:
we could raise this timeout to 30s. But meanwhile: /werft run 👍 started the job as gitpod-build-cw-open-prebuild-2.2 |
@csweichel While I see that this is a minimal change to enable opening workspaces arbitrary prebuilds: Is this really something we want to enable using a ContextParser? That somehow feels like a hack to me (and might cause some of the "hoops" you were referring to). I'm ok with this if we want to have something to move forward and test quickly. But I'd rather not ask customers to use these ContextUrls. 😕 I'd rather go with something akin Jan is looking into and call that from the dashboard in appropriate places. WDYT? |
Ideally I'd like to have an actual proper context for opening "named" prebuilds. Unfortunately The way we currently integrate prebuilds in the workspace creation and context handling is a bit of a "slight of hand" style thing with a few implicit assumptions/behaviours sprinkled in, which e.g. enable the incremental nature of things today. That's what necessitates hoop 2: the copying of the original context and removal of Testing all this stuff is near impossible. I tried to introduce a unit test for How do we ensure that users actually get the prebuild they selected, if not through context? Relying on the commit matching alone feels too brittle. |
I agree here if by "named" you mean precisely define which prebuild you want. 👍
I thought about this as more of a parameter to "createWorkspace" which controls where to initialize content from, rather than a Context. Content depends on the Context, but they are not the same.
Absolutely agree. That's one area where we never found time yet to improve upon. |
@@ -373,6 +374,18 @@ export class WorkspaceFactoryEE extends WorkspaceFactory { | |||
config._featureFlags = (config._featureFlags || []).concat(["persistent_volume_claim"]); | |||
} | |||
|
|||
if (OpenPrebuildContext.is(context.originalContext)) { | |||
// Because of incremental prebuilds, createForContext will take over the original context. |
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.
👍
@@ -1200,6 +1200,16 @@ export namespace AdditionalContentContext { | |||
} | |||
} | |||
|
|||
export interface OpenPrebuildContext extends WorkspaceContext { |
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.
While I'm not super-fond of adding a ContextParser for this I understand that currently, it's the only accessible way that make things like this work.
Also, removing it later should not be too hard. 🙂
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.
Why don't we use the commit context?
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.
See related discussion: #13706 (comment)
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.
Code LGTM, tested and works. ✨
a8bb384
to
8b4b8dc
Compare
rebased to make the build green... 🤞 |
(Werft was having too much trouble with #13706 hence the new PR 👇)
Description
This PR enables users to open a specific prebuildm, and integrates this capability on the dashboard.
Fixes #13900
How to test
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
Front conversations