Add devcontainer configuration and README#8
Conversation
Set up a devcontainer with Java 17 (Temurin), GitHub CLI, and Gradle cache warm-up to provide a consistent, reproducible development environment for all contributors. Closes #4 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a devcontainer configuration for a Java 17 development environment, supporting scripts for setup and GitHub CLI authentication, documentation updates (README and CLAUDE.md), a Claude hook and settings to block access to a local GitHub token file, and a gitignore entry for the token file. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
README.md (1)
43-43: Optional en-GB wording tweak: “Licence”.If you want strict en-GB consistency in docs, rename the heading to “Licence”.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` at line 43, Rename the markdown heading "## License" to the British English spelling "## Licence" in the README to maintain en-GB consistency; update any internal links or references that point to the "License" heading (e.g., anchor references or TOC entries) to use the new "Licence" text so cross-links continue to work.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Line 14: Update the README sentence to clarify Gradle usage: change "Gradle
pre-installed" to indicate the project uses the Gradle wrapper (./gradlew)
rather than a system Gradle binary; reference the devcontainer configuration
(devcontainer.json) and the wrapper script ./gradlew in the phrasing so readers
understand the container provides Java 17 and Gradle via the wrapper rather than
a global Gradle installation.
---
Nitpick comments:
In `@README.md`:
- Line 43: Rename the markdown heading "## License" to the British English
spelling "## Licence" in the README to maintain en-GB consistency; update any
internal links or references that point to the "License" heading (e.g., anchor
references or TOC entries) to use the new "Licence" text so cross-links continue
to work.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f6a09dcc-bdcb-497b-92f5-4de74f0fd181
📒 Files selected for processing (3)
.devcontainer/devcontainer.jsonCLAUDE.mdREADME.md
Address CodeRabbit review: Gradle is provided via the wrapper, not pre-installed as a system binary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Re: en-GB "Licence" nitpick — the repository already has a |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
README.md (1)
43-45: Consider British English spelling for "Licence".In British English (en-GB), the noun form is typically spelled "Licence" rather than "License". However, "LICENSE" is the standard filename convention in open source projects, so this is purely a stylistic consideration.
Optional British English spelling adjustment
-## License +## Licence [MIT](LICENSE)Note: The filename
LICENSEshould remain unchanged as it's a widely recognised convention.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 43 - 45, Change the README header "## License" to the British English noun spelling "## Licence" while leaving the LICENSE filename unchanged; update any references in README that point to the LICENSE file to keep the file name as "LICENSE" (do not rename the file), and ensure any link text that should display British spelling uses "Licence" (e.g., change the header and link label but keep the href target as LICENSE).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@README.md`:
- Around line 43-45: Change the README header "## License" to the British
English noun spelling "## Licence" while leaving the LICENSE filename unchanged;
update any references in README that point to the LICENSE file to keep the file
name as "LICENSE" (do not rename the file), and ensure any link text that should
display British spelling uses "Licence" (e.g., change the header and link label
but keep the href target as LICENSE).
The Java base image lacks Node.js/npm. Add the Node.js devcontainer feature so Claude Code CLI can be installed for the yolo alias. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract postCreateCommand into .devcontainer/setup.sh for clarity - Add gh-auth.sh for GitHub CLI authentication via gitignored token file - Add Claude Code hook to block Read/Edit access to the token file - Mount named volume for Claude settings persistence Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.devcontainer/setup.sh (2)
11-11: Make the alias append idempotent.Line 11 will duplicate
yoloentries when the setup step is re-run. Guard before appending.Proposed change
echo "==> Configuring shell aliases..." -echo 'alias yolo="claude --dangerously-skip-permissions"' >> ~/.bashrc +grep -qxF 'alias yolo="claude --dangerously-skip-permissions"' ~/.bashrc || \ + echo 'alias yolo="claude --dangerously-skip-permissions"' >> ~/.bashrc🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.devcontainer/setup.sh at line 11, The alias line for "alias yolo=\"claude --dangerously-skip-permissions\"" is being appended unconditionally and will duplicate on repeated runs; change the setup to first check ~/.bashrc for an existing exact alias yolo entry (matching the full alias string) and only append the alias if that check fails, so use a guard that searches for the exact alias line before writing to ~/.bashrc to make the operation idempotent.
8-8: Pin the Claude CLI version for reproducible environments.Line 8 installs the latest package every time, which can drift and break onboarding unexpectedly. Pin a known-good version to ensure consistent development environments.
Proposed change
echo "==> Installing Claude Code CLI..." -npm install -g `@anthropic-ai/claude-code` +CLAUDE_CODE_VERSION="2.1.97" +npm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.devcontainer/setup.sh at line 8, The global install currently uses a floating tag "npm install -g `@anthropic-ai/claude-code`", which allows the CLI to drift; change this to a pinned version by replacing that invocation with a specific semver or exact tag (e.g., `@anthropic-ai/claude-code`@<known-good-version>) so the devcontainer installs a reproducible CLI; update the line that references "@anthropic-ai/claude-code" in setup.sh to use the chosen pinned version and document the version chosen in a comment nearby.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.devcontainer/gh-auth.sh:
- Around line 10-24: The script currently reads the PAT from TOKEN_FILE without
enforcing restrictive filesystem permissions; update the logic around
TOKEN_FILE/TOKEN to ensure owner-only permissions (e.g., mode 600) before
reading or exit with a warning if permissions are too permissive. Specifically,
add a check after confirming TOKEN_FILE exists to examine its mode and if it's
more permissive than owner-read/write, either chmod it to 600 or print a clear
error and abort; then read TOKEN into TOKEN as before and keep the existing
empty-file check. Use the TOKEN_FILE and TOKEN identifiers to locate where to
insert this permission check and remedial chmod.
- Around line 26-27: The startup currently aborts due to set -euo pipefail when
the commands gh auth login and gh auth setup-git fail; change the logic to first
check gh authentication status (gh auth status) and only attempt echo "$TOKEN" |
gh auth login --with-token if not already authenticated, and make both the login
and gh auth setup-git non-fatal by catching failures (e.g., conditionally
running login or appending a non-fatal fallback so failures don't exit the
script). Ensure you reference and adjust the gh auth status check, the gh auth
login pipeline, and gh auth setup-git so transient network/credential errors are
short-circuited or logged without aborting container startup.
---
Nitpick comments:
In @.devcontainer/setup.sh:
- Line 11: The alias line for "alias yolo=\"claude
--dangerously-skip-permissions\"" is being appended unconditionally and will
duplicate on repeated runs; change the setup to first check ~/.bashrc for an
existing exact alias yolo entry (matching the full alias string) and only append
the alias if that check fails, so use a guard that searches for the exact alias
line before writing to ~/.bashrc to make the operation idempotent.
- Line 8: The global install currently uses a floating tag "npm install -g
`@anthropic-ai/claude-code`", which allows the CLI to drift; change this to a
pinned version by replacing that invocation with a specific semver or exact tag
(e.g., `@anthropic-ai/claude-code`@<known-good-version>) so the devcontainer
installs a reproducible CLI; update the line that references
"@anthropic-ai/claude-code" in setup.sh to use the chosen pinned version and
document the version chosen in a comment nearby.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c9816ea8-415d-4f3c-8ad8-b0cab5d95079
📒 Files selected for processing (6)
.claude/hooks/block-token-read.sh.claude/settings.json.devcontainer/devcontainer.json.devcontainer/gh-auth.sh.devcontainer/setup.sh.gitignore
✅ Files skipped from review due to trivial changes (3)
- .claude/settings.json
- .devcontainer/devcontainer.json
- .gitignore
Point Claude Code config directory at the mounted volume so all settings and credentials survive container rebuilds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Enforce 600 permissions on token file before reading - Skip auth if already authenticated, make failures non-fatal - Guard alias append to prevent duplicates in .bashrc Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Re: pinning Claude CLI version — intentionally left unpinned. Claude Code updates frequently and we want developers to get the latest version on container creation. Pinning would require constant maintenance with no real benefit since Claude Code maintains backward compatibility. The alias append idempotency fix was applied in e78bd65. |
Summary
.devcontainer/devcontainer.jsonwith Java 17 (Temurin), GitHub CLI, and Gradle cache warm-upREADME.mdwith devcontainer setup instructions (VS Code, IntelliJ, Codespaces, CLI) and build commandsCLAUDE.mdwith devcontainer sectionCloses #4
Test plan
./gradlew buildand./gradlew testinside the containeryoloalias works in container shell🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores