-
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
[PVC] Prebuild without PVC, user A account with PVC and trigger rebuild, user B account without PVC #12718
Comments
👋 @jenting I just tested this, and got same result. Here are supporting details: project has pvc disabled, https://gitpod.io/t/prebuild-experiment/prebuild-experiment user has PVC enabled, https://gitpod.io/admin/users/8df3495b-685d-46e0-9820-009cc3b4afd8 push a code change to a branch prebuild will not use PVC, which is expected, because it's disabled on the project. Details:
Same user has PVC disabled now PVC is still disabled on the project A new workspace is started from the branch's prebuild, but has PVC. Details:
I think there are two contributing factors:
This query shows the feature flag is being persisted: SELECT JSON_EXTRACT(dbw.config, "$._featureFlags")
FROM gitpod.d_b_workspace dbw
where dbw.id = 'kylos101-prebuildexperi-5p1e6ngpkxf'; If we avoid sending the Either way, this is a good catch, nice find! 💪 |
I think when open the workspace, we should check the prebuild project PVC enabled or the user's PVC enabled. If one of the condition hits, we send start workspace request with feature flag |
👋 @jenting ,
A couple questions:
Considerations:
It seems like the problem is, when we run prebuilds, if the startWorkspace request contains |
regular workspace
Because if the project was built with PVC, then for any user who open the regular workspace from that prebuild will force to use PVC. Because the user enables PVC, open workspace from prebuild (with PVC or without PVC) or from git clone, the regular workspace should use PVC. From my point of view, we should save the Then, the start workspace request
|
I like your idea, @jenting . My only concern with user feature flag in its current form, is that it is hard to roll out. For example, we have to set it via Admin page, or SQL query. Ideally we'd set the Checkout #12745 for the idea, should help us rollout in a more flexible way. |
Hey @geropl Here is a correct scenario: Broken scenario: This is where it happens:
This seems to me like a bug, and we should not tangle prebuild and workspace together in that scenario, as we are leaking feature flags of a user into prebuild. Can you provide insight? If it is indeed a bug, would you mind scheduling a fix for it? |
Hey @sagor999, 👋 let me re-phrase, to make sure we're on the same page:
If that's a correct summary this is expected behavior. 😕 I don't say it's ideal, and we need to fix the hard prebuild <-> user coupling (see "domain model" discussion where having soon). I'm not sure if we support the PVC -> old workspace backup path, but from the context I assume not. Then I see two ways:
|
|
Given this block gitpod/components/server/src/workspace/workspace-starter.ts Lines 851 to 860 in 5bae14d
It seems like the problem could be that we're passing I see options are set here:
But the only place where they are being set explicitly is here:
And @sagor999 I assume you were testing with a project that had PVC disabled, so this should return false:
🤔 I am confused as to why we're persisting the PVC feature flag in this case. What am I missing? |
@kylos101 no, this is not correct. So in our case prebuild is correctly ran without PVC (since project has it disabled), but then it would open workspace with PVC enabled since user has PVC flag enabled, and then that flag would get baked into prebuild somehow. And this only happens when running prebuild via |
Whoops, the Using that prefix is unsupported, and might result in undefined behavior / a broken experience. The supported ways to trigger prebuilds are (by order of preference):
|
🤔 but I remember my reproduce steps are
|
@jenting can you try to repro this? I was only able to repro this when using #prebuild url. 🤔 |
While removing the |
I think I found the bug; it is as @jenting described. The problem:
Just to make sure I understand how
D'accord? 🤔 Based on this I'll create PR. Update: here it is. #13117 @sagor999 I think it make sense to talk through the PR in sync to make sure we do not miss anything. Let's figure out a time in Slack. |
Bug description
The prebuild project without PVC.
The user A account with PVC, add new branch X and commit, push branch X to the repo, trigger prebuild on Gitpod. The prebuild runs without PVC.
The user B account without PVC, open that branch X, the user B uses PVC.
Steps to reproduce
The prebuild projects without PVC.
Workspace affected
No response
Expected behavior
User B should open the workspace without PVC because the prebuild project is configured without PVC, also the user's account does not enable PVC.
Example repository
No response
Anything else?
#7901
The text was updated successfully, but these errors were encountered: