Skip to content
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

Wait the Guest Client to be connected to the workspace before executing "gp preview" on JetBrains IDEs. #10129

Merged

Conversation

felladrin
Copy link
Contributor

@felladrin felladrin commented May 19, 2022

Description

Wait the Guest Client to be connected to the workspace before executing "gp preview" on JetBrains IDEs.

Related Issue(s)

Fixes #10118

How to test

  • Access the following URL to open Jenkins Design Library in Gitpod's Preview Environment in IntelliJ IDEA:
    https://vn-10118-j8f802b11df.preview.gitpod-dev.com/#referrer:jetbrains-gateway:intellij/https://github.com/jenkinsci/design-library-plugin/tree/73f12733d95932c333ba4155521ff78b4ed40dfc
  • As soon as the IDE opens, it stats building the project. Meanwhile, if you want, you can use gp tasks attach to attach to "Preview" task. (See the project's .gitpod.yml)
  • After the build completes, port 8080 will be available, and at this moment, the IDE should ask if you want to open the browser at the address $(gp url 8080)/jenkins/.
    image
    image
    Note: Sometimes the project build fails with messages like java: error reading /workspace/m2-repository/jaxen/jaxen/1.2.0/jaxen-1.2.0.jar; zip file is empty and the only solution is to manually delete the dependency folder (rm -rf /workspace/m2-repository/jaxen/) and then run mvn hpi:run again.
  • Stop the workspace and restart it. Now the build will happen pretty quickly, as all dependencies are already downloaded. So as soon as you open the workspace on IntelliJ you should see the popup asking if you want to open Jenkins URL in the browser.

Release Notes

Fixed a bug that was preventing "gp preview" to work in JetBrains IDEs when executed as a task in ".gitpod.yml".

Documentation

None.

@felladrin felladrin linked an issue May 19, 2022 that may be closed by this pull request
@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch 2 times, most recently from c074589 to 0a1b509 Compare May 19, 2022 14:24
@roboquat roboquat added size/S and removed size/M labels May 19, 2022
@felladrin felladrin self-assigned this May 19, 2022
@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch from 0a1b509 to 653ff90 Compare May 19, 2022 15:35
@felladrin
Copy link
Contributor Author

I've noticed that if I stop the workspace, start it again and run gp tasks attach and select the Preview task, I always see the "500 Internal Server Error" message:
image

@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch from 653ff90 to 82fa60f Compare May 24, 2022 15:34
@roboquat roboquat added size/M and removed size/S labels May 24, 2022
@felladrin felladrin changed the title Wait the Gitpod Backend Plugin for IntelliJ to be ready before executing any command on 'idea-cli' Wait the guest client to be connected before executing "gp preview" on JetBrains IDEs May 24, 2022
@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch 3 times, most recently from f908f73 to 4ca0d14 Compare May 25, 2022 09:10
@felladrin
Copy link
Contributor Author

I've noticed that if I stop the workspace, start it again and run gp tasks attach and select the Preview task, I always see the "500 Internal Server Error" message: image

This has been fixed by the changes on GitpodCLIService.kt

@felladrin felladrin changed the title Wait the guest client to be connected before executing "gp preview" on JetBrains IDEs Wait the Backend Plugin to be ready and the Controller Client to be connected before executing "gp preview" on JetBrains IDEs May 25, 2022
@felladrin felladrin marked this pull request as ready for review May 25, 2022 09:23
@felladrin felladrin requested a review from a team May 25, 2022 09:23
@felladrin felladrin marked this pull request as draft May 25, 2022 10:53
@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch from 4ca0d14 to 6bbdd06 Compare May 25, 2022 13:48
@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch 2 times, most recently from 72b6556 to 82f10ca Compare May 25, 2022 14:53
@felladrin felladrin marked this pull request as ready for review May 25, 2022 16:14
@felladrin felladrin marked this pull request as draft May 26, 2022 07:02
@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch from 82f10ca to 54dee5e Compare May 26, 2022 11:06
@felladrin felladrin marked this pull request as ready for review May 26, 2022 11:09
@felladrin felladrin requested a review from akosyakov May 26, 2022 11:11
@akosyakov
Copy link
Member

akosyakov commented May 26, 2022

@felladrin open --wait still does not work for me

I tried to perform git rebase -i origin/master and cli hangs for me forever:
Screenshot 2022-05-26 at 15 49 15

@felladrin
Copy link
Contributor Author

felladrin commented May 26, 2022

@felladrin open --wait still does not work for me

I tried to perform git rebase -i origin/master and cli hangs for me forever.

Seems to be an issue with JetBrains Remote Development, cause we need to click "Release" (in the editor) for it to detect that we finished working with the file. Closing the file tab doesn't work.

image

Let me confirm it with JetBrains team.

@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch 2 times, most recently from 8c8cdb5 to a542b17 Compare May 26, 2022 15:05
…onnected before executing "gp preview" on JetBrains IDEs
@felladrin felladrin force-pushed the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch from a542b17 to 8a1930a Compare May 26, 2022 15:10
@felladrin felladrin changed the title Wait the Backend Plugin to be ready and the Controller Client to be connected before executing "gp preview" on JetBrains IDEs Wait the Guest Client to be connected to the workspace before executing "gp preview" on JetBrains IDEs. May 26, 2022
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felladrin Please open a follow up issue about broken gp open --wait, assign it to yourself and add to team sycn under port management for JB. We need to fix it with help of JB.

But since it is the same on master, let's merge to fix gp preview at least.

@roboquat roboquat merged commit 6e06744 into main May 27, 2022
@roboquat roboquat deleted the vn/10118-jb-gp-preview-fails-if-running-from-gitpodyml branch May 27, 2022 07:59
@felladrin
Copy link
Contributor Author

@felladrin Please open a follow up issue about broken gp open --wait, assign it to yourself and add to team sycn under port management for JB. We need to fix it with help of JB.

Issue created.

@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production editor: jetbrains release-note size/M team: IDE
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[jb] gp preview fails if running from .gitpod.yml
4 participants