-
Notifications
You must be signed in to change notification settings - Fork 4
Add devcontainer configuration excluding rJava #97
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
base: main
Are you sure you want to change the base?
Conversation
- Use `mcr.microsoft.com/devcontainers/r:latest` as base image. - Exclude `rJava` from dependency installation to keep container Java-free. - Install Posit Air CLI and VS Code extension. - Install Quarto extension.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
=======================================
Coverage 86.80% 86.80%
=======================================
Files 20 20
Lines 1993 1993
=======================================
Hits 1730 1730
Misses 263 263 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 adds a devcontainer configuration to facilitate development and testing of the rJavaEnv package in an environment without Java pre-installed. This is valuable for testing the package's core functionality of downloading and installing Java.
Changes:
- Added devcontainer configuration using Microsoft's R devcontainer base image
- Created setup scripts to install Posit Air CLI and R dependencies while explicitly excluding rJava
- Configured VS Code extensions for R, Quarto, and Posit Air development
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.devcontainer/devcontainer.json |
Defines the devcontainer configuration with base image, VS Code extensions, and post-create command |
.devcontainer/setup.sh |
Bash script that installs Posit Air CLI and executes R dependency setup |
.devcontainer/setup.R |
R script that reads DESCRIPTION and installs all dependencies except rJava |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Install Posit Air CLI | ||
| echo "Installing Posit Air CLI..." | ||
| curl -LsSf https://github.com/posit-dev/air/releases/latest/download/air-installer.sh | sh |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup script should check if the Air CLI installation was successful before proceeding with R dependency installation. Consider adding a verification step after the curl command to ensure the installation didn't fail silently.
| # Get dependencies from DESCRIPTION in the current directory | ||
| deps <- remotes::dev_package_deps(dependencies = TRUE) | ||
|
|
||
| # Filter out rJava to ensure no Java is installed | ||
| packages_to_install <- deps$package[deps$package != "rJava"] | ||
|
|
||
| # Install/Update the selected packages | ||
| if (length(packages_to_install) > 0) { | ||
| # We use install_cran to handle versions if specified in DESCRIPTION (though usually remotes::install_deps does this better) | ||
| # But since we need to exclude one, we pass the vector. | ||
| # remotes::install_cran will install the latest CRAN version. | ||
| # To respect version requirements in DESCRIPTION, strictly speaking we should use something more sophisticated, | ||
| # but for a dev container, latest versions of dependencies are usually desired. | ||
| remotes::install_cran(packages_to_install) | ||
| } |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script uses remotes::install_cran() which ignores version constraints specified in DESCRIPTION. This could lead to compatibility issues if the DESCRIPTION file specifies minimum versions for dependencies. Consider using remotes::install_deps() with a custom exclude mechanism, or at minimum document this limitation.
| # Get dependencies from DESCRIPTION in the current directory | |
| deps <- remotes::dev_package_deps(dependencies = TRUE) | |
| # Filter out rJava to ensure no Java is installed | |
| packages_to_install <- deps$package[deps$package != "rJava"] | |
| # Install/Update the selected packages | |
| if (length(packages_to_install) > 0) { | |
| # We use install_cran to handle versions if specified in DESCRIPTION (though usually remotes::install_deps does this better) | |
| # But since we need to exclude one, we pass the vector. | |
| # remotes::install_cran will install the latest CRAN version. | |
| # To respect version requirements in DESCRIPTION, strictly speaking we should use something more sophisticated, | |
| # but for a dev container, latest versions of dependencies are usually desired. | |
| remotes::install_cran(packages_to_install) | |
| } | |
| # Install dependencies from DESCRIPTION in the current directory | |
| # Use install_deps so that version requirements in DESCRIPTION are respected, | |
| # while excluding rJava to avoid requiring a Java installation in the dev container. | |
| remotes::install_deps(dependencies = TRUE, exclude = "rJava") |
|
|
||
| # Install/Update the selected packages | ||
| if (length(packages_to_install) > 0) { | ||
| # We use install_cran to handle versions if specified in DESCRIPTION (though usually remotes::install_deps does this better) |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment mentions "install_cran" but the actual function call is "remotes::install_cran". The comment should clarify that this is the remotes package function being used, not a hypothetical local function.
| # We use install_cran to handle versions if specified in DESCRIPTION (though usually remotes::install_deps does this better) | |
| # We use remotes::install_cran to handle versions if specified in DESCRIPTION (though usually remotes::install_deps does this better) |
| # Add air to PATH for the current script execution if needed (though we add it to remoteEnv in devcontainer.json) | ||
| # The installer typically puts it in ~/.local/bin |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states that PATH is added to remoteEnv in devcontainer.json, but the PATH modification in line 10 happens during setup, not at runtime. The remoteEnv setting only affects the container environment after setup completes. Consider clarifying that this export is needed for the Air CLI to be available during the remainder of the setup script execution.
| # Add air to PATH for the current script execution if needed (though we add it to remoteEnv in devcontainer.json) | |
| # The installer typically puts it in ~/.local/bin | |
| # Ensure air is on PATH for the remainder of this setup script. | |
| # The installer typically puts it in ~/.local/bin; remoteEnv in devcontainer.json | |
| # will add this directory to PATH for future shells after setup completes. |
|
|
||
| # Install Posit Air CLI | ||
| echo "Installing Posit Air CLI..." | ||
| curl -LsSf https://github.com/posit-dev/air/releases/latest/download/air-installer.sh | sh |
Copilot
AI
Jan 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using curl ... | sh to install air-installer.sh executes a mutable remote script from GitHub without any pinning or integrity verification. If the GitHub repository, release asset, or network path is compromised, an attacker could execute arbitrary code inside the dev container with the same privileges as the developer, potentially exfiltrating source code or credentials. Prefer downloading a specific pinned version and verifying a checksum or signature, or vendoring a trusted installer script into this repository before executing it.
This PR adds a
.devcontainerconfiguration to the project. It sets up a development environment based onmcr.microsoft.com/devcontainers/r:latest.Key features:
.devcontainer/setup.R) readsDESCRIPTIONand installs all dependencies exceptrJava. This allows testing the package's functionality for downloading and installing Java.Posit.air-vscodeandquarto.quarto.postCreateCommandruns a setup script that installs the Air CLI and the R dependencies.PR created automatically by Jules for task 15392296075773728410 started by @e-kotov