Skip to content

Conversation

@google-labs-jules
Copy link

This PR adds a .devcontainer configuration to the project. It sets up a development environment based on mcr.microsoft.com/devcontainers/r:latest.

Key features:

  1. Java-Free Environment: The container is configured to start without Java. The dependency installation script (.devcontainer/setup.R) reads DESCRIPTION and installs all dependencies except rJava. This allows testing the package's functionality for downloading and installing Java.
  2. Tooling:
    • Installs Posit Air CLI for code formatting.
    • Installs VS Code extensions: Posit.air-vscode and quarto.quarto.
  3. Automation: The postCreateCommand runs a setup script that installs the Air CLI and the R dependencies.

PR created automatically by Jules for task 15392296075773728410 started by @e-kotov

- 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.
@google-labs-jules
Copy link
Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@e-kotov e-kotov marked this pull request as ready for review January 11, 2026 23:26
Copilot AI review requested due to automatic review settings January 11, 2026 23:26
@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.80%. Comparing base (cbc4a78) to head (7d1190c).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 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
Copy link

Copilot AI Jan 11, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +22
# 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)
}
Copy link

Copilot AI Jan 11, 2026

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.

Suggested change
# 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")

Copilot uses AI. Check for mistakes.

# 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)
Copy link

Copilot AI Jan 11, 2026

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.

Suggested change
# 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)

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +9
# 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
Copy link

Copilot AI Jan 11, 2026

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.

# Install Posit Air CLI
echo "Installing Posit Air CLI..."
curl -LsSf https://github.com/posit-dev/air/releases/latest/download/air-installer.sh | sh
Copy link

Copilot AI Jan 11, 2026

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant