From eb3a74b709c7efad43187685209926d1c634a7cf Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Thu, 25 Dec 2025 11:12:41 +0100 Subject: [PATCH 1/3] feat: Add devcontainer configuration and setup script for Gemini Agent --- .devcontainer/Dockerfile | 0 .devcontainer/devcontainer.json | 42 +++++++++++++++++++++++++++++++++ .devcontainer/setup.sh | 16 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/setup.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..e828c48 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +{ + "name": "Gemini Agent Quality Ops", + "build": { + "dockerfile": "Dockerfile" + }, + "features": { + "ghcr.io/devcontainers/features/python:1": { + "version": "3.11", + "installTools": true, + "optimize": true + }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/devcontainers-extra/features/pipx-package:1": { + "packages": "pre-commit, ruff" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "esbenp.prettier-vscode", + "vitest.explorer", + "google.gemini-cli-vscode-ide-companion", + "google.geminicodeassist" + ], + "settings": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + } + } + }, + "postCreateCommand": "npm install", + "postStartCommand": "bash .devcontainer/setup.sh", + "remoteUser": "node", + "mounts": [ + "source=pipx-venvs,target=/home/node/.local/share/pipx,type=volume", + "source=pipx-bin,target=/home/node/.local/bin,type=volume", + "source=pre-commit-cache,target=/home/node/.cache/pre-commit,type=volume", + "source=${localEnv:HOME}/.gemini,target=/home/node/.gemini,type=bind" + ] +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100644 index 0000000..0423fb9 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# 1. Fix Git Permissions (Critical in Docker) +sudo chown -R $(whoami) .git +git config --global --add safe.directory $(pwd) + +# 2. Re-connect Git Hooks +# 'pre-commit install' is idempotent (it checks if the hook exists and exits fast). +# It's safe to run on every start. +if command -v pre-commit &> /dev/null; then + pre-commit install +else + echo "⚠️ Warning: pre-commit not found. Skipping hook installation." +fi + +# We REMOVED 'npm install' from here to speed up your daily workflow. -- 2.49.1 From 4c12baef2844ad4954981a32f55dc4591cd2717c Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Fri, 26 Dec 2025 01:17:16 +0100 Subject: [PATCH 2/3] feat: Update devcontainer setup with Dockerfile and improved script for pre-commit hooks --- .devcontainer/Dockerfile | 7 +++++++ .devcontainer/devcontainer.json | 10 ++++------ .devcontainer/setup.sh | 5 ----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e69de29..d696268 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -0,0 +1,7 @@ +# .devcontainer/Dockerfile +FROM mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye + +# CACHED INSTALLATION: +# Install global NPM packages here. This creates a cached Docker layer. +# We use 'su node' to ensure permissions are correct for the non-root user. +RUN su node -c "npm install -g @google/gemini-cli" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e828c48..5c86713 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,9 +11,7 @@ }, "ghcr.io/devcontainers/features/git:1": {}, "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/devcontainers-extra/features/pipx-package:1": { - "packages": "pre-commit, ruff" - } + "ghcr.io/devcontainers-extra/features/pre-commit:2": {} }, "customizations": { "vscode": { @@ -30,13 +28,13 @@ } } }, - "postCreateCommand": "npm install", "postStartCommand": "bash .devcontainer/setup.sh", - "remoteUser": "node", + "remoteUser": "vscode", + "updateRemoteUserUID": true, "mounts": [ "source=pipx-venvs,target=/home/node/.local/share/pipx,type=volume", "source=pipx-bin,target=/home/node/.local/bin,type=volume", "source=pre-commit-cache,target=/home/node/.cache/pre-commit,type=volume", - "source=${localEnv:HOME}/.gemini,target=/home/node/.gemini,type=bind" + "source=${localEnv:USERPROFILE}/.gemini,target=/home/node/.gemini,type=bind" ] } diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 0423fb9..acbcfc5 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -1,16 +1,11 @@ #!/bin/bash # 1. Fix Git Permissions (Critical in Docker) -sudo chown -R $(whoami) .git git config --global --add safe.directory $(pwd) # 2. Re-connect Git Hooks -# 'pre-commit install' is idempotent (it checks if the hook exists and exits fast). -# It's safe to run on every start. if command -v pre-commit &> /dev/null; then pre-commit install else echo "⚠️ Warning: pre-commit not found. Skipping hook installation." fi - -# We REMOVED 'npm install' from here to speed up your daily workflow. -- 2.49.1 From 8433c795600fa0a7ba98fed17c75dd66b2c39734 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Fri, 26 Dec 2025 23:35:21 +0000 Subject: [PATCH 3/3] chore: update devcontainer setup and pre-commit configuration --- .devcontainer/Dockerfile | 7 --- .devcontainer/devcontainer.json | 21 +++---- .devcontainer/setup.sh | 10 +-- .pre-commit-config.yaml | 105 +++++++++++++++----------------- 4 files changed, 62 insertions(+), 81 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index d696268..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -# .devcontainer/Dockerfile -FROM mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye - -# CACHED INSTALLATION: -# Install global NPM packages here. This creates a cached Docker layer. -# We use 'su node' to ensure permissions are correct for the non-root user. -RUN su node -c "npm install -g @google/gemini-cli" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5c86713..2cbbbf2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,13 @@ { - "name": "Gemini Agent Quality Ops", - "build": { - "dockerfile": "Dockerfile" - }, + "name": "JS Dev Container", + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-20", "features": { - "ghcr.io/devcontainers/features/python:1": { - "version": "3.11", - "installTools": true, - "optimize": true - }, "ghcr.io/devcontainers/features/git:1": {}, "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/devcontainers-extra/features/pre-commit:2": {} + "ghcr.io/devcontainers-extra/features/pre-commit:2": {}, + "ghcr.io/devcontainers-extra/features/npm-packages:1": { + "packages": "@google/gemini-cli" + } }, "customizations": { "vscode": { @@ -29,12 +25,13 @@ } }, "postStartCommand": "bash .devcontainer/setup.sh", - "remoteUser": "vscode", + "remoteUser": "node", "updateRemoteUserUID": true, "mounts": [ "source=pipx-venvs,target=/home/node/.local/share/pipx,type=volume", "source=pipx-bin,target=/home/node/.local/bin,type=volume", "source=pre-commit-cache,target=/home/node/.cache/pre-commit,type=volume", - "source=${localEnv:USERPROFILE}/.gemini,target=/home/node/.gemini,type=bind" + "source=${localEnv:USERPROFILE}/.gemini,target=/home/node/.gemini,type=bind", + "source=gvscode-extensions,target=/home/node/.cache/google-vscode-extension,type=volume" ] } diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index acbcfc5..61d9d72 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -3,9 +3,9 @@ # 1. Fix Git Permissions (Critical in Docker) git config --global --add safe.directory $(pwd) +# In your setup.sh or postCreateCommand +sudo chown -R node:node /home/node/.cache/ + # 2. Re-connect Git Hooks -if command -v pre-commit &> /dev/null; then - pre-commit install -else - echo "⚠️ Warning: pre-commit not found. Skipping hook installation." -fi +pre-commit install +pre-commit install-hooks diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d9ba9c9..e0ec95a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,57 +1,48 @@ -exclude: ^node_modules/ -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: end-of-file-fixer - exclude: (.txt$|.ipynb$|README.md$|readme.mde$) - - id: trailing-whitespace - exclude: (.txt$|README.md$) - - id: check-yaml - - id: check-json - - id: check-toml - - id: check-xml - - id: check-added-large-files - args: [--enforce-all] - - id: name-tests-test - - id: detect-private-key - - id: check-case-conflict - - id: check-symlinks - - id: check-docstring-first - - id: pretty-format-json - args: [--autofix, --no-sort-keys, --no-ensure-ascii] - - id: check-merge-conflict - - id: no-commit-to-branch - args: [--branch, main] - -- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.15.0 - hooks: - - id: pretty-format-ini - args: [--autofix] - - id: pretty-format-toml - args: [--autofix] - - id: pretty-format-yaml - args: [--autofix] - -- repo: https://github.com/frnmst/md-toc - rev: 9.0.0 - hooks: - - id: md-toc - -- repo: https://github.com/Lucas-C/pre-commit-hooks-java - rev: 1.3.10 - hooks: - - id: validate-html - -- repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier - types_or: [css, javascript] - -- repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.36.0 - hooks: - - id: check-renovate - - id: check-github-actions +exclude: ^node_modules/ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: end-of-file-fixer + exclude: (.txt$|.ipynb$|README.md$|readme.mde$) + - id: trailing-whitespace + exclude: (.txt$|README.md$) + - id: check-yaml + - id: check-json + - id: check-toml + - id: check-xml + - id: check-added-large-files + args: [--enforce-all] + - id: name-tests-test + - id: detect-private-key + - id: check-case-conflict + - id: check-symlinks + - id: check-docstring-first + - id: pretty-format-json + args: [--autofix, --no-sort-keys, --no-ensure-ascii] + - id: check-merge-conflict + - id: no-commit-to-branch + args: [--branch, main] + +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.15.0 + hooks: + - id: pretty-format-ini + args: [--autofix] + - id: pretty-format-toml + args: [--autofix] + - id: pretty-format-yaml + args: [--autofix] + +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + types_or: [css, javascript] + +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.36.0 + hooks: + - id: check-renovate + - id: check-github-actions + - id: check-github-workflows -- 2.49.1