-
Notifications
You must be signed in to change notification settings - Fork 53
[Redis] [CC-1642] Upgrade Gleam to 1.9 #292
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
Conversation
WalkthroughThe changes update the Gleam version requirements across multiple project files. The minimum version is now fixed at 1.9.1 for installation and configuration, replacing the previous flexible "1.0+" requirement or older language packs. A new Dockerfile is also introduced for building the project with Gleam 1.9.1. These updates ensure consistency in the versions used for both local development and Docker builds. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Docker as Docker Engine
participant Base as Base Image (Gleam 1.9.1)
Dev->>Docker: Run docker build using Gleam-1.9.Dockerfile
Docker->>Base: Pull base image (ghcr.io/gleam-lang/gleam:v1.9.1-erlang-alpine)
Docker->>Docker: Set environment variables and working directory (/app)
Docker->>Docker: Copy project files (excluding .git and README.md)
Docker->>Docker: Execute "gleam build" to fetch dependencies
Docker->>Docker: Create cache directory (/app-cached) and move build output
Docker-->>Dev: Build complete
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
compiled_starters/gleam/README.md
(1 hunks)compiled_starters/gleam/codecrafters.yml
(1 hunks)dockerfiles/gleam-1.9.Dockerfile
(1 hunks)solutions/gleam/01-jm1/code/README.md
(1 hunks)solutions/gleam/01-jm1/code/codecrafters.yml
(1 hunks)starter_templates/gleam/config.yml
(1 hunks)
🧰 Additional context used
🪛 Hadolint (2.12.0)
dockerfiles/gleam-1.9.Dockerfile
[error] 10-10: invalid flag: --exclude
(DL1000)
⏰ Context from checks skipped due to timeout of 90000ms (12)
- GitHub Check: test_course_definition / test (zig)
- GitHub Check: test_course_definition / test (typescript)
- GitHub Check: test_course_definition / test (swift)
- GitHub Check: test_course_definition / test (scala)
- GitHub Check: test_course_definition / test (rust)
- GitHub Check: test_course_definition / test (ocaml)
- GitHub Check: test_course_definition / test (kotlin)
- GitHub Check: test_course_definition / test (java)
- GitHub Check: test_course_definition / test (haskell)
- GitHub Check: test_course_definition / test (go)
- GitHub Check: test_course_definition / test (cpp)
- GitHub Check: test_course_definition / test (clojure)
🔇 Additional comments (10)
compiled_starters/gleam/codecrafters.yml (1)
10-11
: Update Language Pack Version:
The language pack is updated to "gleam-1.9", which aligns with the PR objective of upgrading Gleam. Ensure that this update is consistent with other configuration files across the project.solutions/gleam/01-jm1/code/codecrafters.yml (1)
10-11
: Align Language Pack Version:
The "language_pack" entry is now set to "gleam-1.9". This update maintains consistency with our upgrade objectives and the corresponding changes in other parts of the project.starter_templates/gleam/config.yml (1)
1-3
: Specify Required Gleam Version:
The "required_executable" attribute has been updated to "gleam (1.9.1)", replacing the previous flexible requirement. This enforceable version requirement helps ensure that users have the correct version installed.solutions/gleam/01-jm1/code/README.md (1)
29-29
: Update Local Gleam Installation Requirement:
The documentation now specifies that users must install "gleam (1.9.1)" locally, which directly supports our upgrade to Gleam 1.9.1. This change helps avoid version mismatch issues.compiled_starters/gleam/README.md (1)
29-29
: Document Gleam Version Requirement:
The README has been updated to instruct users to ensure "gleam (1.9.1)" is installed locally. This documentation change aligns with the overall version upgrade and maintains consistency across project guides.dockerfiles/gleam-1.9.Dockerfile (5)
1-2
: Dockerfile Base Image and Syntax Version are Correct.
The Dockerfile correctly specifies the Docker syntax version and updates the base image to Gleam v1.9.1.
4-6
: Environment Variable Configuration is Appropriate.
Defining theCODECRAFTERS_DEPENDENCY_FILE_PATHS
to trigger a rebuild on changes to dependency files (i.e.,gleam.toml
andmanifest.toml
) is a smart move for cache management.
7-8
: Working Directory is Set Correctly.
SettingWORKDIR
to/app
ensures that subsequent commands operate in the appropriate directory.
12-14
: Dependency Build Command is Correct.
Runninggleam build
forces dependencies to be downloaded, which is an appropriate step for ensuring a consistent build environment.
15-17
: Caching Strategy for Build Artifacts is Logical.
Creating a cache directory (/app-cached
) and moving the build output there should help optimize subsequent build processes.
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses | ||
COPY --exclude=.git --exclude=README.md . /app | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
COPY Command Misuse Detected.
The COPY
command is currently using the --exclude
flag, which is not a valid option in Dockerfiles (as flagged by Hadolint). To exclude .git
and README.md
, you should remove these flags from the command and instead list the files/directories to ignore in a .dockerignore
file.
Diff suggestion:
-COPY --exclude=.git --exclude=README.md . /app
+COPY . /app
Then, add the following entries to your .dockerignore
file:
.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.
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses | |
COPY --exclude=.git --exclude=README.md . /app | |
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses | |
COPY . /app |
🧰 Tools
🪛 Hadolint (2.12.0)
[error] 10-10: invalid flag: --exclude
(DL1000)
Summary by CodeRabbit
New Features
Documentation
Chores