Skip to content

Conversation

andy1li
Copy link
Member

@andy1li andy1li commented May 14, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Rust 1.86 and Bun 1.2 environments with new Docker images.
  • Chores

    • Updated documentation and configuration files to require Rust 1.86 (was 1.85) and Bun 1.2 (was 1.1) across Rust and TypeScript starter templates and solutions.

@andy1li andy1li self-assigned this May 14, 2025
Copy link

linear bot commented May 14, 2025

Copy link

coderabbitai bot commented May 14, 2025

Walkthrough

This update increases the required versions of Rust (from 1.85 to 1.86) and Bun (from 1.1 to 1.2) across configuration files, documentation, and Dockerfiles for both starter templates and solutions. New Dockerfiles for the updated versions are introduced, and all relevant instructions and version comments are aligned accordingly.

Changes

File(s) Change Summary
compiled_starters/rust/README.md
solutions/rust/01-gg4/code/README.md
Updated required Rust cargo version from 1.85 to 1.86 in documentation.
compiled_starters/rust/codecrafters.yml
solutions/rust/01-gg4/code/codecrafters.yml
Updated Rust version in config from rust-1.85 to rust-1.86 and revised version comments.
compiled_starters/typescript/README.md
solutions/typescript/01-gg4/code/README.md
Updated Bun requirement from version 1.1 to 1.2 in documentation.
compiled_starters/typescript/codecrafters.yml
solutions/typescript/01-gg4/code/codecrafters.yml
Updated Bun version in config from bun-1.1 to bun-1.2 and revised version comments.
starter_templates/rust/config.yml Updated required cargo version from 1.85 to 1.86.
starter_templates/typescript/config.yml Updated required Bun version from 1.1 to 1.2.
dockerfiles/rust-1.86.Dockerfile Added Dockerfile for Rust 1.86: sets env vars, copies files, runs build script.
dockerfiles/bun-1.2.Dockerfile Added Dockerfile for Bun 1.2: sets env vars, copies files, installs dependencies, caches modules.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Dockerfile
    participant BuildScript

    User->>Dockerfile: Build container (Rust 1.86 or Bun 1.2)
    Dockerfile->>Dockerfile: Set environment variables
    Dockerfile->>Dockerfile: Copy project files (exclude .git, README.md)
    alt Rust
        Dockerfile->>BuildScript: Run .codecrafters/compile.sh
    else Bun
        Dockerfile->>Dockerfile: Run bun install --frozen-lockfile
        Dockerfile->>Dockerfile: Cache node_modules if present
    end
    Dockerfile-->>User: Ready container with updated toolchain
Loading

Possibly related PRs

Poem

Hopping forward, versions rise,
Rust and Bun with brighter eyes.
New Dockerfiles, configs align,
Dependencies fresh, builds divine.
With 1.86 and 1.2 in play,
The codebase leaps a modern way!
🐇✨

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
dockerfiles/bun-1.2.Dockerfile (1)

16-18: Consolidate RUN instructions to reduce layers
You can merge the directory creation and conditional move into a single RUN to optimize image layers:

- RUN mkdir -p /app-cached
- RUN if [ -d "/app/node_modules" ]; then mv /app/node_modules /app-cached; fi
+ RUN mkdir -p /app-cached \
+   && if [ -d "/app/node_modules" ]; then mv /app/node_modules /app-cached; fi
dockerfiles/rust-1.86.Dockerfile (3)

9-10: 🏗️ Suggest using .dockerignore instead of --exclude flags
Hadolint flags COPY --exclude as DL1000, and the canonical Docker way to omit files is via a .dockerignore. This also simplifies the COPY step:

-# hadolint ignore=DL1000
-COPY --exclude=.git --exclude=README.md . /app
+COPY . /app

And in your repository root, add a .dockerignore with:

.git
README.md

This removes the need for the experimental --exclude flags and silences the linter.

🧰 Tools
🪛 Hadolint (2.12.0)

[error] 10-10: invalid flag: --exclude

(DL1000)


12-13: 🔧 Ensure compile script is executable and portable
If .codecrafters/compile.sh lacks a shebang or execute bit, the build may fail. Consider either:

  1. Prefixing the command:
    RUN sh ./.codecrafters/compile.sh
  2. Ensuring the file has a shebang (#!/usr/bin/env bash) and execute permissions in Git.

This will make your CI builds more robust.


1-13: 📌 Optional: Pin the Rust image to a digest for reproducibility
To guarantee identical builds over time, consider pinning the base image to its immutable digest:

FROM rust@sha256:<digest>-bookworm

You can find the digest via docker buildx imagetools inspect rust:1.86-bookworm.

🧰 Tools
🪛 Hadolint (2.12.0)

[error] 10-10: invalid flag: --exclude

(DL1000)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6008483 and 093050b.

📒 Files selected for processing (12)
  • compiled_starters/rust/README.md (1 hunks)
  • compiled_starters/rust/codecrafters.yml (1 hunks)
  • compiled_starters/typescript/README.md (1 hunks)
  • compiled_starters/typescript/codecrafters.yml (1 hunks)
  • dockerfiles/bun-1.2.Dockerfile (1 hunks)
  • dockerfiles/rust-1.86.Dockerfile (1 hunks)
  • solutions/rust/01-gg4/code/README.md (1 hunks)
  • solutions/rust/01-gg4/code/codecrafters.yml (1 hunks)
  • solutions/typescript/01-gg4/code/README.md (1 hunks)
  • solutions/typescript/01-gg4/code/codecrafters.yml (1 hunks)
  • starter_templates/rust/config.yml (1 hunks)
  • starter_templates/typescript/config.yml (1 hunks)
🧰 Additional context used
🪛 Hadolint (2.12.0)
dockerfiles/rust-1.86.Dockerfile

[error] 10-10: invalid flag: --exclude

(DL1000)

dockerfiles/bun-1.2.Dockerfile

[error] 9-9: invalid flag: --exclude

(DL1000)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test_course_definition / test (haskell)
🔇 Additional comments (15)
solutions/typescript/01-gg4/code/README.md (1)

30-30: Bump Bun version in README
The update from bun (1.1) to bun (1.2) is correct and aligns with the PR objectives.

compiled_starters/typescript/README.md (1)

30-30: Update local Bun requirement
Changing the required Bun version to 1.2 is consistent with the companion configuration and Dockerfiles.

starter_templates/typescript/config.yml (1)

2-2: Upgrade required_executable to Bun 1.2
The bump from bun (1.1) to bun (1.2) matches the other TypeScript starter and solution configs.

solutions/typescript/01-gg4/code/codecrafters.yml (1)

10-11: Align language pack to Bun 1.2
Updating both the comment and language_pack value to bun-1.2 is correct and consistent across the project.

compiled_starters/typescript/codecrafters.yml (1)

10-11: Switch compiled starter to Bun 1.2
The available versions comment and language_pack have been properly updated to bun-1.2.

dockerfiles/bun-1.2.Dockerfile (3)

1-2: Base image version bump is correct
The new oven/bun:1.2-alpine image aligns with the PR objective to upgrade Bun to v1.2.


4-4: Environment variable for dependency file paths looks good
Setting CODECRAFTERS_DEPENDENCY_FILE_PATHS="package.json,bun.lockb" correctly informs the build tooling which files to watch.


11-14: Lockfile installation for reproducible builds is correct
Using bun install --frozen-lockfile ensures CI fails if package.json and bun.lockb drift, which is ideal for locked dependencies.

starter_templates/rust/config.yml (1)

2-2: Bump required cargo version to 1.86
The required_executable entry has been correctly updated from 1.85 to 1.86, matching the PR objective.

compiled_starters/rust/README.md (1)

30-30: Update local cargo requirement in README
The Stage 2 instructions now require cargo (1.86), aligning with the updated starter configuration.

solutions/rust/01-gg4/code/README.md (1)

30-30: Align solution README with Rust 1.86
The README has been updated to require cargo (1.86), consistent with the starter and compiled-starter changes.

solutions/rust/01-gg4/code/codecrafters.yml (1)

10-11: Upgrade language_pack to rust-1.86
The # Available versions comment and language_pack field are now set to rust-1.86, reflecting the bump.

compiled_starters/rust/codecrafters.yml (1)

10-11: Upgrade compiled starter to Rust 1.86
Both the comment and language_pack: rust-1.86 have been correctly updated to support Rust 1.86.

dockerfiles/rust-1.86.Dockerfile (2)

1-3: ✅ Bumped Rust base image appropriately
The switch to rust:1.86-bookworm aligns perfectly with the PR objective to upgrade Rust from 1.85 to 1.86. The # syntax=docker/dockerfile:1.7-labs directive correctly enables BuildKit features required by the later instructions.


5-6: ✅ Dependency-trigger ENV var set correctly
Defining CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock" will ensure cache invalidation when those files change. Confirm that your .codecrafters/compile.sh script reads this variable as expected.

Comment on lines +6 to +9
WORKDIR /app

# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Invalid COPY flag: --exclude is not supported
Docker’s COPY instruction does not accept --exclude flags (Hadolint DL1000). To exclude .git and README.md, add them to a .dockerignore:

.git
README.md

Then update the Dockerfile:

- COPY --exclude=.git --exclude=README.md . /app
+ COPY . /app
🧰 Tools
🪛 Hadolint (2.12.0)

[error] 9-9: invalid flag: --exclude

(DL1000)

@andy1li andy1li changed the title [Redis] CC-1745: Upgrade Bun to v1.2, Rust to v1.86 [Git] CC-1745: Upgrade Bun to v1.2, Rust to v1.86 May 14, 2025
@andy1li andy1li merged commit fde1d49 into main May 14, 2025
25 checks passed
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