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

Add generic guide to setup devcontainer environment #2227

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mib1185
Copy link
Contributor

@mib1185 mib1185 commented Jun 21, 2024

Proposed change

This adds a more generic guide to set up a development environment ready to use for devcontainers.

Type of change

  • Document existing features within Home Assistant
  • Document new or changing features which there is an existing pull request elsewhere
  • Spelling or grammatical corrections, or rewording for improved clarity
  • Changes to the backend of this documentation
  • Removed stale or deprecated documentation

Additional information

  • This PR fixes or closes issue: fixes #
  • Link to relevant existing code or pull request:

Summary by CodeRabbit

  • Documentation
    • Updated development environment setup instructions to reference the new comprehensive guide.
    • Added a detailed guide for setting up a development environment using Visual Studio Code with devcontainers for Windows, Linux, and macOS.
    • Enhanced Supervisor development instructions to include the new development environment setup guide.
    • Updated the Overview section in the documentation to include the new development environment setup guide.

Copy link
Contributor

coderabbitai bot commented Jun 21, 2024

Walkthrough

Walkthrough

The overall change updates the Home Assistant development documentation to introduce a comprehensive guide for establishing a development environment using Visual Studio Code with devcontainers. This new guide replaces previous instructions, providing streamlined setup processes tailored for Windows, Linux, and macOS users, thus enhancing accessibility and efficiency for developers.

Changes

File Change Summary
docs/development_environment.mdx Updated to reference the new guide for setting up a development environment using devcontainers.
docs/frontend/development.md Added a directive to follow the new setup guide before proceeding with frontend code setup.
docs/supervisor/development.md Enhanced instructions to include a reference to the new development environment guide.
docs/setup_devcontainer_environment.mdx Introduced a comprehensive guide for setting up a Visual Studio Code devcontainer environment across multiple OSes.
sidebars.js Added the new "setup_devcontainer_environment" entry to the Overview section for improved navigation.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

docs/frontend/development.md Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/supervisor/development.md Show resolved Hide resolved
docs/development_environment.mdx Show resolved Hide resolved
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Some comments, should this also cover codespaces?

As in, that would be a single-click quick environment to get started with all of this?

../Frenck

docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
mib1185 and others added 2 commits June 22, 2024 17:01
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
@mib1185
Copy link
Contributor Author

mib1185 commented Jun 22, 2024

should this also cover codespaces?

I'm not sure if i get this question correct - Codespaces will do all this steps for you, so you get a "on-click ready to use dev-env" with Codespaces (as you already mention), but the other way around, this guide here does not cover Codespaces

@mib1185 mib1185 requested a review from frenck June 22, 2024 15:15
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

docs/setup_devcontainer_environment.mdx Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@mib1185 mib1185 requested a review from epenet July 5, 2024 14:07
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
docs/setup_devcontainer_environment.mdx Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@mib1185 mib1185 marked this pull request as draft July 21, 2024 17:57
@mib1185 mib1185 marked this pull request as ready for review July 21, 2024 17:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Outside diff range, codebase verification and nitpick comments (1)
docs/setup_devcontainer_environment.mdx (1)

127-127: Consider adding a hyphen for clarity.

Consider adding a hyphen to improve clarity.

- Visual Studio Code will automatically detect the devcontainer and prompt to "Reopen in Container" (_bottom right corner_) - click on it.
+ Visual Studio Code will automatically detect the devcontainer and prompt to "Reopen in Container" (_bottom-right corner_) - click on it.
Tools
LanguageTool

[uncategorized] ~127-~127: Consider adding a hyphen.
Context: ...r and prompt to "Reopen in Container" (bottom right corner) - click on it. <p class='i...

(TOP_LEFT_CORNER)


Since the installation steps are well documented and may change over time, we refer to the official [Install Docker Desktop on Mac](https://docs.docker.com/desktop/install/mac-install/) guide.

## Fork the repository and start the devcontainer
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct typographical and grammatical issues.

Ensure clarity in instructions about starting the devcontainer.

- ## Fork the repository and start the devcontainer
+ ## Fork the repository and start the devcontainer.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Fork the repository and start the devcontainer
## Fork the repository and start the devcontainer.

title: "Setting Up a Devcontainer Development Environment"
---

The easiest way to get started with development is to use Visual Studio Code with [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers). This approach creates a preconfigured development environment with the necessary tools, and is enabled for all Home Assistant repositories. Since the Docker-based devcontainer concept provides a layer of abstraction, the following guides merge at one point.
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve sentence structure for clarity.

The sentence structure could be improved for clarity.

- Since the Docker-based devcontainer concept provides a layer of abstraction, the following guides merge at one point.
+ Since the Docker-based devcontainer concept provides a layer of abstraction, the following guides converge at a certain point.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The easiest way to get started with development is to use Visual Studio Code with [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers). This approach creates a preconfigured development environment with the necessary tools, and is enabled for all Home Assistant repositories. Since the Docker-based devcontainer concept provides a layer of abstraction, the following guides merge at one point.
The easiest way to get started with development is to use Visual Studio Code with [devcontainers](https://code.visualstudio.com/docs/devcontainers/containers). This approach creates a preconfigured development environment with the necessary tools, and is enabled for all Home Assistant repositories. Since the Docker-based devcontainer concept provides a layer of abstraction, the following guides converge at a certain point.


Since this slightly differs between our code repositories, the following is a generic guide.

1. Open the desired code repository on GitHub (_for example, the [Home Assistant Core repository](https://github.com/home-assistant/core)_), and click on "fork".
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify the instruction for forking the repository.

Clarify the instruction for forking the repository on GitHub.

- 1. Open the desired code repository on GitHub (_for example, the [Home Assistant Core repository](https://github.com/home-assistant/core)_), and click on "fork".
+ 1. Open the desired code repository on GitHub (_for example, the [Home Assistant Core repository](https://github.com/home-assistant/core)_), and click on **Fork**.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Open the desired code repository on GitHub (_for example, the [Home Assistant Core repository](https://github.com/home-assistant/core)_), and click on "fork".
1. Open the desired code repository on GitHub (_for example, the [Home Assistant Core repository](https://github.com/home-assistant/core)_), and click on **Fork**.


### Enable systemd support in WSL2

Since the Docker engine is installed as systemd service, we need to ensure systemd support is enabled in the WSL2.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure clarity in instructions about enabling systemd support.

The instruction about ensuring systemd support is enabled in WSL2 could be more explicit. It's crucial for users to understand why this step is necessary.

- Since the Docker engine is installed as systemd service, we need to ensure systemd support is enabled in the WSL2.
+ Since the Docker engine requires systemd to function properly and is installed as a systemd service, it is crucial to enable systemd support in WSL2.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Since the Docker engine is installed as systemd service, we need to ensure systemd support is enabled in the WSL2.
Since the Docker engine requires systemd to function properly and is installed as a systemd service, it is crucial to enable systemd support in WSL2.
Tools
LanguageTool

[uncategorized] ~45-~45: You might be missing the article “a” here.
Context: ...Since the Docker engine is installed as systemd service, we need to ensure systemd supp...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


### Install WSL2

This section outlines the steps for Windows 10 (_version 2004 and later_) and Windows 11. If you're still running an older version, follow these [manual installation steps](https://learn.microsoft.com/en-us/windows/wsl/install-manual).
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify Windows version requirements.

The phrase "based on Windows 10 version 2004 and higher or Windows 11" might confuse readers about the exact requirements. Clarifying that it applies to Windows 10 (version 2004 and later) and all versions of Windows 11 could improve understanding.

- This section outlines the steps for Windows 10 (_version 2004 and later_) and Windows 11. If you're still running an older version, follow these [manual installation steps](https://learn.microsoft.com/en-us/windows/wsl/install-manual).
+ This section outlines the steps for Windows 10 (version 2004 and later) and Windows 11. If you're still running an older version, follow these [manual installation steps](https://learn.microsoft.com/en-us/windows/wsl/install-manual).

Committable suggestion was skipped due to low confidence.

```


### Follow "Setup on Linux"
Copy link
Contributor

Choose a reason for hiding this comment

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

Capitalize "Linux" in the section title.

The phrase "Follow 'Setup on linux'" should have "Linux" capitalized as it is a proper noun.

- ### Follow "Setup on linux"
+ ### Follow "Setup on Linux"
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Follow "Setup on Linux"
### Follow "Setup on Linux"

Comment on lines +2 to +3
title: "Setting Up a Devcontainer Development Environment"
---
Copy link
Contributor

Choose a reason for hiding this comment

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

Update document title for clarity and consistency.

Consider using a more descriptive and consistent title format. The current title could be enhanced to align with common documentation practices.

- title: "Setting Up a Devcontainer Development Environment"
+ title: "Setting Up the Devcontainer Development Environment"
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
title: "Setting Up a Devcontainer Development Environment"
---
title: "Setting Up the Devcontainer Development Environment"
---


### Install Docker Desktop

Since the installation steps are well documented and may change over time, we refer to the official [Install Docker Desktop on Mac](https://docs.docker.com/desktop/install/mac-install/) guide.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure consistency in referring to the official guide.

Ensure consistency in referring to the official guide for installing Docker Desktop on macOS.

- Since the installation steps are well documented and may change over time, we refer to the official [Install Docker Desktop on Mac](https://docs.docker.com/desktop/install/mac-install/) guide.
+ Since the installation steps are well documented and may change over time, refer to the official [Install Docker Desktop on Mac](https://docs.docker.com/desktop/install/mac-install/) guide.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Since the installation steps are well documented and may change over time, we refer to the official [Install Docker Desktop on Mac](https://docs.docker.com/desktop/install/mac-install/) guide.
Since the installation steps are well documented and may change over time, refer to the official [Install Docker Desktop on Mac](https://docs.docker.com/desktop/install/mac-install/) guide.

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.

3 participants