Skip to content

[Redis] CC-1745: Upgrade Bun to v1.2, Rust to v1.86, and Elixir to v1.18 #305

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 1 commit into from
May 14, 2025

Conversation

andy1li
Copy link
Member

@andy1li andy1li commented May 14, 2025

Summary by CodeRabbit

  • New Features

    • Added a command-line interface entry point for Elixir projects, enabling execution via a compiled escript binary.
    • Introduced new Dockerfiles for updated Elixir, Rust, and Bun (TypeScript) environments.
  • Improvements

    • Updated Elixir, Rust, and Bun/TypeScript starter templates and solutions to require newer language/runtime versions.
    • Enhanced build scripts to explicitly compile Elixir projects before execution.
    • Updated configuration files to reflect new entry points and version requirements.
  • Documentation

    • Corrected and clarified entry point filenames and version requirements in README and documentation files.
  • Chores

    • Updated .gitignore files to exclude new compiled binaries.

- Added .gitignore to ignore compiled binary.
- Updated codecrafters.yml to use Elixir version 1.18.
- Renamed application from :redis to :codecrafters_redis in mix.exs.
- Updated Elixir version in mix.exs to "~> 1.18".
- Created main.ex as the entry point for the Redis server implementation.
- Modified your_program.sh and compile.sh for new build and run processes.
@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 introduces a series of coordinated changes across Elixir, Rust, and TypeScript starter templates and solutions. The Elixir projects now use escript builds with a new CLI entry point, updated scripts, and configuration for Elixir 1.18. Rust and TypeScript starters and solutions are updated to newer toolchain versions. New Dockerfiles are added for the updated environments.

Changes

Files/Paths Change Summary
compiled_starters/elixir/.codecrafters/compile.sh, solutions/elixir/01-jm1/code/.codecrafters/compile.sh, starter_templates/elixir/code/.codecrafters/compile.sh Changed from no-op to building escript with mix escript.build and moving the binary to /tmp/codecrafters-build-redis-elixir.
compiled_starters/elixir/.codecrafters/run.sh, solutions/elixir/01-jm1/code/.codecrafters/run.sh, starter_templates/elixir/code/.codecrafters/run.sh Changed from running mix run --no-halt to executing the compiled escript binary directly.
compiled_starters/elixir/.gitignore, solutions/elixir/01-jm1/code/.gitignore, starter_templates/elixir/code/.gitignore Added /codecrafters_redis to ignore the compiled binary.
compiled_starters/elixir/README.md, solutions/elixir/01-jm1/code/README.md, solutions/elixir/01-jm1/explanation.md Updated entry point references from lib/server.ex to lib/main.ex.
compiled_starters/elixir/codecrafters.yml, solutions/elixir/01-jm1/code/codecrafters.yml Updated Elixir version from 1.16 to 1.18 in configuration.
compiled_starters/elixir/lib/main.ex, solutions/elixir/01-jm1/code/lib/main.ex, starter_templates/elixir/code/lib/main.ex Added CLI module with main/1 function as new entry point; minor whitespace changes in Server module.
compiled_starters/elixir/mix.exs, solutions/elixir/01-jm1/code/mix.exs, starter_templates/elixir/code/mix.exs Renamed app to :codecrafters_redis, updated Elixir version to "~> 1.18", added deps/0 function, and escript config.
compiled_starters/elixir/your_program.sh, solutions/elixir/01-jm1/code/your_program.sh Added build step with mix escript.build and execution of compiled binary.
starter_templates/elixir/config.yml Changed required_executable and user_editable_file values, now quoted and updated file path.
compiled_starters/rust/README.md, solutions/rust/01-jm1/code/README.md Updated required Cargo version from 1.82 to 1.86.
compiled_starters/rust/codecrafters.yml, solutions/rust/01-jm1/code/codecrafters.yml, solutions/rust/02-rg2/code/codecrafters.yml Updated Rust version from 1.85 to 1.86 in configuration.
solutions/rust/02-rg2/diff/README.md.diff Added README for Redis challenge; minor version mismatch (1.86 to 1.82) in instructions.
compiled_starters/typescript/README.md, solutions/typescript/01-jm1/code/README.md Updated required bun version from 1.1 to 1.2.
compiled_starters/typescript/codecrafters.yml, solutions/typescript/01-jm1/code/codecrafters.yml, solutions/typescript/02-rg2/code/codecrafters.yml Updated TypeScript runtime from bun-1.1 to bun-1.2.
solutions/typescript/02-rg2/diff/README.md.diff Added README for Redis challenge; instructions reference bun 1.1.
starter_templates/rust/config.yml Updated required cargo version from 1.82 to 1.86.
starter_templates/typescript/config.yml Updated required bun version from 1.1 to 1.2.
dockerfiles/bun-1.2.Dockerfile Added Dockerfile for Bun 1.2 with dependency install and caching.
dockerfiles/elixir-1.18.Dockerfile Added Dockerfile for Elixir 1.18, with build steps and dependency caching.
dockerfiles/rust-1.86.Dockerfile Added Dockerfile for Rust 1.86, with build steps and dependency caching.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI (escript)
    participant Application
    participant Server

    User->>CLI (escript): Run compiled binary
    CLI (escript)->>Application: Application.ensure_all_started(:codecrafters_redis)
    Application->>Server: Start server logic
    CLI (escript)->>CLI (escript): Process.sleep(:infinity)
Loading

Poem

In the garden of code, a new path we tread,
Elixir now builds, with escript ahead.
Rust and TypeScript, their versions anew,
Dockerfiles fresh, for a world bright and true.
The bunny hops forward, with scripts that compile—
Progress in every directory, mile after mile!
🐇✨

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.

✨ Finishing Touches
  • 📝 Generate Docstrings

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

@andy1li andy1li changed the title [Redis] CC-1745: Upgrade Run to v1.2, Rust to v1.86, and Elixir to v1.18 [Redis] CC-1745: Upgrade Bun to v1.2, Rust to v1.86, and Elixir to v1.18 May 14, 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: 5

♻️ Duplicate comments (4)
compiled_starters/elixir/.gitignore (1)

1-3: Ignore compiled escript binary
Added /codecrafters_redis to exclude the built escript binary from version control.

starter_templates/elixir/code/.gitignore (1)

1-3: Ignore compiled escript binary
Added /codecrafters_redis to exclude the built escript binary from version control.

compiled_starters/typescript/README.md (1)

29-29: Duplicate: bump bun version in compiled-starter README.
Same runtime requirement update as in other documentation—no further action needed.

compiled_starters/typescript/codecrafters.yml (1)

10-11: Duplicate: bump bun version in compiled-starter config.
Matches the same version upgrade in related solution and starter files.

🧹 Nitpick comments (4)
solutions/elixir/01-jm1/code/.codecrafters/compile.sh (1)

11-12: Add escript build and move steps
The mix escript.build followed by moving codecrafters_redis to /tmp aligns with the compiled-starter pattern. Consider adding an rm -f /tmp/codecrafters-build-redis-elixir before the mv to handle repeated runs, though it’s optional.

solutions/elixir/01-jm1/code/lib/main.ex (1)

22-31: New CLI module added for escript entry point.

The CLI module provides the necessary entry point for the escript executable, which aligns with the overall changes to the build and run process in this PR.

Using Process.sleep(:infinity) to keep the application running is a common pattern in Elixir CLI applications, though there are alternatives like using a simple receive block that would achieve the same result while potentially being more responsive to system signals.

Consider using a receive block instead of Process.sleep(:infinity) for better signal handling:

  def main(_args) do
    # Start the Server application
    {:ok, _pid} = Application.ensure_all_started(:codecrafters_redis)

    # Run forever
-   Process.sleep(:infinity)
+   receive do
+     _ -> :ok
+   end
  end
dockerfiles/elixir-1.18.Dockerfile (1)

23-25: Effective caching of build artifacts.

The approach for caching build artifacts by moving directories to /app-cached is good for performance, but could be improved with better conditional checks.

Consider simplifying the conditional directory moves:

RUN mkdir -p /app-cached
- RUN if [ -d "/app/_build" ]; then mv /app/_build /app-cached; fi
- RUN if [ -d "/app/deps" ]; then mv /app/deps /app-cached; fi
+ RUN for dir in _build deps; do \
+       if [ -d "/app/$dir" ]; then \
+           mv "/app/$dir" /app-cached/; \
+       fi \
+     done

This reduces the number of RUN instructions and improves readability.

dockerfiles/bun-1.2.Dockerfile (1)

17-18: Optimize Dockerfile layers.
You can combine the two RUN steps into one to reduce image layers and speed up builds.

Example:

- 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
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 938a2b4 and d907048.

📒 Files selected for processing (41)
  • compiled_starters/elixir/.codecrafters/compile.sh (1 hunks)
  • compiled_starters/elixir/.codecrafters/run.sh (1 hunks)
  • compiled_starters/elixir/.gitignore (1 hunks)
  • compiled_starters/elixir/README.md (2 hunks)
  • compiled_starters/elixir/codecrafters.yml (1 hunks)
  • compiled_starters/elixir/lib/main.ex (2 hunks)
  • compiled_starters/elixir/mix.exs (1 hunks)
  • compiled_starters/elixir/your_program.sh (1 hunks)
  • 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/elixir-1.18.Dockerfile (1 hunks)
  • dockerfiles/rust-1.86.Dockerfile (1 hunks)
  • solutions/elixir/01-jm1/code/.codecrafters/compile.sh (1 hunks)
  • solutions/elixir/01-jm1/code/.codecrafters/run.sh (1 hunks)
  • solutions/elixir/01-jm1/code/.gitignore (1 hunks)
  • solutions/elixir/01-jm1/code/README.md (2 hunks)
  • solutions/elixir/01-jm1/code/codecrafters.yml (1 hunks)
  • solutions/elixir/01-jm1/code/lib/main.ex (2 hunks)
  • solutions/elixir/01-jm1/code/mix.exs (1 hunks)
  • solutions/elixir/01-jm1/code/your_program.sh (1 hunks)
  • solutions/elixir/01-jm1/diff/lib/main.ex.diff (2 hunks)
  • solutions/elixir/01-jm1/explanation.md (1 hunks)
  • solutions/rust/01-jm1/code/README.md (1 hunks)
  • solutions/rust/01-jm1/code/codecrafters.yml (1 hunks)
  • solutions/rust/02-rg2/code/codecrafters.yml (1 hunks)
  • solutions/rust/02-rg2/diff/README.md.diff (1 hunks)
  • solutions/typescript/01-jm1/code/README.md (1 hunks)
  • solutions/typescript/01-jm1/code/codecrafters.yml (1 hunks)
  • solutions/typescript/02-rg2/code/codecrafters.yml (1 hunks)
  • solutions/typescript/02-rg2/diff/README.md.diff (1 hunks)
  • starter_templates/elixir/code/.codecrafters/compile.sh (1 hunks)
  • starter_templates/elixir/code/.codecrafters/run.sh (1 hunks)
  • starter_templates/elixir/code/.gitignore (1 hunks)
  • starter_templates/elixir/code/lib/main.ex (2 hunks)
  • starter_templates/elixir/code/mix.exs (1 hunks)
  • starter_templates/elixir/config.yml (1 hunks)
  • starter_templates/rust/config.yml (1 hunks)
  • starter_templates/typescript/config.yml (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
compiled_starters/elixir/lib/main.ex (2)
solutions/elixir/01-jm1/code/lib/main.ex (1)
  • main (24-30)
starter_templates/elixir/code/lib/main.ex (1)
  • main (29-35)
starter_templates/elixir/code/lib/main.ex (2)
compiled_starters/elixir/lib/main.ex (1)
  • main (29-35)
solutions/elixir/01-jm1/code/lib/main.ex (1)
  • main (24-30)
🪛 Hadolint (2.12.0)
dockerfiles/rust-1.86.Dockerfile

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

(DL1000)

dockerfiles/elixir-1.18.Dockerfile

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

(DL1000)

dockerfiles/bun-1.2.Dockerfile

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

(DL1000)

🔇 Additional comments (57)
solutions/elixir/01-jm1/explanation.md (1)

1-1:

✅ Verification successful

Update entry point reference
Changed the documentation to point to lib/main.ex instead of the old lib/server.ex. Please verify no remaining references to lib/server.ex across the codebase using a command like:


🏁 Script executed:

rg -n "lib/server.ex"

Length of output: 21


Entry point reference updated correctly
Verified with rg -n "lib/server.ex"—no matches found, confirming all references have been updated to lib/main.ex.

solutions/elixir/01-jm1/code/.gitignore (1)

1-3: Ignore compiled escript binary
Added /codecrafters_redis to exclude the built escript binary from version control, ensuring no build artifacts are committed.

solutions/elixir/01-jm1/code/codecrafters.yml (1)

10-11: Bump Elixir version
Updated the language_pack to elixir-1.18, aligning with the Mix configuration in mix.exs and matching the targeted Elixir runtime.

compiled_starters/elixir/codecrafters.yml (1)

10-11: Update Elixir version in the platform configuration
You've correctly bumped both the “Available versions” comment and the language_pack to elixir-1.18. Ensure that the CodeCrafters environment supports this new version and that no other YAML entries reference the old elixir-1.16.

compiled_starters/elixir/README.md (2)

15-15: Corrected entry point reference to lib/main.ex
Good catch updating the first-stage instructions to point at lib/main.ex. This aligns with the new CLI module.


31-31: Aligned run instructions with the new entry point
Nice—the Stage 2+ instructions now correctly reference lib/main.ex. No stale references remain.

compiled_starters/elixir/.codecrafters/run.sh (1)

11-11: Switch to executing precompiled escript binary
The change to exec /tmp/codecrafters-build-redis-elixir "$@" ensures we run the compiled escript directly. This is exactly what we want—no leftover mix run.

solutions/elixir/01-jm1/code/README.md (2)

15-15: Updated first-stage instructions to new entry point
The entry point note now correctly points at lib/main.ex, matching the solution’s CLI.main/1. Excellent.


31-31: Fixed run step to reference lib/main.ex
Stage 2+ docs now refer to lib/main.ex—all references are consistent.

compiled_starters/elixir/.codecrafters/compile.sh (1)

11-12: Good implementation of the escript build process.

The script now builds the Elixir escript and moves it to a consistent temporary location for execution. This aligns well with the upgrade to Elixir 1.18 and the new execution approach.

Consider these minor improvements for robustness:

 mix escript.build
+mkdir -p /tmp/codecrafters-build-redis-elixir
 mv codecrafters_redis /tmp/codecrafters-build-redis-elixir
starter_templates/elixir/code/.codecrafters/run.sh (1)

11-11: Proper execution of the compiled escript.

The use of exec is appropriate here as it replaces the current process with the executable, avoiding an extra shell process. Passing all arguments ($@) ensures flexibility for future extensions.

solutions/elixir/01-jm1/code/.codecrafters/run.sh (1)

11-11: Consistent execution approach with the starter template.

The solution script correctly uses the same execution pattern as the starter template, maintaining consistency throughout the codebase.

compiled_starters/elixir/lib/main.ex (2)

5-5: Minor formatting change.

Added whitespace has no functional impact.


27-36: Well-structured CLI module for escript entry point.

The new CLI module with main/1 function serves as a clean entry point for the escript, properly starting the application and keeping it running. This approach aligns with Elixir best practices for standalone applications.

For future maintainability, consider these enhancements:

 defmodule CLI do
+  @moduledoc """
+  Command-line interface entry point for the Redis server escript
+  """
+
+  @doc """
+  Main entry point for the escript
+  
+  Starts the application and keeps it running indefinitely
+  """
   def main(_args) do
     # Start the Server application
-    {:ok, _pid} = Application.ensure_all_started(:codecrafters_redis)
+    case Application.ensure_all_started(:codecrafters_redis) do
+      {:ok, _started} -> 
+        # Run forever
+        Process.sleep(:infinity)
+      {:error, reason} ->
+        IO.puts(:stderr, "Failed to start application: #{inspect(reason)}")
+        System.halt(1)
+    end
-
-    # Run forever
-    Process.sleep(:infinity)
   end
 end
starter_templates/elixir/config.yml (1)

2-3: Configuration values properly quoted for consistency.

The changes correctly quote the required_executable and user_editable_file values, which aligns with best practices for YAML configuration files. These changes also match the broader updates in this PR where the main entry point has been renamed from lib/server.ex to lib/main.ex.

starter_templates/elixir/code/.codecrafters/compile.sh (1)

11-12: Build process improved to use escript.

The script now properly builds the Elixir project as an escript executable and moves it to a temporary directory for later execution. This aligns with the new approach of using a compiled binary instead of running through the Mix runtime, which should improve startup performance.

solutions/elixir/01-jm1/code/lib/main.ex (1)

5-5: Whitespace added for better readability.

The added whitespace after the module documentation improves code readability and maintains consistent spacing throughout the file.

dockerfiles/elixir-1.18.Dockerfile (3)

13-14: Proper installation of Hex and Rebar.

The Dockerfile correctly installs Hex and Rebar package managers with the --force flag, ensuring they are installed even if they already exist, which helps prevent build failures.


17-18: Dependency management looks good.

The Dockerfile correctly fetches and compiles dependencies using Mix commands, which is the standard approach for Elixir projects.


21-21: Build script execution.

Running the .codecrafters/compile.sh script is consistent with the changes made to the script itself, which now builds the escript executable.

solutions/elixir/01-jm1/diff/lib/main.ex.diff (3)

6-6: Trivial whitespace change

This is just a minor change adding a whitespace line after the module documentation. It improves readability slightly but has no functional impact.


26-29: Server implementation now enabled

The previously commented code for the TCP server functionality has been uncommented, enabling the core Redis server functionality. This change properly enables the TCP socket with appropriate options including reuseaddr: true to prevent "Address already in use" errors during frequent restarts.


33-41: Well-implemented CLI entrypoint for escript

The new CLI module provides a clean entrypoint for the escript binary. The implementation correctly:

  1. Starts the Redis server application using Application.ensure_all_started/1
  2. Keeps the process running indefinitely with Process.sleep(:infinity)

This pattern aligns with Elixir best practices for escript executables.

compiled_starters/elixir/your_program.sh (2)

11-19: Proper implementation of escript build process

The script now correctly builds an escript executable with mix escript.build and then moves it to a consistent location /tmp/codecrafters-build-redis-elixir. Good use of a subshell with proper directory handling via cd "$(dirname "$0")" to ensure the script runs in the correct context.


25-25: Updated execution to use compiled binary

The execution command now correctly runs the compiled escript binary instead of using mix run. Using exec properly replaces the current process, and "$@" correctly passes all command-line arguments to the executable.

solutions/elixir/01-jm1/code/your_program.sh (2)

11-19: Proper implementation of escript build process

The script now correctly builds an escript executable with mix escript.build and then moves it to a consistent location /tmp/codecrafters-build-redis-elixir. Good use of a subshell with proper directory handling via cd "$(dirname "$0")" to ensure the script runs in the correct context.


25-25: Updated execution to use compiled binary

The execution command now correctly runs the compiled escript binary instead of using mix run. Using exec properly replaces the current process, and "$@" correctly passes all command-line arguments to the executable.

starter_templates/elixir/code/lib/main.ex (2)

5-5: Trivial whitespace change

This is just a minor change adding a whitespace line after the module documentation. It improves readability slightly but has no functional impact.


28-36: Well-implemented CLI entrypoint for escript

The new CLI module provides a clean entrypoint for the escript binary. The implementation correctly:

  1. Starts the Redis server application using Application.ensure_all_started/1
  2. Keeps the process running indefinitely with Process.sleep(:infinity)

This pattern aligns with Elixir best practices for escript executables and matches the implementation in the solution file.

compiled_starters/elixir/mix.exs (5)

7-7: App name update aligns with project requirements.

Renaming from :redis to :codecrafters_redis provides better namespace isolation for the package, avoiding potential conflicts with other Redis-related packages.


9-9: Elixir version constraint update.

Appropriate version constraint update to align with the PR objective of upgrading to Elixir 1.18.


10-12: Project configuration enhancements.

Good addition of escript configuration with CLI as the main module, supporting the new build approach. Also, nice to explicitly reference the deps function for better maintainability.


16-16: Helpful inline documentation.

Useful reference to Mix help for better developer experience.


24-30: Well-structured dependencies function.

Clean implementation of the deps function with helpful commented examples for adding dependencies from Hex or Git.

solutions/elixir/01-jm1/code/mix.exs (5)

7-7: App name update aligns with project requirements.

Renaming from :redis to :codecrafters_redis provides better namespace isolation for the package, avoiding potential conflicts with other Redis-related packages.


9-9: Elixir version constraint update.

Appropriate version constraint update to align with the PR objective of upgrading to Elixir 1.18.


10-12: Project configuration enhancements.

Good addition of escript configuration with CLI as the main module, supporting the new build approach. Also, nice to explicitly reference the deps function for better maintainability.


16-16: Helpful inline documentation.

Useful reference to Mix help for better developer experience.


24-30: Well-structured dependencies function.

Clean implementation of the deps function with helpful commented examples for adding dependencies from Hex or Git.

starter_templates/elixir/code/mix.exs (5)

7-7: App name update aligns with project requirements.

Renaming from :redis to :codecrafters_redis provides better namespace isolation for the package, avoiding potential conflicts with other Redis-related packages.


9-9: Elixir version constraint update.

Appropriate version constraint update to align with the PR objective of upgrading to Elixir 1.18.


10-12: Project configuration enhancements.

Good addition of escript configuration with CLI as the main module, supporting the new build approach. Also, nice to explicitly reference the deps function for better maintainability.


16-16: Helpful inline documentation.

Useful reference to Mix help for better developer experience.


24-30: Well-structured dependencies function.

Clean implementation of the deps function with helpful commented examples for adding dependencies from Hex or Git.

starter_templates/rust/config.yml (1)

2-2: Consistent version bump to Cargo 1.86
The required_executable value has been correctly updated from the previous cargo (1.82) to cargo (1.86), aligning this starter template with the new Rust toolchain version.

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

29-29: README Cargo version updated to 1.86
The instruction now correctly specifies cargo (1.86) for stages 2 and beyond, matching the updated toolchain across your Rust templates and solutions.

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

10-11: Rust language_pack bumped to 1.86
The comment and the language_pack: rust-1.86 setting have been updated from 1.85 to 1.86, ensuring the runner uses the intended Rust version.

compiled_starters/rust/README.md (1)

29-29: Compiled starter docs require Cargo 1.86
The README for the compiled starter now instructs users to have cargo (1.86) installed, keeping documentation in sync with the new version.

compiled_starters/rust/codecrafters.yml (1)

10-11: Compiled starter language_pack updated to rust-1.86
Both the available versions comment and language_pack: rust-1.86 have been adjusted, aligning this configuration with the rest of the Rust ecosystem updates.

solutions/rust/02-rg2/code/codecrafters.yml (1)

10-11: Consistent Rust version bump is correct

The Available versions comment and language_pack setting have been updated from rust-1.85 to rust-1.86, matching the rest of the Rust configurations in this PR.

dockerfiles/rust-1.86.Dockerfile (1)

1-2: Verify BuildKit support for Dockerfile syntax

You're specifying # syntax=docker/dockerfile:1.7-labs to leverage BuildKit features. Ensure your CI and local build environments enable BuildKit, otherwise this Dockerfile may fail to parse.

solutions/rust/02-rg2/diff/README.md.diff (1)

27-28: ⚠️ Potential issue

Cargo version requirement is inconsistent

The README still instructs users to install cargo (1.82), but all tooling and Docker images in this PR target Rust/Cargo 1.86. This mismatch will confuse users and lead to setup failures.

Proposed fix:

- 1. Ensure you have `cargo (1.82)` installed locally
+ 1. Ensure you have `cargo (1.86)` installed locally

Likely an incorrect or invalid review comment.

starter_templates/typescript/config.yml (1)

2-2: Upgrade bun version in starter template.
The required_executable field has been bumped from 1.1 to 1.2, aligning this template with the updated runtime in the PR objectives.

solutions/typescript/01-jm1/code/README.md (1)

29-29: Bump bun runtime requirement to 1.2 in solution README.
This change ensures that the documentation matches the updated starter and solution configurations.

solutions/typescript/02-rg2/code/codecrafters.yml (1)

10-11: Update language_pack to bun-1.2.
The available versions comment and language_pack setting have been updated from bun-1.1 to bun-1.2, keeping the environment definition in sync with the rest of the TS solutions.

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

10-11: Runtime version update applied correctly.
The # Available versions comment and language_pack value have been updated to bun-1.2, aligning with the PR objective to upgrade the runtime to v1.2.

dockerfiles/bun-1.2.Dockerfile (1)

2-2: Base image version aligns with PR objective.
Using oven/bun:1.2-alpine correctly reflects the upgrade to Bun v1.2.

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

Fix invalid Docker COPY flag.

The --exclude flag is not supported by Docker's COPY instruction. Docker's official documentation recommends using .dockerignore file instead to exclude files from the build context.

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

Create a .dockerignore file with the following contents:

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

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

(DL1000)

@@ -1,3 +1,3 @@
attributes:
required_executable: cargo (1.82)
required_executable: cargo (1.86)
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 no residual references to Cargo 1.82
To ensure full consistency, please search the repo for any lingering mentions of 1.82 in other configs or docs.

Run this from the repository root:


🏁 Script executed:

#!/usr/bin/env bash
# Check for any remaining references to Cargo 1.82
rg -n "1\\.82"

Length of output: 264


Update remaining Cargo 1.82 references
The repo still contains references to Cargo 1.82. Please update them to 1.86 to match the new requirement:

  • solutions/rust/02-rg2/diff/README.md.diff (line 28):
    Change “cargo (1.82)” to “cargo (1.86)
  • solutions/rust/02-rg2/code/README.md (line 29):
    Change “cargo (1.82)” to “cargo (1.86)
  • dockerfiles/rust-1.82.Dockerfile (line 2):
    Change FROM rust:1.82-bookworm to FROM rust:1.86-bookworm

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 Docker COPY flags will break the build

The --exclude flags on COPY are not supported in standard Dockerfile syntax (Hadolint DL1000). Instead, use a .dockerignore file to exclude unwanted files and simplify the instruction.

Proposed fix:

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

Add a .dockerignore alongside your Dockerfile:

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

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

(DL1000)

Comment on lines +27 to +28
-1. Ensure you have `bun (1.2)` installed locally
+1. Ensure you have `bun (1.1)` installed locally
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Inconsistent bun version requirement in README.
This diff reverts the local setup instruction back to bun (1.1), conflicting with the rest of the PR which upgrades to bun-1.2. Please update this line to match the new runtime requirement.

Suggested fix:

-1. Ensure you have `bun (1.1)` installed locally
+1. Ensure you have `bun (1.2)` installed locally
📝 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
-1. Ensure you have `bun (1.2)` installed locally
+1. Ensure you have `bun (1.1)` installed locally
1. Ensure you have `bun (1.2)` installed locally

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 flags in COPY instruction.
The Docker COPY command doesn’t support --exclude flags (Hadolint DL1000). To prevent copying .git and README.md, use a .dockerignore file instead of flags.

Proposed change:

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

And add a .dockerignore in the repo root:

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

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

(DL1000)

@andy1li andy1li merged commit 7b7c02e into main May 14, 2025
32 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