Skip to content
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

[SQLite] [CC-1642] Upgrade Gleam to 1.9 #126

Merged
merged 1 commit into from
Mar 11, 2025
Merged

[SQLite] [CC-1642] Upgrade Gleam to 1.9 #126

merged 1 commit into from
Mar 11, 2025

Conversation

andy1li
Copy link
Member

@andy1li andy1li commented Mar 11, 2025

Summary by CodeRabbit

  • Documentation

    • Updated installation instructions to specify Gleam version 1.9.1 as the required minimum.
  • New Features

    • Introduced a new Docker build option supporting Gleam 1.9.1, enhancing the setup process.
  • Chores

    • Aligned configuration settings across tooling by updating language pack versions and version attributes to maintain consistency.

@andy1li andy1li self-assigned this Mar 11, 2025
Copy link

linear bot commented Mar 11, 2025

Copy link

coderabbitai bot commented Mar 11, 2025

Walkthrough

The pull request updates the Gleam programming language version requirements across various starter and configuration files. Both README files and configuration files now specify a fixed minimum version (1.9.1 or gleam-1.9) instead of a range. In addition, a new Dockerfile for Gleam 1.9.1 has been introduced with defined build steps and caching mechanisms.

Changes

File(s) Change Summary
compiled_starters/gleam/README.md
solutions/gleam/01-dr6/code/README.md
Updated minimum Gleam version from 1.0+ to 1.9.1 in the installation instructions.
compiled_starters/gleam/codecrafters.yml
solutions/gleam/01-dr6/code/codecrafters.yml
Updated the language_pack version from gleam-1.6 to gleam-1.9 and updated associated comments.
starter_templates/gleam/config.yml Changed the required_executable from gleam (1.0+) to gleam (1.9.1).
dockerfiles/gleam-1.9.Dockerfile Added a new Dockerfile for Gleam 1.9.1 with defined build instructions, environment variables, and caching steps.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Docker as Docker Daemon
    participant Base as Base Image (gleam:v1.9.1)
    participant Build as Build Process

    Dev->>Docker: Run "docker build"
    Docker->>Base: Pull base image "ghcr.io/gleam-lang/gleam:v1.9.1-erlang-alpine"
    Docker->>Build: Set working directory (/app) and define environment variables
    Docker->>Build: Copy project files (exclude .git and README.md)
    Docker->>Build: Execute "gleam build" for dependency management
    Docker->>Build: Create cache directory (/app-cached) and move build artifacts
    Docker->>Dev: Complete build process
Loading

Poem

I'm a happy rabbit with a coding flair,
Gleam's new version hops in with care.
Docker builds with a nifty pace,
Configs updated—a joyful space.
Hopping along in code and cheer,
I celebrate change with a spring so dear!
🥕🐇


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d193f07 and af111e3.

📒 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-dr6/code/README.md (1 hunks)
  • solutions/gleam/01-dr6/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 (11)
  • 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 (rust)
  • GitHub Check: test_course_definition / test (kotlin)
  • GitHub Check: test_course_definition / test (java)
  • GitHub Check: test_course_definition / test (go)
  • GitHub Check: test_course_definition / test (gleam)
  • GitHub Check: test_course_definition / test (csharp)
  • GitHub Check: test_course_definition / test (cpp)
  • GitHub Check: test_course_definition / test (c)
🔇 Additional comments (8)
starter_templates/gleam/config.yml (1)

2-2: Fixed Version Requirement Update:
The required_executable attribute has been updated from a version range (implied by the previous "1.0+") to a fixed version "gleam (1.9.1)". This ensures that all users are mandated to use the specified Gleam version for consistency.

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

10-11: Language Pack Version Update:
The configuration now specifies language_pack: gleam-1.9 with an updated comment indicating the available version. This change aligns the configuration with the fixed minimum version requirement and promotes consistency across the project files.

compiled_starters/gleam/README.md (1)

32-32: Installation Instruction Update:
The installation instructions have been updated to require gleam (1.9.1), ensuring that users install the correct and expected version. This documentation update is consistent with the configuration changes in other parts of the project.

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

32-32: Version Requirement Clarity:
The README now states clearly that users need to have gleam (1.9.1) installed locally. This update removes ambiguity around the Gleam version requirement and aligns with the changes on other fronts.

compiled_starters/gleam/codecrafters.yml (1)

10-11: Language Pack Configuration Consistency:
The language_pack field has been updated to gleam-1.9 along with the corresponding comment reflecting the available version. This change brings consistency with the other Gleam-related configuration files in the repository.

dockerfiles/gleam-1.9.Dockerfile (3)

1-2: Update Dockerfile syntax and base image
The Dockerfile correctly sets the required Docker syntax and uses the Gleam 1.9.1 base image, ensuring the build environment meets the new version specification.


4-7: Define Dependency File Paths and Working Directory
The environment variable CODECRAFTERS_DEPENDENCY_FILE_PATHS is properly defined to trigger rebuilds when gleam.toml or manifest.toml change, and the working directory /app is appropriately set.


12-17: Cache and Build Dependencies
The use of RUN gleam build to force dependency download and the subsequent commands to cache the build output (creating /app-cached and moving the build directory) are well implemented to optimize subsequent builds.

Comment on lines +9 to +10
# .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

Fix COPY Command Invalid Flag Usage
The COPY command uses unsupported flags (--exclude), which is flagged by static analysis. Docker does not support --exclude on the COPY instruction. Instead, use a .dockerignore file to exclude .git and README.md. For example:

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

Then, create a .dockerignore file (if not already present) at the repository root with the following entries:

.git
README.md

This approach will prevent the specified files from being copied into the image and avoid cache misses.

📝 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
# .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)

@andy1li andy1li merged commit 138fb54 into main Mar 11, 2025
26 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