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

[code] Pass GITPOD_CODE_HOST when starting vscode server #18730

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

jeanp413
Copy link
Member

@jeanp413 jeanp413 commented Sep 16, 2023

Description

Related gitpod-io/openvscode-server@8bcdbe5

Summary generated by Copilot

🤖 Generated by Copilot at a526592

Switched the code-server component to use the open-vsx proxy for extensions and refactored the codehelper package to support different domains. Simplified the code-server Dockerfile and updated the workspace configuration.

Related Issue(s)

Fixes #

How to test

Check both vscode stable and insiders works:

  • Extension gallery
  • Settings sync
  • Webviews
  • Web extensions (vim)

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
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@jeanp413
Copy link
Member Author

jeanp413 commented Sep 16, 2023

/gh run recreate-vm

Comment triggered a workflow run

Started workflow run: 6209087373

  • recreate_vm: true

@jeanp413 jeanp413 force-pushed the jp/temporary-seahorse branch from d647483 to a00bf47 Compare September 17, 2023 13:04
@jeanp413
Copy link
Member Author

jeanp413 commented Sep 17, 2023

/gh run recreate-vm

Comment triggered a workflow run

Started workflow run: 6215455970

  • recreate_vm: true

@jeanp413
Copy link
Member Author

Seems there's a bug in our open-vsx proxy:

@@ -61,14 +61,21 @@ func main() {
}
phaseDone()

url, err := url.Parse(wsInfo.GitpodHost)
Copy link
Member

Choose a reason for hiding this comment

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

We have only codehelper which should work with all images. Let's keep backward compatible mode based on version from product.json.

We will need to keep old rules in installer as well.

We can only remove them when all Dedicated cells and Cloud are migrated to new images.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just 💄 as GitpodHost was parsed twice in prepareServerMain and prepareWebWorkbenchMain, the functions will still be invoked correctly for all versions, GITPOD_CODE_HOST env var will be ignored for old versions

Comment on lines -55 to -66
}, {
Search: "{{extensionsGalleryItemUrl}}",
Replacement: extensionsGalleryItemUrl,
Path: "/ide/out/vs/workbench/workbench.web.api.js",
}, {
Search: "{{extensionsGalleryItemUrl}}",
Replacement: extensionsGalleryItemUrl,
Path: "/ide/out/vs/workbench/workbench.web.main.js",
}, {
Search: "{{trustedDomain}}",
Replacement: trustedDomain,
Path: "/ide/out/vs/workbench/workbench.web.api.js",
Copy link
Member Author

Choose a reason for hiding this comment

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

workbench.web.api.js file does not exist a long time ago so it's fine to delete these rules

Comment on lines -81 to -92
}, {
Search: "${window.location.origin}",
Replacement: ".",
}, {
Search: "value.startsWith(window.location.origin)",
Replacement: "value.startsWith(window.location.origin) || value.startsWith('${ide}')",
}, {
Search: "./out",
Replacement: "${ide}/out",
}, {
Search: "./node_modules",
Replacement: "${ide}/node_modules",
Copy link
Member Author

Choose a reason for hiding this comment

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

These search values do not exist in index.html a long time ago so removing them it's fine

@jeanp413 jeanp413 force-pushed the jp/temporary-seahorse branch from 28da6f7 to 0dcc3a5 Compare September 18, 2023 20:32
@jeanp413
Copy link
Member Author

resourceUrlTemplate: 'https://open-vsx.org/vscode/unpkg/{publisher}/{name}/{version}/{path}' will be harcoded in gp-code until open-vsx proxy is fixed

@jeanp413
Copy link
Member Author

jeanp413 commented Sep 19, 2023

/gh run recreate-vm

Comment triggered a workflow run

Started workflow run: 6230900477

  • recreate_vm: true

@jeanp413 jeanp413 marked this pull request as ready for review September 19, 2023 05:27
@jeanp413 jeanp413 requested a review from a team as a code owner September 19, 2023 05:27
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.

i did not try

@jeanp413
Copy link
Member Author

jeanp413 commented Sep 20, 2023

/gh run recreate-vm

Comment triggered a workflow run

Started workflow run: 6243722056

  • recreate_vm: true

@jeanp413
Copy link
Member Author

Tested stable and insiders, both work 🎉

@roboquat roboquat merged commit 75753c1 into main Sep 20, 2023
81 checks passed
@roboquat roboquat deleted the jp/temporary-seahorse branch September 20, 2023 06:04
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.

3 participants