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

Enable devcontainers in repo. #6491

Merged
merged 16 commits into from
Oct 29, 2024
Merged

Enable devcontainers in repo. #6491

merged 16 commits into from
Oct 29, 2024

Conversation

mitchdenny
Copy link
Member

@mitchdenny mitchdenny commented Oct 25, 2024

Description

This is an initial PR to enable devcontainer support in the repo. The goal is to enable the various remote development scenarios (Codespaces, SSH, etc) so that we can test them. This is important because we've added logic to the apphost that can do things like detect it is running in Codespaces and using the Aspire repo under Codespaces is a good way of casually validating everything is working.

image

Outstanding issues

  • Dashboard URL shows as localhost:port/login?t=; whilst Codespaces will automatically remap that URL for us when we click on it, the redirect flow (GitHub auth) looses the token in the URL

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
      • Link to aspire-docs issue:
    • No
Microsoft Reviewers: Open in CodeFlow

@mitchdenny
Copy link
Member Author

Couple of gotchas. For forwarded ports, it can take some time for Codespaces to generate the TLS cert for the endpoint. You just have to be patient. Part of explicitly forwarding the ports in the .devcontainer.json file is to make sure that its mapped as HTTPS or HTTP as appropriate.

@mitchdenny mitchdenny marked this pull request as ready for review October 28, 2024 00:04
.devcontainer/devcontainer.json Show resolved Hide resolved
src/Aspire.Hosting/Codespaces/CodespacesOptions.cs Outdated Show resolved Hide resolved
src/Aspire.Hosting/Codespaces/CodespacesOptions.cs Outdated Show resolved Hide resolved
src/Aspire.Hosting/Codespaces/CodespacesOptions.cs Outdated Show resolved Hide resolved
src/Aspire.Hosting/Codespaces/CodespacesOptions.cs Outdated Show resolved Hide resolved
src/Aspire.Hosting/Codespaces/CodespacesOptions.cs Outdated Show resolved Hide resolved
@davidfowl
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mitchdenny mitchdenny enabled auto-merge (squash) October 29, 2024 05:18
@mitchdenny mitchdenny merged commit 9336436 into main Oct 29, 2024
9 checks passed
@mitchdenny mitchdenny deleted the mitchdenny/devcontainer branch October 29, 2024 06:22
@davidfowl
Copy link
Member

@mitchdenny one place where we don't detect the codespace and print the right url is here:

image

We should change this too.

@mitchdenny
Copy link
Member Author

Yeah I was looking at this I made some tweaks last night as an experiment. I can put up a PR.

@davidfowl
Copy link
Member

Also it seems like only certain playground examples work?

@paule96 paule96 mentioned this pull request Oct 30, 2024
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.

4 participants