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

DevPod quick launch http shortcut more prefill options #1026

Open
martinbiard opened this issue Apr 25, 2024 · 6 comments
Open

DevPod quick launch http shortcut more prefill options #1026

martinbiard opened this issue Apr 25, 2024 · 6 comments

Comments

@martinbiard
Copy link

I haven't been able to find out much documentation about the feature where devpod can be launched through a http link like this:

https://devpod.sh/open#[email protected]:my-org/my-repo.git

I've tested it with the creation of a new workspace, it works well but it is missing a few prefill options for my ideal use case.

In my use case, we support 2 IDEs for our developpers, VSCode and JetBrains WebStorm. I would like the be able to create devpod launch links that prefill everything (optionally, if those params are added to the link) that I could add to my README.md such that our devs could simply click the link that launches devpod in their preferred IDE, and then just click "Create Workspace" in devpod without having to tell them to fill out the Provider, IDE, Workspace Name, Prebuild Repository, and Devcontainer Path manually.

Somewhat related, while searching for quick launch link options for devpod, I came accros this github issue #748 which references how to create deeplinks. I've tried with links like these but couldn't get it to work at all:

devpod://[email protected]:my-org/my-repo.git&workspace=svg-io&provider=docker&ide=vscode
devpod://open?git%40github.com%3Amy-org%2Fmy-repo.git&workspace=my-workspace&provider=docker&ide=vscode

And, finally, another small suggestion. Right now, when you open the devpod.sh launch shortcut, it's named "Open Spin up dev environments in any infra" but I think it should mostly just say "DevPod" or "Open with DevPod".

Screenshot 2024-04-25 143531

For reference my OS where devpod is installed is Windows 11, and my browser is Chrome.

@shanman190
Copy link
Contributor

shanman190 commented Apr 26, 2024

source was the parameter that I found to put the URL in that would result in the repository being passed in.

@pascalbreuninger
Copy link
Member

Hey @martinbiard, thanks for opening the issue.
The current format for deeplinks is documented here, the only difference when relaying through devpod.sh/open is that you can omit the source parameter name. The rest works the same.
The deeplink
devpod://open?source=your-url-encoded-source&workspace=my-workspace&provider=docker&ide=vscode
becomes
https://devpod.sh/open#your-url-encoded-source&workspace=my-workspace&provider=docker&ide=vscode

Another neat trick is to just omit the source for github based repos, devpod.sh figures it out via the referrer header

As for the popup, that looks weird indeed, I'm wondering what windows is up to this time 🙃 it's not reproducible on linux or macOS for me

@martinbiard
Copy link
Author

Thanks @pascalbreuninger

Yes, those are the links I tried, but I have these issues:

  • The devpod:// url scheme does not work at all, I can paste it in chrome and chrome asks if I want to open it with devpod but if I accept, it never makes it to the devpod app (not sure how to debug this further).
  • The https url scheme going through the devpod.sh website works better, it will actually bring up devpod and prefill the source with my github repo url. However, as mentioned in my original post, it won't prefill anything else even though I'm passing them as parameters (workspace, provider, ide).

@pascalbreuninger
Copy link
Member

@martinbiard I can't repro this on macOS, maybe it's a windows issue - we'll look into it.
Could you paste the updated url you're trying it with here please?

@martinbiard
Copy link
Author

@pascalbreuninger

You're right, it's working. I took your urls and carefully recreated mine and both worked. I'm working on a private repo so I can't share exact links but those are the formats that worked:

devpod://[email protected]:my-org/my-repo.git&workspace=my-workspace&provider=docker&ide=vscode
https://devpod.sh/open#[email protected]:my-org/my-repo.git&workspace=my-workspace&provider=docker&ide=vscode

I'm not yet using the prebuild feature, but is there a parameter to pass this value into the urls as well?

Another thing I noticed, is that prefilling the workspace input with the above urls works as long as devpod is already running. When devpod is not running, then the links will open devpod to the workspaces list section in the app, but not to the prefilled create workspace page.

@pascalbreuninger
Copy link
Member

@martinbiard

I'm not yet using the prebuild feature, but is there a parameter to pass this value into the urls as well?

Not a URL parameter but it's available as a customization in the devcontainer.json

"customizations": {
  "devpod": {
      "prebuildRepository": "ghcr.io/my-org/my-repo"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants