Skip to content

Conversation

@raman325
Copy link
Owner

@raman325 raman325 commented Jan 2, 2026

Proposed change

  • Refresh devcontainer setup and local tooling configs (VS Code settings/tasks, setup scripts, and supporting config updates).

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:

Copilot AI review requested due to automatic review settings January 2, 2026 06:37
@github-actions github-actions bot added code-quality Pull requests that improve code quality javascript Pull requests that update javascript code labels Jan 2, 2026
@raman325 raman325 marked this pull request as draft January 2, 2026 06:39
Copy link
Contributor

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 modernizes the development environment setup by transitioning from system-wide Python package installation to a dedicated virtual environment approach, improving isolation and maintainability. The changes enhance the devcontainer configuration, update VS Code tooling settings, and refine build configurations.

Key changes:

  • Migrated from system Python to venv-based development with smart dependency caching via hash-based stamp files
  • Added automated installation of Home Assistant base component dependencies
  • Replaced symlinks with file copying for YAML configs to ensure volume-mount compatibility

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/setup-devcontainer Implemented venv-based setup with requirement hash caching, dynamic HA component dependency resolution, and YAML file copying
scripts/setup Updated to use file copying instead of symlinking for YAML configs, matching devcontainer approach
rollup.config.js Configured Babel to target ES modules, avoiding class transpilation issues
AGENTS.md Added documentation about TypeScript rebuild requirements
.vscode/tasks.json Added task to run Home Assistant using the venv Python interpreter
.vscode/settings.json Configured default Python interpreter to use venv path
.vscode/launch.json Updated debugger configuration to use venv Python interpreter
.devcontainer/devcontainer.json Switched to Python base image, added Claude and Rust features, and added postStartCommand

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"args": ["--debug", "--config", "${workspaceFolder}/.ha"],
"cwd": "${workspaceFolder}/.ha",
"python": "${workspaceFolder}/.ha/venv/bin/python",
"pythonPath": "${workspaceFolder}/.ha/venv/bin/python",
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Both 'python' and 'pythonPath' are specified with the same value. The 'pythonPath' property is deprecated in favor of 'python' in recent versions of the Python debugger extension. Consider removing the 'pythonPath' line to avoid redundancy and use the modern property only.

Suggested change
"pythonPath": "${workspaceFolder}/.ha/venv/bin/python",

Copilot uses AI. Check for mistakes.
"version": "3.13",
"installTools": false
}
"ghcr.io/devcontainers/features/rust:1": {}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The Rust feature is added but there's no evidence of Rust code in the repository (no Cargo.toml or .rs files). While Rust might be needed to build certain Python packages with native extensions, or for the uv tool itself (which is written in Rust), uv is typically distributed as a prebuilt binary and doesn't require Rust at runtime. Consider whether this feature is actually needed, as it adds unnecessary dependencies to the development container.

Copilot uses AI. Check for mistakes.

source "${VENV_PATH}/bin/activate"
if [ ! -f "${STAMP_FILE}" ] || [ "$(cat "${STAMP_FILE}")" != "${REQ_HASH}" ]; then
python -m pip install --upgrade pip "uv==0.9.6"
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The version of uv is pinned to 0.9.6 here, but requirements_dev.txt specifies uv without a version constraint. This creates an inconsistency - if requirements_dev.txt is updated to require a different version of uv, this hardcoded pin will prevent that update. Consider removing the version pin here and letting requirements_dev.txt control the uv version.

Suggested change
python -m pip install --upgrade pip "uv==0.9.6"
python -m pip install --upgrade pip uv

Copilot uses AI. Check for mistakes.
Comment on lines 62 to 67
python -m pip install --upgrade pip "uv==0.9.6"
uv pip install -r requirements_dev.txt
echo "${REQ_HASH}" > "${STAMP_FILE}"
fi

python - <<'PY'
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

This Python script uses 'python' instead of 'python3'. While it should work because the venv is activated at line 60, using 'python3' would be more consistent with the rest of the script (lines 11, 21) and more explicit about the Python version being used.

Suggested change
python -m pip install --upgrade pip "uv==0.9.6"
uv pip install -r requirements_dev.txt
echo "${REQ_HASH}" > "${STAMP_FILE}"
fi
python - <<'PY'
python3 -m pip install --upgrade pip "uv==0.9.6"
uv pip install -r requirements_dev.txt
echo "${REQ_HASH}" > "${STAMP_FILE}"
fi
python3 - <<'PY'

Copilot uses AI. Check for mistakes.
"PIP_BREAK_SYSTEM_PACKAGES": "1"
},
"postCreateCommand": "scripts/setup-devcontainer",
"postStartCommand": "scripts/setup-devcontainer",
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

Adding postStartCommand to run setup-devcontainer will execute this script every time the container starts, not just when it's created. This could lead to unnecessary reinstallation of dependencies and re-running of setup tasks on every container restart. The stamp file mechanism (lines 61-65 in setup-devcontainer) will help skip reinstalls when requirements haven't changed, but other operations like pre-commit install, yarn install, and file copying will still run. Consider whether this is the intended behavior or if postCreateCommand alone is sufficient.

Suggested change
"postStartCommand": "scripts/setup-devcontainer",

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added the documentation Documentation changes label Jan 15, 2026
@raman325 raman325 force-pushed the feature/devcontainer-updates branch from 96b1beb to b631069 Compare January 15, 2026 07:39
@github-actions github-actions bot removed the javascript Pull requests that update javascript code label Jan 15, 2026
@raman325 raman325 force-pushed the feature/devcontainer-updates branch 3 times, most recently from 11425d1 to 65663e9 Compare January 15, 2026 19:43
@raman325 raman325 force-pushed the feature/devcontainer-updates branch from 65663e9 to 3f10177 Compare January 20, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality Pull requests that improve code quality documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants