Skip to content

Conversation

seantleonard
Copy link
Contributor

@seantleonard seantleonard commented Apr 2, 2024

Why this change?

Enhance the PR review experience in GitHub Codespaces. Currently, review productivity is hindered because the default Codespaces container only has .NET 8. (While there is work to add .net 8 to dab, this fix enables .net6 (current) compat in codespaces).

Pros:

  • Everything that is needed is pre-installed in container:
    • .NET 6 SDK -> allows you to "view definition" and other symbols with intellisense
    • C# Dev Kit VsCode extension -> view solution , run tests etc.
  • No need to update this file when DAB is updated to build against .NET 8.

Cons:

  • Slower to load CodeSpace because container needs to build (1-3 minutes), but once built, easy access for future PR iterations.

What is this change?

Actual experience

  1. When loading codespaces you'll see this container setup after selecting which codespace to create or reuse.
    image
  2. Auto install required extensions to make intellisense work:
    image
  3. Solution explorer works
    image
  4. Working intellisense!
    image

@seantleonard seantleonard added enhancement New feature or request usability Make the APIs more user friendly with better exceptions and removed do-not-merge labels Apr 3, 2024
@seantleonard seantleonard linked an issue Apr 3, 2024 that may be closed by this pull request
@seesharprun
Copy link

You can speed up the codespaces build by pre-building the devcontainer on the repository. This is a trick I often use with various https://github.com/azure-samples repos.

@seantleonard
Copy link
Contributor Author

seantleonard commented Apr 3, 2024

You can speed up the codespaces build by pre-building the devcontainer on the repository. This is a trick I often use with various https://github.com/azure-samples repos.

@seesharprun thank you for your suggestion! That seems like it will help tremendously. I'll take a look and make the appropriate modifications.

@seesharprun
Copy link

If you need to test the .NET tool locally, you will need to add the .NET tools directory to the PATH which is not automatically done in the SDK repos:

{
    ...,
    "remoteEnv": {
        "PATH": "${containerEnv:PATH}:/root/.dotnet/tools"
    }
}

Copy link
Collaborator

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for adding innovative ways of improving productivity!

@severussundar
Copy link
Contributor

Please add to the PR description the docs referenced for this change

Copy link
Contributor

@severussundar severussundar left a comment

Choose a reason for hiding this comment

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

Thanks for this addition, will definitely improve the code review experience! :)

@seantleonard
Copy link
Contributor Author

azp run

@seantleonard seantleonard enabled auto-merge (squash) April 22, 2024 16:55
@seantleonard
Copy link
Contributor Author

/azp run

@seantleonard seantleonard merged commit 441a56a into main Apr 23, 2024
@seantleonard seantleonard deleted the dev/sean/codespaces_config branch April 23, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request usability Make the APIs more user friendly with better exceptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add codespaces config for .NET 6 and .NET 8 for easier code review
4 participants