feat: Add initial Dev Container configuration for the Antigravity Doo…#3
Conversation
…D project, including various development tools, VS Code extensions, and post-create setup.
Summary of ChangesHello @Zalfsten, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new, specialized development container configuration for the 'Antigravity DooD' project, streamlining the setup of a consistent development environment with essential tools and VS Code extensions. Concurrently, it refines the existing general development container by updating its name and simplifying post-creation commands, enhancing clarity and maintainability across the project's dev container offerings. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new Dev Container configuration for the 'Antigravity DooD' project and refactors the existing one. The new configuration adds a wide range of development tools and extensions. My review has identified several critical issues that will prevent the new dev container from building successfully, including the use of invalid tool versions and an incompatible PPA on a Debian base image. Additionally, a critical issue was found in the postCreateCommand in both configurations that would lead to non-portable, hardcoded paths in the user's .bashrc. I've also included some suggestions for improvement, such as a more declarative way to install Python tools.
| "features": { | ||
| "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}, | ||
| "ghcr.io/devcontainers/features/git-lfs:1": { | ||
| "autoPull": true, | ||
| "installDirectlyFromGitHubRelease": true, | ||
| "version": "3.7.1" | ||
| }, | ||
| "ghcr.io/devcontainers/features/github-cli:1": { | ||
| "installDirectlyFromGitHubRelease": true, | ||
| "version": "2.82.1" | ||
| }, | ||
| "ghcr.io/devcontainers/features/python:1": { | ||
| "installTools": true, | ||
| "version": "3.12.12" | ||
| }, | ||
| "ghcr.io/eitsupi/devcontainer-features/jq-likes:2": { | ||
| "jqVersion": "1.8.1", | ||
| "yqVersion": "4.48.1", | ||
| "gojqVersion": "none", | ||
| "xqVersion": "0.4.1", | ||
| "jaqVersion": "none" | ||
| }, | ||
| "ghcr.io/dhoeric/features/hadolint:1": {}, | ||
| "ghcr.io/stuartleeks/dev-container-features/shell-history:0": {}, | ||
| "ghcr.io/lentzi90/features/yamlfmt:0": { | ||
| "version": "v0.14.0" | ||
| }, | ||
| "ghcr.io/va-h/devcontainers-features/difftastic:1": { | ||
| "version": "0.65.0" | ||
| }, | ||
| "ghcr.io/va-h/devcontainers-features/uv:1": { | ||
| "shellautocompletion": true, | ||
| "version": "0.9.5" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/actions-runner:1": { | ||
| "version": "latest", | ||
| "dotnetVersion": "latest" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/age:1": { | ||
| "version": "1.2.1" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/apt-packages:1": { | ||
| "clean_ppas": true, | ||
| "preserve_apt_list": true, | ||
| "packages": "curl,ca-certificates", | ||
| "ppas": "ppa:deadsnakes/ppa" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/curl-apt-get:1": {}, | ||
| "ghcr.io/devcontainers-extra/features/pre-commit:2": { | ||
| "version": "4.3.0" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/sops:1": { | ||
| "version": "3.11.0" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/starship:1": { | ||
| "version": "1.23.0" | ||
| }, | ||
| "ghcr.io/devcontainers-extra/features/wget-apt-get:1": {}, | ||
| "ghcr.io/jungaretti/features/vim:1": {}, | ||
| "ghcr.io/schlich/cst-devcontainer-feature/container-structure-test:1": { | ||
| "addAlias": true | ||
| }, | ||
| "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { | ||
| "version": "1.34.1", | ||
| "helm": "3.19.0", | ||
| "minikube": "1.37.0" | ||
| } |
There was a problem hiding this comment.
Several of the specified tool versions in the features section are invalid or do not exist, which will likely cause the dev container build to fail. It's recommended to use valid, existing versions for these tools. Using latest is also discouraged for reproducibility.
Here are some of the identified invalid versions:
git-lfs:3.7.1(latest is3.5.1)github-cli:2.82.1(latest is2.52.0)python:3.12.12(latest stable is3.12.3)jq:1.8.1(latest is1.7.1)yq:4.48.1(latest is4.44.2)difftastic:0.65.0(latest is0.59.0)uv:0.9.5(latest is0.2.19)age:1.2.1(latest stable is1.1.1)pre-commit:4.3.0(latest is3.7.1)sops:3.11.0(latest is3.8.1)starship:1.23.0(latest is1.19.0)kubectl:1.34.1(latest is1.30.1)helm:3.19.0(latest is3.15.2)minikube:1.37.0(latest is1.33.1)
For actions-runner, using version: "latest" can lead to non-reproducible builds. Please pin it to a specific version.
| // Load encrypted environment variables automatically (with error tolerance) | ||
| "postCreateCommand": { | ||
| "install ggshield": "sudo /usr/local/py-utils/bin/pipx install --global ggshield", | ||
| "setup bashrc": "grep -qF 'scripts/load-env.sh' ~/.bashrc || echo 'source ${containerWorkspaceFolder}/scripts/load-env.sh' >> ~/.bashrc" |
There was a problem hiding this comment.
This command has two issues:
- The
grepcheck is too broad and may result in false positives, preventing thesourcecommand from being added to.bashrcwhen it should be. - The
${containerWorkspaceFolder}variable will be expanded by the dev container runtime before the command is executed. This means a hardcoded path will be written to.bashrc, which defeats the purpose of using the variable for portability.
To fix this, you need to escape the dollar sign ($) to prevent variable expansion and make the grep check more specific.
"setup bashrc": "grep -qF 'source \${containerWorkspaceFolder}/scripts/load-env.sh' ~/.bashrc || echo 'source \${containerWorkspaceFolder}/scripts/load-env.sh' >> ~/.bashrc"| "grep -qF 'source /workspaces/m4.2_advanced_middleware_api/scripts/load-env.sh' /home/vscode/.bashrc || echo 'source /workspaces/m4.2_advanced_middleware_api/scripts/load-env.sh' >> /home/vscode/.bashrc" | ||
| ] | ||
| "install ggshield": "sudo /usr/local/py-utils/bin/pipx install --global ggshield", | ||
| "setup bashrc": "grep -qF 'scripts/load-env.sh' ~/.bashrc || echo 'source ${containerWorkspaceFolder}/scripts/load-env.sh' >> ~/.bashrc" |
There was a problem hiding this comment.
This command has two issues:
- The
grepcheck is too broad and may result in false positives, preventing thesourcecommand from being added to.bashrcwhen it should be. - The
${containerWorkspaceFolder}variable will be expanded by the dev container runtime before the command is executed. This means a hardcoded path will be written to.bashrc, which defeats the purpose of using the variable for portability.
To fix this, you need to escape the dollar sign ($) to prevent variable expansion and make the grep check more specific.
"setup bashrc": "grep -qF 'source \${containerWorkspaceFolder}/scripts/load-env.sh' ~/.bashrc || echo 'source \${containerWorkspaceFolder}/scripts/load-env.sh' >> ~/.bashrc"|
|
||
| // Load encrypted environment variables automatically (with error tolerance) | ||
| "postCreateCommand": { | ||
| "install ggshield": "sudo /usr/local/py-utils/bin/pipx install --global ggshield", |
There was a problem hiding this comment.
Instead of installing ggshield with a postCreateCommand, consider using the pipxPackages option within the python feature. This provides a more declarative and integrated way to manage Python tools in the dev container.
For example, you could modify your python feature configuration like this:
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "...", // Make sure to use a valid version
"pipxPackages": [
{
"name": "ggshield"
}
]
},After making this change, you can remove this install ggshield command.
| "-c", | ||
| "grep -qF 'source /workspaces/m4.2_advanced_middleware_api/scripts/load-env.sh' /home/vscode/.bashrc || echo 'source /workspaces/m4.2_advanced_middleware_api/scripts/load-env.sh' >> /home/vscode/.bashrc" | ||
| ] | ||
| "install ggshield": "sudo /usr/local/py-utils/bin/pipx install --global ggshield", |
There was a problem hiding this comment.
Instead of installing ggshield with a postCreateCommand, consider using the pipxPackages option within the python feature if it's available in this configuration. This provides a more declarative and integrated way to manage Python tools in the dev container.
For example, you could modify your python feature configuration like this:
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "...", // your python version
"pipxPackages": [
{
"name": "ggshield"
}
]
},After making this change, you can remove this install ggshield command.
…ge names and dependencies
…o/m4.2_sql_to_arc into feature/split_off_client
…D project, including various development tools, VS Code extensions, and post-create setup.