Related to #31146
About this PR
This PR Contains a .gitpod.yml which enables the prebuild and creates a ready to code workspace for contributors.
Maintainability
You do not have to change anything, until or unless you change the build commands flow. In all cases it would work perfect. & This Will Not affect the ongoing maintenance
PS: Prebuilds are enabled - saving ~3 minutes of build/ workspace startup time from a cold state.
Comment From: pivotal-cla
@Siddhant-K-code Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-cla
@Siddhant-K-code Thank you for signing the Contributor License Agreement!
Comment From: Siddhant-K-code
It took a while for the IDE to be ready as it downloaded JDK 17 and ran the build. Am I right in thinking that a pre-build will typically take care of this?
Yeah, prebuild works in the case when there is init task in the .gitpod.yml file. But, to save the new build each time & loading the previous commit prebuild requires Gitpod - GitHub App or We can simply run the same commands as command which will fastly load the workspace and then all will steps would be running the terminal, automatically.
Doc: Gitpod Prebuilds
Is it possible for this extension to be pre-installed so that users get an error-free experience when they first open the project on Gitpod?
Yeah, we can do that, will do the required changes.
Related Doc: vscode-extensions in .gitpod.yml file
After manually installing Language Support for Java and reloading the workspace, no Java projects are found and I haven't managed to figure out how to add them.
Thanks for pointing this out, it is a known issue we are tracking in gitpod-io/gitpod#9839
Comment From: wilkinsona
Thanks for pointing this out, it is a known issue we are tracking in https://github.com/gitpod-io/gitpod/issues/9839
Thanks for the link to the Gitpod issue. I'll mark this as blocked until it has been resolved.
Comment From: Siddhant-K-code
I have added the needed extension for java, that issue will not affect now, as it would install the extension while creating the dev. environment. We can merge this!
Comment From: wilkinsona
Unfortunately, it doesn't seem to work. With your latest changes, the first time I opened https://gitpod.io/#https://github.com/gitpod-forks/spring-projects-spring-boot, it reported an error that the Java extension wasn't installed. The second time, it seemed to install the Java extension automatically but then reported an error that said "redhat.java extension is not synced, but not added in .gitpod.yml". In both cases no Java projects were found in the workspace.
Comment From: Siddhant-K-code
I have installed the required VsCode Extensions
But, it is now showing this, is there something issue with dev. environment or some build command? can you pls help me on this. Getting this:
Build Status:
Comment From: wilkinsona
The error in the first screenshot means that it's using a version of Java lower than 17 to run the build. The second looks to be unrelated but indicates that something else isn't quite right as it's using a nightly build of Gradle 7.5. It should be using the Gradle wrapper (./gradlew) which is Gradle 7.4.2 at this time.
Comment From: snicoll
@Siddhant-K-code Do you have any update for us?
Comment From: wilkinsona
Thanks for the updates.
I've opened https://gitpod.io/#https://github.com/gitpod-forks/spring-projects-spring-boot in my browser. 25 minutes later, the prebuild is still running. I can understand the benefits of it downloading all of the dependences so that things work smoothly in the IDE, but it's running all of the tests which feels unnecessary to me. I suspect it might be a lot quicker if https://github.com/gitpod-forks/spring-projects-spring-boot wasn't 100s of commits being https://github.com/spring-projects/spring-boot as cache hits from Gradle Enterprise would be more likely. Regardless of that, the current prebuild configuration feels suboptimal to me.
I'll take another look once the prebuild has completed and I've had a chance to use the IDE.
Comment From: Siddhant-K-code
Sorry for kept you waiting @wilkinsona @snicoll
I think, it should work now. I have put the build commands to init that means it would be build before a workspace will start.
To get the full benefit of prebuilds (which would save time) you need to install the Gitpod app to this repository.
This Saves Build time, (very recently Node does which can save around ~41 minutes every time a person open a gitpod workspace)
Also, I think we should skip the running tests while build. Any flag in build command to skip tests?
Comment From: wilkinsona
The prebuild failed after almost an hour with the following message
"We are having trouble connecting to the server. Either you are offline or websocket connections are blocked."
Clicking Skip Prebuild then allowed the IDE to open in my browser but there's no Java extension installed. I can open the code, but it's treated as plain text.
Unfortunately, it's getting increasingly difficult to justify spending more time on this. Flagging for discussion at a team meeting so that we can decide what we want to do.
Comment From: Siddhant-K-code
The prebuild failed after almost an hour with the following message
"We are having trouble connecting to the server. Either you are offline or websocket connections are blocked."
It was due to, Gitpod has 1 hour timeout for the prebuilds. I think with skipping the tests check while build will decrease this time. & It would work smoothly.
Clicking Skip Prebuild then allowed the IDE to open in my browser but there's no Java extension installed. I can open the code, but it's treated as plain text.
It was in the previous commit (outdated workspace image). Now, this problem won't be there. I have updated the workspace image.
Unfortunately, it's getting increasingly difficult to justify spending more time on this. Flagging for discussion at a team meeting so that we can decide what we want to do.
Sorry for the friction. Would be fix soon 🤞🏼
Comment From: wilkinsona
I think with skipping the tests check while build will decrease this time. & It would work smoothly
We can't skip the tests entirely, unfortunately. Some of our documentation is test-driven so skipping them will prevent the documentation from being built. Running ./gradlew assemble may be a better option. That'll build everything and only run the handful of tests that are used to generate documentation. If it would be beneficial to also pre-download test dependencies, ./gradlew assemble compileTestJava should still be relatively quick.
Build time should also be improved by our Gradle Enterprise cache that's hosted at https://ge.spring.io. Cache retention is relatively short so your branch being 600 commits behind our main branch will be negating its benefits. Perhaps you can rebase and force-push?
Comment From: Siddhant-K-code
We can't skip the tests entirely, unfortunately. Some of our documentation is test-driven so skipping them will prevent the documentation from being built. Running ./gradlew assemble may be a better option. That'll build everything and only run the handful of tests that are used to generate documentation. If it would be beneficial to also pre-download test dependencies, ./gradlew assemble compileTestJava should still be relatively quick.
Thanks for the suggestions, I have updated the .gitpod.yml file. It should work now.
Build time should also be improved by our Gradle Enterprise cache that's hosted at https://ge.spring.io/. Cache retention is relatively short so your branch being 600 commits behind our main branch will be negating its benefits. Perhaps you can rebase and force-push?
Updated that 👍🏼
For me It is loading something like this:
Comment From: bclozel
The team discussed this PR and unfortunately we're going to decline it. Having seen how difficult it is to set up, we're not confident in our ability to maintain this in the long run. We don't use a cloud setup on a day-to-day basis, so only newcomers are likely to find out about issues. On the other hand, we're maintaining our Contributing docs and have a dedicated first-time-contributor process that brought many new contributors to the project.
Thanks @Siddhant-K-code !