Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "Robusta KRR Dev",
"image": "mcr.microsoft.com/devcontainers/python:3.10",
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": false
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.debugpy",
"GitHub.copilot",
"GitHub.copilot-chat",
Comment on lines +15 to +16
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor: copilot-chat may assume unnecessary licensing.

Line 15–16 includes GitHub.copilot-chat along with GitHub.copilot. This assumes all developers have Copilot licenses. Consider removing copilot-chat or making it optional via a comment.

🤖 Prompt for AI Agents
.devcontainer/devcontainer.json lines 15-16: the devcontainer currently lists
"GitHub.copilot-chat" alongside "GitHub.copilot", which presumes all developers
have the Copilot Chat license; remove "GitHub.copilot-chat" from the extensions
array or comment it out / add a note to make it optional so the devcontainer
doesn't force a licensed extension on every developer.

"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"Orta.vscode-jest",
Comment on lines +18 to +19
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor: ESLint and Jest extensions are not aligned with a Python project.

Lines 18–19 include dbaeumer.vscode-eslint and Orta.vscode-jest, which are JavaScript/TypeScript tooling. For a Python project, consider removing these unless the project explicitly includes JavaScript/TypeScript components.

       "EditorConfig.EditorConfig",
-      "dbaeumer.vscode-eslint",
-      "Orta.vscode-jest",
       "eamodio.gitlens"
📝 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
"dbaeumer.vscode-eslint",
"Orta.vscode-jest",
🤖 Prompt for AI Agents
.devcontainer/devcontainer.json around lines 18 to 19: the devcontainer lists
JavaScript/TypeScript extensions ("dbaeumer.vscode-eslint" and
"Orta.vscode-jest") that don't match a Python project; remove these two entries
from the extensions array (or replace them with Python-relevant extensions like
ms-python.python) so the devcontainer only installs tooling appropriate for the
repository.

"eamodio.gitlens"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.analysis.typeCheckingMode": "basic"
}
}
},
"remoteUser": "root",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Major: Avoid running as root in development containers.

Running the container as root is a security anti-pattern and may not align with the project's development practices. Consider using a non-root user (e.g., vscode or developer). The base image mcr.microsoft.com/devcontainers/python:3.10 includes a vscode user by default.

- "remoteUser": "root",
+ "remoteUser": "vscode",
📝 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
"remoteUser": "root",
"remoteUser": "vscode",
🤖 Prompt for AI Agents
.devcontainer/devcontainer.json around line 28: the container is configured to
run as "root", which is a security anti-pattern; change "remoteUser" to a
non-root user provided by the base image (e.g., "vscode" or "developer") and
ensure any filesystem permissions or startup commands are adjusted accordingly
(update postCreateCommand or Dockerfile steps to chown workspace folders or
install tools for that user if needed) so the container runs as the non-root
user without breaking mounts or setup scripts.

"hostRequirements": {
"cpus": 2,
"memory": "2gb"
},
"initializeCommand": "rm -rf build && rm -rf dist",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: initializeCommand runs on host machine and could delete build/dist directories.

The initializeCommand runs on the host before the container is spun up. Deleting build and dist from the host is destructive and unintended. Move this cleanup into postCreateCommand (inside the container) if needed, or remove it entirely.

- "initializeCommand": "rm -rf build && rm -rf dist",
+ "postCreateCommand": "set -e && apt-get update && apt-get install -y build-essential zip binutils && pip install poetry && poetry install && rm -rf build && rm -rf dist",
📝 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
"initializeCommand": "rm -rf build && rm -rf dist",
"postCreateCommand": "set -e && apt-get update && apt-get install -y build-essential zip binutils && pip install poetry && poetry install && rm -rf build && rm -rf dist",
🤖 Prompt for AI Agents
.devcontainer/devcontainer.json around line 33: the initializeCommand currently
runs on the host and performs destructive rm -rf build && rm -rf dist; move this
cleanup into postCreateCommand (which runs inside the container) or remove it
entirely to avoid deleting host files. Replace or remove the initializeCommand
entry and add a postCreateCommand that performs the cleanup inside the container
(or omit cleanup) so host directories are not affected.

"postCreateCommand": "apt-get update && apt-get install -y build-essential zip binutils && pip install 'urllib3<2' && pip install -r requirements.txt && pip install poetry && poetry install",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Don't mix pip and poetry for dependency management.

Running both pip install -r requirements.txt and poetry install creates redundant and conflicting dependency resolution. Poetry should be the single source of truth. Remove the pip install -r requirements.txt line if using poetry.

If requirements.txt is needed for non-poetry workflows (e.g., CI/CD), consider using poetry export to generate it from poetry.lock rather than maintaining both manually.

🤖 Prompt for AI Agents
.devcontainer/devcontainer.json around line 34: the postCreateCommand mixes pip
and Poetry by running "pip install -r requirements.txt" and then "poetry
install", causing redundant/conflicting dependency management; remove the "pip
install -r requirements.txt" step so Poetry is the single source of truth for
dependencies, and if a requirements.txt is still needed for other workflows,
replace the manual file with a generated one via "poetry export" during CI or
devcontainer setup.

⚠️ Potential issue | 🟠 Major

Major: Add error handling to postCreateCommand chain.

The long command chain has no error handling. If any step fails (e.g., apt-get update times out), subsequent steps still execute, potentially leaving the container in an inconsistent state. Use set -e or ensure proper && chaining.

- "postCreateCommand": "apt-get update && apt-get install -y build-essential zip binutils && pip install 'urllib3<2' && pip install -r requirements.txt && pip install poetry && poetry install",
+ "postCreateCommand": "set -e && apt-get update && apt-get install -y build-essential zip binutils && pip install poetry && poetry install",
📝 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
"postCreateCommand": "apt-get update && apt-get install -y build-essential zip binutils && pip install 'urllib3<2' && pip install -r requirements.txt && pip install poetry && poetry install",
"postCreateCommand": "set -e && apt-get update && apt-get install -y build-essential zip binutils && pip install 'urllib3<2' && pip install -r requirements.txt && pip install poetry && poetry install",
🤖 Prompt for AI Agents
.devcontainer/devcontainer.json lines 34-34: the postCreateCommand string runs
multiple steps without robust shell error handling; update it to ensure the
shell exits immediately on any failure (e.g., enable set -e and safer flags like
-u and pipefail) so later steps won't run after an earlier failure—wrap or
invoke the command in a shell that sets -euo pipefail (or at minimum set -e)
before executing the existing chain, so failures abort the entire post-create
sequence.

"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
]
}