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

[Kafka] [CC-1642] Upgrade Gleam to 1.9 #26

Merged
merged 1 commit into from
Mar 11, 2025
Merged

[Kafka] [CC-1642] Upgrade Gleam to 1.9 #26

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 require Gleam version 1.9.1 for clarity.
  • Chores
    • Upgraded configuration dependencies to use the latest language pack version (gleam-1.9).
  • New Features
    • Introduced an updated container build configuration for Gleam 1.9.1, ensuring improved build reproducibility and consistency.

Update Gleam starter files to use Gleam 1.9.1, including:
- Updating codecrafters.yml to use gleam-1.9
- Modifying README to specify gleam (1.9.1)
- Adding Dockerfile for Gleam 1.9
- Updating starter template configuration
@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 changes update the Gleam version requirements and associated configuration settings across multiple files. Specifically, README files now require Gleam version 1.9.1 rather than a broad 1.0+ range, and configuration files update the language pack from gleam-1.4 to gleam-1.9. Additionally, a new Dockerfile for Gleam 1.9.1 has been added with build caching and dependency management commands.

Changes

File(s) Change Summary
compiled_starters/gleam/README.md
solutions/gleam/.../README.md
Updated Gleam version requirement from 1.0+ to 1.9.1.
compiled_starters/gleam/codecrafters.yml
solutions/gleam/.../codecrafters.yml
Upgraded language pack from gleam-1.4 to gleam-1.9.
starter_templates/gleam/config.yml Modified required_executable from gleam (1.0+) to gleam (1.9.1).
dockerfiles/gleam-1.9.Dockerfile Added new Dockerfile for Gleam 1.9.1 with updated build steps and caching commands.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant DS as Docker System
    participant Gleam as Gleam Build Process

    Dev->>DS: Trigger build using dockerfiles/gleam-1.9.Dockerfile
    DS->>DS: Set base image (v1.9.1) and environment variables
    DS->>DS: Copy files (excluding .git and README.md)
    DS->>Gleam: Execute `gleam build` to fetch dependencies
    DS->>DS: Cache build output in /app-cached
    DS-->>Dev: Return built Docker image
Loading

Poem

I hopped through lines of code with cheer,
Upgraded Gleam to 1.9.1, so clear.
Docker built my code with care,
Caching steps like carrots to share.
Happy hops in a world refined,
A coding tale by a rabbit, defined! 🐰🥕


🪧 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

🧹 Nitpick comments (1)
dockerfiles/gleam-1.9.Dockerfile (1)

15-17: Optimizing Build Layer Usage

The commands to create the caching directory and move the build output are correct. To optimize the Docker image by reducing the number of layers, consider combining these two commands into a single RUN instruction.

A suggested diff:

-# Cache build directory
-RUN mkdir -p /app-cached
-RUN mv build /app-cached/build
+# Cache build directory in a single layer
+RUN mkdir -p /app-cached && mv build /app-cached/build
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c5d115a and 0b42bb5.

📒 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-vi6/code/README.md (1 hunks)
  • solutions/gleam/01-vi6/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 (8)
  • GitHub Check: test_course_definition / test (rust)
  • GitHub Check: test_course_definition / test (python)
  • GitHub Check: test_course_definition / test (javascript)
  • 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)
🔇 Additional comments (9)
solutions/gleam/01-vi6/code/codecrafters.yml (1)

10-11: Updated Language Pack Version

The language pack has been updated to use gleam-1.9, which aligns with the new dependency requirements. Please verify that this version is supported by all related tooling.

compiled_starters/gleam/codecrafters.yml (1)

10-11: Consistent Update to Language Pack

The update to language_pack: gleam-1.9 ensures consistency across your configuration files. This clearly reflects the intended upgrade.

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

30-30: Revised Required Gleam Version in Documentation

The README now instructs users to have gleam (1.9.1) installed locally instead of a general version range. This update is critical in setting the correct expectations.

compiled_starters/gleam/README.md (1)

30-30: Updated Version Requirement in User Instructions

The change to require gleam (1.9.1) maintains documentation consistency with the other configuration files and ensures users install the correct version.

starter_templates/gleam/config.yml (1)

2-2: Refined Executable Requirement

The required_executable is now updated to gleam (1.9.1), which provides a precise version requirement and aligns with the documentation changes.

dockerfiles/gleam-1.9.Dockerfile (4)

1-2: Base Image and Docker Syntax Declaration are Correct

The Dockerfile correctly declares the Docker syntax version and uses the intended base image for Gleam v1.9.1.


4-5: Environment Variable Setup for Dependency Files

The comment and environment variable are clear in intent; they signal cache invalidation when either gleam.toml or manifest.toml changes.


7-7: Working Directory Declaration

Setting the working directory to /app is straightforward and appropriate for this build context.


12-13: Dependency Installation Step

The RUN gleam build command is used to force dependency downloads. This step is clear and aligns with the intended behavior for ensuring that all dependencies are present.

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

Review COPY Command Flags

The COPY command uses --exclude flags which are not officially supported by Docker’s COPY instruction, as confirmed by the Hadolint warning. Instead, consider using a .dockerignore file to exclude .git and README.md from the context.

A potential refactor diff for this change is:

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

Ensure you add a .dockerignore file in the repository root with the following entries:

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

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

(DL1000)

@andy1li andy1li merged commit 35f4fec into main Mar 11, 2025
20 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