Skip to content

fix: specify --header-command when running coder start #526

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 4 commits into from
Jun 5, 2025

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Jun 2, 2025

Closes #499

The coder start command can't always work properly without specifying these args (eg., getting past proxies). This refactors the code a little to make it easier to get the right argument values, and passes them to coder start.

@aslilac aslilac requested a review from Copilot June 2, 2025 21:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the way header command arguments are handled when running the "coder start" command so that the necessary "--header-command" argument is always provided. Key changes include:

  • Adding a new helper function escapeCommandArg in util.ts for escaping command arguments.
  • Replacing getHeaderCommand with getHeaderArgs in remote.ts and updating the command formation.
  • Adjusting headers.ts and api.ts to support the new header arguments generation and propagation.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/util.ts Added escapeCommandArg for safely escaping command arguments.
src/remote.ts Updated header argument handling to use getHeaderArgs.
src/headers.ts Introduced getHeaderArgs to generate escaped header arguments.
src/api.ts Spread header arguments into the arguments list for coder start.

@bcpeinhardt
Copy link
Collaborator

bcpeinhardt commented Jun 3, 2025

@aslilac would you mind adding a note to the changelog as well?

CHANGELOG.md Outdated
@@ -12,6 +12,7 @@
- Multiple open instances of the extension could potentially clobber writes to
`~/.ssh/config`. Updates to this file are now atomic.
- Add support for `anysphere.remote-ssh` Remote SSH extension.
- Use `--header-command` properly when starting a workspace.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you meant to put this in the unreleased section!

Copy link
Member Author

Choose a reason for hiding this comment

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

it's dark and scary in here, I got lost 😭

@aslilac aslilac requested a review from bcpeinhardt June 3, 2025 21:16
@aslilac
Copy link
Member Author

aslilac commented Jun 3, 2025

gonna wait to merge this until tomorrow. we're talking with the customer this is for and gonna try to do some testing.

@aslilac aslilac merged commit d70a586 into main Jun 5, 2025
2 checks passed
@aslilac aslilac deleted the lilac/specify-header-command branch June 5, 2025 17:16
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.

Bug: When using AppProxy in Azure, headers are not passed
2 participants