Skip to content

Conversation

@mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Nov 13, 2024

Description

Updates: We're not sure if we want to ship this change or not yet.

Make it able to block the builtin Gradle Sync in JetBrains IDEs via GP CLI, to improve workspace performance on workspace start without Prebuilds ready when there's two gradle processing running. Show notification in JetBrains IDE to make user aware of this pausing (cancellable)

image

Related Issue(s)

Fixes CLC-525

How to test

Note

Don't forget to delete files before exit (elasticsearch repo is too big) to save space in preview env rm -rf /workspace ; gp stop

  • Create workspaces with context below in preview env with stable or latest IntelliJ IDEA
  • Exec ./gradlew --status to see gradle state
  • Case 1: With repo 1, you should be able to see there's two gradle busy running when workspace started (you should be faster than they finish)
  • Case 2: With repo 2, there should only have one gradle running, and after it's stopped, another one should show (the second one is from IntelliJ IDEA itself)
    • elasticsearch repo is too big to download resources (requires more space), so you could force stop that Gitpod task, and exec gp jetbrains gradle resume maually)
  • Case 3: With repo 2, click the Cancel button on notification, the pausing should be stopped, you should see two gradle process

Context repo:

  1. Exec gradle cmd in init tasks: https://github.com/mustard-mh/elasticsearch/tree/no_intellij_warmup
  2. Use new gp jetbrains gradle pause and exec gradle cmd in init task: https://github.com/mustard-mh/elasticsearch/tree/pause-gradle
Case 1 Case 2 Case 3
SCR-20241115-brwd SCR-20241115-ccxn SCR-20241115-btoqSCR-20241115-btuf

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=jetbrains
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@mustard-mh mustard-mh changed the title WIP Introduce builtin Gradle Sync pausing in JetBrains IDEs with GP CLI Nov 14, 2024
- NO_VERIFY_JB_PLUGIN=true
config:
commands:
- ["rm", "-rf", "src/main/kotlin/io/gitpod/jetbrains/remote/listeners/GradleSyncListener.kt"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need this line because the file exclude in build.gradle.kt somehow not working well. (And I don't want to investigate why)

var jetbrainsCmd = &cobra.Command{
Use: "jetbrains",
Aliases: []string{"jb"},
Short: "Interact with JetBrains editor.",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Short: "Interact with JetBrains editor.",
Short: "Interact with JetBrains IDEs",

Comment on lines +33 to +34
"Gitpod: Pause gradle sync",
"Pausing Gradle Sync, execute <code style='color: orange;'>gp jetbrains gradle resume</code> to unblock all builtin Gradle Sync",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Gitpod: Pause gradle sync",
"Pausing Gradle Sync, execute <code style='color: orange;'>gp jetbrains gradle resume</code> to unblock all builtin Gradle Sync",
"Gitpod: Gradle sync is paused",
"JetBrains' built-in Gradle sync is paused, execute <code style='color: orange;'>gp jetbrains gradle resume</code> to unblock it",

Comment on lines +38 to +43
notification.addAction(object : NotificationAction("Cancel") {
override fun actionPerformed(e: AnActionEvent, notification: Notification) {
isCancelled = true
notification.expire()
}
})
Copy link
Member

Choose a reason for hiding this comment

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

Does this actually cancel the sync? It looks more like it just dismisses the notification. If so, let's rename it to Dismiss. I definitely could be missing something though.

@mustard-mh
Copy link
Contributor Author

@filiptronicek Thanks for your review, but it seems we don't want to have such feature [internal chat].

I have turned this PR into draft

@github-actions
Copy link
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the meta: stale This issue/PR is stale and will be closed soon label Nov 25, 2024
@mustard-mh mustard-mh closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants