Skip to content

[SQLite] CC-1745: Upgrade Bun to v1.2, Rust to v1.86 #135

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

Merged
merged 3 commits into from
May 15, 2025
Merged

Conversation

andy1li
Copy link
Member

@andy1li andy1li commented May 15, 2025

Summary by CodeRabbit

  • New Features

    • Added new Dockerfiles for Bun 1.2 and Rust 1.86 to support updated environments.
  • Documentation

    • Updated documentation to require Rust 1.86 and Bun 1.2 for relevant stages and templates.
  • Chores

    • Updated configuration files to specify Rust 1.86 and Bun 1.2 as the required versions.

…configuration and documentation files across starter templates and solutions.
@andy1li andy1li self-assigned this May 15, 2025
Copy link

linear bot commented May 15, 2025

Copy link

coderabbitai bot commented May 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The updates introduce new Dockerfiles for Bun 1.2 and Rust 1.86, and update configuration and documentation files across Rust and TypeScript starters and solutions to require these newer versions. All mentions of Rust 1.85 and Bun 1.1 are replaced with Rust 1.86 and Bun 1.2, ensuring consistency in version requirements throughout the project.

Changes

File(s) Change Summary
dockerfiles/bun-1.2.Dockerfile, dockerfiles/rust-1.86.Dockerfile Added new Dockerfiles for Bun 1.2 and Rust 1.86, setting up environments and dependency paths for each.
compiled_starters/rust/README.md, solutions/rust/01-dr6/code/README.md Updated minimum required Rust version in README files from 1.85 to 1.86.
compiled_starters/rust/codecrafters.yml, solutions/rust/01-dr6/code/codecrafters.yml Updated Rust version in configuration files from rust-1.85 to rust-1.86.
compiled_starters/typescript/README.md, solutions/typescript/01-dr6/code/README.md Updated Bun version in README files from 1.1 to 1.2.
compiled_starters/typescript/codecrafters.yml, solutions/typescript/01-dr6/code/codecrafters.yml Updated Bun version in configuration files from bun-1.1 to bun-1.2.
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.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Dockerfile
    participant Bun/Rust Environment
    participant App Source

    Developer->>Dockerfile: Build with Bun 1.2 or Rust 1.86
    Dockerfile->>Bun/Rust Environment: Set up environment (version 1.2/1.86)
    Dockerfile->>App Source: Copy source code (exclude .git, README.md)
    Dockerfile->>Bun/Rust Environment: Install dependencies/build (bun install/cargo build)
    Bun/Rust Environment-->>Dockerfile: Dependencies installed / App built
Loading

Poem

Oh, what a hop to versions new,
Rust and Bun, we welcome you!
Dockerfiles fresh, configs aligned,
Lockfiles frozen, builds refined.
With every leap, our code feels bright—
Onward we hop, with versions right!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6a0c38d and 233e4ca.

📒 Files selected for processing (5)
  • compiled_starters/rust/README.md (1 hunks)
  • compiled_starters/rust/codecrafters.yml (1 hunks)
  • solutions/rust/01-dr6/code/README.md (1 hunks)
  • solutions/rust/01-dr6/code/codecrafters.yml (1 hunks)
  • starter_templates/rust/config.yml (1 hunks)

🪧 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 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.

…across starter templates and solutions, and remove obsolete Dockerfile for Rust 1.87.
@andy1li andy1li changed the title [Kafka] CC-1745: Upgrade Bun to v1.2, Rust to v1.87 [SQLite] CC-1745: Upgrade Bun to v1.2, Rust to v1.87 May 15, 2025
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: 4

🧹 Nitpick comments (5)
dockerfiles/bun-1.2.Dockerfile (3)

17-18: Combine RUN steps to reduce image layers.
Merging the directory creation and move logic into one RUN instruction yields a smaller image and fewer 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

2-2: Pin the full Bun version for reproducibility.
Referencing oven/bun:1.2-alpine may float to new patches. If you need exact reproductions, specify a patch (e.g., oven/bun:1.2.4-alpine) once it’s released.


14-14: Optimize layer caching by splitting COPY/INSTALL.
Copy only package.json and bun.lockb before running bun install to leverage Docker cache and avoid reinstalling deps on every code change.

# Install dependencies first
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile

# Then copy application code
COPY . /app
dockerfiles/rust-1.86.Dockerfile (1)

2-2: Consider pinning the base image by digest for reproducibility
To guard against unexpected upstream changes, pin rust:1.86-bookworm to its SHA256 digest:

FROM rust:1.86-bookworm@sha256:<digest>
dockerfiles/rust-1.87.Dockerfile (1)

2-2: Consider pinning the base image by digest for reproducibility
Lock rust:1.87-bookworm to its SHA256 digest to prevent breaking changes:

FROM rust:1.87-bookworm@sha256:<digest>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 7cae5e8 and 6a0c38d.

📒 Files selected for processing (13)
  • 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)
  • dockerfiles/rust-1.87.Dockerfile (1 hunks)
  • solutions/rust/01-dr6/code/README.md (1 hunks)
  • solutions/rust/01-dr6/code/codecrafters.yml (1 hunks)
  • solutions/typescript/01-dr6/code/README.md (1 hunks)
  • solutions/typescript/01-dr6/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/rust-1.87.Dockerfile

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

(DL1000)

dockerfiles/bun-1.2.Dockerfile

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

(DL1000)

🔇 Additional comments (13)
solutions/typescript/01-dr6/code/README.md (1)

32-32: Version requirement updated to Bun 1.2
The step now correctly specifies bun (1.2) to match the new Dockerfile and runtime configuration.

starter_templates/typescript/config.yml (1)

2-2: Bun executable version bumped to 1.2
The required_executable has been updated to bun (1.2), aligning with the starter template’s runtime requirements.

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

10-11: Runtime version set to Bun 1.2
Both the “Available versions” comment and the language_pack entry have been updated to bun-1.2, which is consistent with the updated starter ecosystem.

compiled_starters/typescript/README.md (1)

32-32: Updated Bun requirement to 1.2
The README now correctly instructs users to install bun (1.2) for stages 2 and beyond.

compiled_starters/typescript/codecrafters.yml (1)

10-11: Language pack version upgraded to Bun 1.2
The language_pack field and its comment now reflect bun-1.2, in line with the rest of the TypeScript starter updates.

starter_templates/rust/config.yml (2)

2-2: Rust cargo version requirement updated to 1.87
This bump aligns with the updated Rust toolchain across the repository.


1-4: Missing Bun version updates
PR objectives mention upgrading Bun to v1.2, but I don’t see any Bun-related config or docs updated here. Please verify that Bun (v1.2) has been bumped in the relevant templates, configuration files, and documentation.

compiled_starters/rust/README.md (1)

32-32: Rust cargo version in README updated to 1.87
Matches the config and other READMEs—consistent versioning across compiled starters.

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

32-32: Rust cargo version requirement updated to 1.87
Aligned with the starter template and compiled starter; ensures consistency across solution docs.

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

10-11: Language pack version bumped to Rust 1.87
The comment and language_pack setting now match the updated Rust version in your templates and docs.

compiled_starters/rust/codecrafters.yml (1)

10-11: Language pack updated to Rust 1.87
Consistent with the solution and starter templates; ready for the new toolchain version.

dockerfiles/rust-1.86.Dockerfile (1)

1-1: Verify BuildKit is enabled to honor the syntax directive
You’ve added # syntax=docker/dockerfile:1.7-labs to leverage BuildKit features. Confirm that your build environment (CI/CD or local) sets DOCKER_BUILDKIT=1 so this frontend directive takes effect.

dockerfiles/rust-1.87.Dockerfile (1)

1-1: Verify BuildKit is enabled to honor the syntax directive
The # syntax=docker/dockerfile:1.7-labs directive relies on BuildKit. Make sure your Docker CLI or CI runner is configured with DOCKER_BUILDKIT=1.

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.

🛠️ Refactor suggestion

⚠️ Potential issue

Invalid COPY flag: --exclude will break the build.
Docker’s COPY doesn’t support --exclude; this will error out (Hadolint DL1000). Use a .dockerignore to exclude files instead of flags.

Apply this diff:

-COPY --exclude=.git --exclude=README.md . /app
+COPY . /app

And ensure your project root contains a .dockerignore with:

.git
README.md
🧰 Tools
🪛 Hadolint (2.12.0)

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

(DL1000)

🤖 Prompt for AI Agents
In dockerfiles/bun-1.2.Dockerfile at line 9, the COPY command uses the
unsupported --exclude flag, which causes build errors. Remove the --exclude
flags from the COPY command so it simply copies all files from the current
directory to /app. Then, create a .dockerignore file in the project root listing
.git and README.md to exclude these files from the build context.

@@ -29,7 +29,7 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `cargo (1.85)` installed locally
1. Ensure you have `cargo (1.87)` installed locally
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify Dockerfile for Rust 1.87 exists
Ensure that dockerfiles/rust-1.87.Dockerfile is committed and referenced by any CI or build pipelines.

Run:


🏁 Script executed:

#!/bin/bash
# Confirm presence of the Rust 1.87 Dockerfile
fd dockerfiles/rust-1.87.Dockerfile

Length of output: 37


🏁 Script executed:

#!/bin/bash
# List all Dockerfiles in the repository to locate any Rust-specific ones
find . -type f -name "*Dockerfile"

Length of output: 1728


🏁 Script executed:

#!/bin/bash
# Search for references to rust-1.87 Dockerfile in CI and workflow configurations
rg -n "rust-1\.87" --glob "*.yml" --glob "*.yaml" .github/ .gitlab-ci.yml azure-pipelines.yml ci/

Length of output: 258


Ensure CI workflows include the new Rust 1.87 Dockerfile
We’ve confirmed that dockerfiles/rust-1.87.Dockerfile is present, but no references to it were found in any CI or GitHub Actions workflow files. Please update your pipeline configurations to build/test with the Rust 1.87 image.

• File location: dockerfiles/rust-1.87.Dockerfile
• No matches in .github/ workflows or other CI configs
• Action: Add or update your CI manifests (e.g. .github/workflows/*.yml) to reference this new Dockerfile so Rust 1.87 is properly built and tested.

🤖 Prompt for AI Agents
In compiled_starters/rust/README.md at line 32, the documentation mentions Rust
1.87 but there is no corresponding update in the CI or GitHub Actions workflows
to use the new dockerfiles/rust-1.87.Dockerfile. To fix this, locate your CI
pipeline configuration files (e.g., in .github/workflows/) and add or update the
workflow steps to reference and build/test using the rust-1.87 Dockerfile,
ensuring Rust 1.87 is properly integrated into your build and test processes.

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 --exclude flag in COPY instruction
Docker’s COPY does not support --exclude—even with BuildKit labs enabled—so this will break your build. Remove the --exclude flags and use a .dockerignore file instead.

Apply this diff:

-COPY --exclude=.git --exclude=README.md . /app
+COPY . /app

And ensure your .dockerignore includes:

.git
README.md
🧰 Tools
🪛 Hadolint (2.12.0)

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

(DL1000)

🤖 Prompt for AI Agents
In dockerfiles/rust-1.86.Dockerfile at line 10, the COPY instruction incorrectly
uses the unsupported --exclude flag, which causes the build to fail. Remove the
--exclude flags from the COPY command so it simply copies the current directory
to /app. Then create or update the .dockerignore file in the build context root
to include .git and README.md, ensuring these files are excluded from the build
context instead of using --exclude in COPY.

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 --exclude flag in COPY instruction
As above, Docker’s COPY doesn’t support --exclude. Replace with a simple COPY . /app and manage exclusions via .dockerignore.

-COPY --exclude=.git --exclude=README.md . /app
+COPY . /app

Ensure .dockerignore has:

.git
README.md
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

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

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

(DL1000)

🤖 Prompt for AI Agents
In dockerfiles/rust-1.87.Dockerfile at line 10, the COPY instruction incorrectly
uses the unsupported --exclude flag. Replace the COPY line with a simple COPY .
/app and add the excluded files and directories (.git and README.md) to a
.dockerignore file in the build context to prevent them from being copied.

@andy1li andy1li changed the title [SQLite] CC-1745: Upgrade Bun to v1.2, Rust to v1.87 [SQLite] CC-1745: Upgrade Bun to v1.2, Rust to v1.86 May 15, 2025
@andy1li andy1li merged commit ef79084 into main May 15, 2025
26 of 27 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