-
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
[content-service] incremental workspace init #14140
Conversation
started the job as gitpod-build-se-incremental-init.1 because the annotations in the pull request description changed |
48c3cf7
to
0916d99
Compare
started the job as gitpod-build-se-incremental-init.4 because the annotations in the pull request description changed |
/werft run with-clean-slate-deployment 👍 started the job as gitpod-build-se-incremental-init.5 |
Do you have a plan to add the integration test about it on another PR? |
I could add a unit test. Where do we have the other git initializer tests? |
I looked into the existing integration tests and couldn't see anything close. I think building something would be a bit too heavy for this case. Only for the positive case, what we would need to do is setup an external repo with at least two commits on a branch. Then create a prebuild on the older commit and start a workspace on the newer when the prebuild is ready. The expectation would be that init task runs in the new workspace but that there are some traces from the previous prebuild. |
Sure, I agree with you. it might be a bit heavy. But this feature is complex and I'd prefer to have an integration test to avoid regression. How about creating an issue by discussing the response about testing there? I don't think it is necessary to include that test in this PR |
/werft run with-integration-tests=workspace 👍 started the job as gitpod-build-se-incremental-init.6 |
Nice! Many thanks @svenefftinge 🙏 I'll give this a spin. 👀 💿 |
I tested this with:
And this seems to work quite well! One question about the UX though:
Currently, the behavior of "?" seems to be:
Maybe it should both print the prebuild log and run
|
@svenefftinge when this PR is ready, can you please enable integration tests for it and run it through those, just to be safe. (it might help to enable large VM option as well) |
@jankeromnes |
started the job as gitpod-build-se-incremental-init.7 because the annotations in the pull request description changed |
started the job as gitpod-build-se-incremental-init.8 because the annotations in the pull request description changed |
Changed integration test to workspace only. all is too heavy. |
0916d99
to
bd21597
Compare
I think we can continue discussing it here, even if the PR is merged. |
We have already Can we combine these to implement this? If it is going to take more than an hour to implement, I too will vote for no testing. But if we encounter will regressions about this feature in the future, then we spend the time to create tests. WDYT? |
if we initialize the workspace from an outdated prebuild, we need the regular workspace tasks (including init) should run.
bd21597
to
ab23021
Compare
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.
Many thanks @svenefftinge!
FYI, the state that I tested last time worked really well from a UX perspective, with only the UX question about the old prebuild logs (but this could definitely be a follow-up improvement, so not a blocker). I'll still reply to your comment below.
However -- what is a blocker is that now, I'm unable to get this to work again 😕 has there been a regression maybe?
- I've added the following repository as a project https://github.com/jankeromnes/test-gitpod-incremental-workspaces (if you want to take a look, it's under this team)
- I already had a prebuild for the latest commit ("Wob")
- I pushed a new commit ("Wob wob") to trigger a new prebuild
- In the Branches view, I refreshed a few times until I saw both the new commit and the "In Progress" prebuild, then I clicked on "New Workspace"
- This showed me the "Prebuild in Progress" screen as expected, and I clicked on "Use Last Successful Prebuild"
Unfortunately, this gave me a workspace in this state (i.e. it's still the old prebuild commit "Wob" that is checked out, not the new "Wob wob" commit, and I'm not even on branch "main"):
Maybe something broke in one of your latest pushes?
(FYI, I was about to approve this PR for team WebApp because the UX was working well, but now it seems broken again. 🥲 Could you please take a look when you have time? Or maybe I'm missing something?)
Also, regarding the UX question (but note that this is a follow-up discussion, so not a blocker here): My main worry is that, by not printing the old prebuild log, we're "hiding" potentially useful debug information, i.e. we're being less transparent with the user as to what is happening. I would personally much prefer to cat the old prebuild logs + print a message like "Running an incremental build to speed up your workspace ♻️" + run the init commands again.
I think it can be relevant in some edge cases, for example if your build system prints "using version XYZ of dependency BLA", and later on your build fails due to an incompatible dependency. If we don't re-print logs, users may get very surprised as to why sometimes their build passes (from scratch) and sometimes it fails (incremental workspace), without any logs or indicator to help them debug what's happening.
That's true -- however I would argue that, when you have a local checkout, you expect to have some old state in there (always), but when you start a new Gitpod workspace, I think the expectation is reversed -- I expect to always start from a clean slate, and when that perceived clean slate fails due to some remaining older state (and the IDE does not show me any hint that an older state was even used) I can get quite surprised. |
As I said I'm strongly against doing this as it would create noise and make things seem more complicated than they are. The logs would end up twice in my console and the first part would be for an arbitrary past state. How could this possibly be useful? |
Strange, I haven't changed the production code only added a test case, which succeeds. |
If it turns out that this is indeed a source of surprise, we should think about other ways (more explicit than printing logs) to tell users they are on an incremental workspace. |
I wasn't able to reproduce this by doing the following:
I got the expected flow. That is I first end up on prebuild running screen and when I click the start of old prebuild button, I get a workspace that executed the init task and presents:
Could it be that did something wrong in your manual testing? You would end up in such a state if you start on the commit context. This is not something the changes in the PR would influence. So if the button on the "prebuild in progress" sometimes starts on a commit we have this flakiness on |
Ah, good call -- and my apologies, I indeed missed that the I'll try this again. 🤞 |
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.
Super cool! 🎉 The UX works flawlessly ✨ (especially when you test it correctly 😅)
(Side-note: I haven't tested for any side effects on multi-repo projects, but I guess this is fine since most of the risk is gated by the feature flag, and any accidental fall-out could be fixed quickly in production.)
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.
LGTM
/hold in case if there is more UX discussion needed prior to merge
feel free to remove hold when ready
/unhold |
If we initialize the workspace from an outdated prebuild, we
want the regular workspace tasks (including init) to run.
Related Issue(s)
Related to #12582
How to test
Start a workspace on an an outdated prebuild and see that the init task runs.
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide