Skip to content

Support multiple deployments #222

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

Merged
merged 8 commits into from
Apr 18, 2023
Merged

Support multiple deployments #222

merged 8 commits into from
Apr 18, 2023

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Apr 14, 2023

This takes inspiration from the VS Code extension (use a prefix and write to the config file directly from the plugin).

I could see an argument being made that this functionality should really be in the Coder CLI itself but since the VS Code plugin already takes this route I went the same. I am open to doing it the other way though.

I tested connecting manually on Linux and Windows.

@code-asher code-asher force-pushed the always-configure branch 4 times, most recently from 7c484d8 to 429e7a4 Compare April 14, 2023 18:57
Mostly trying to reduce the direct uses of the local model in favor of
passing in arguments so they will be easier to test (specifically
askToken is pure now).

Mention use of the local model in the functions where that is the case
and where they use the model I use it for all things (rather than just
the URL but pass in the token for example) since everything we need is
already in the model.

Also rename/suffix some functions to/with connect to match the button.

Remove the progress updates to the indicator since they are
indeterminate.
This also lets us set a custom environment variable to track JetBrains
sessions.
Currently if you launch the Coder plugin from Gateway and it
automatically picks up a token from the config or from your last launch
but it is invalid it will open a browser window for a new token which I
think could be jarring.  We should only open a browser window when the
user explicitly wants that by pressing connect for example.
Wide enough to see the whole token at once.
@code-asher code-asher marked this pull request as ready for review April 14, 2023 19:57
@code-asher code-asher requested a review from johnstcn April 14, 2023 19:57
Also add trailing newline when appending to file.  Just a bit nicer, for
example when you cat the file.

If we are replacing a block at the end and there is no newline then we
will preserve that; no newlines are added when replacing.
Comment on lines +353 to +365
workspaces | input | output | remove
["foo", "bar"] | null | "multiple-workspaces" | "blank"
["foo-bar"] | "blank" | "append-blank" | "blank"
["foo-bar"] | "blank-newlines" | "append-blank-newlines" | "blank"
["foo-bar"] | "existing-end" | "replace-end" | "no-blocks"
["foo-bar"] | "existing-end-no-newline" | "replace-end-no-newline" | "no-blocks"
["foo-bar"] | "existing-middle" | "replace-middle" | "no-blocks"
["foo-bar"] | "existing-middle-and-unrelated" | "replace-middle-ignore-unrelated" | "no-related-blocks"
["foo-bar"] | "existing-only" | "replace-only" | "blank"
["foo-bar"] | "existing-start" | "replace-start" | "no-blocks"
["foo-bar"] | "no-blocks" | "append-no-blocks" | "no-blocks"
["foo-bar"] | "no-related-blocks" | "append-no-related-blocks" | "no-related-blocks"
["foo-bar"] | "no-newline" | "append-no-newline" | "no-blocks"
Copy link
Member

Choose a reason for hiding this comment

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

❤️ 👨‍🍳 🤌

@code-asher code-asher merged commit 077f903 into main Apr 18, 2023
@code-asher code-asher deleted the always-configure branch April 18, 2023 19:42
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

Successfully merging this pull request may close these issues.

Add session type env var to SSH sessions Support multiple deployments
2 participants