Skip to content

ci: build evm single app on PRs#2381

Merged
chatton merged 3 commits into
mainfrom
cian/build-eth-app-on-prs
Jun 20, 2025
Merged

ci: build evm single app on PRs#2381
chatton merged 3 commits into
mainfrom
cian/build-eth-app-on-prs

Conversation

@chatton

@chatton chatton commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

Overview

I noticed the evm image isn't being pushed, the Dockerfile existed to be used for local testing (unsure if it's being actively used right now?)

This PR updates it to use a multi stage build, and pushes to the ghcr registry. This will allow for testing w/tastora

Summary by CodeRabbit

  • New Features
    • Added a new Docker image build and push process for the EVM single application, making it available as a separate image.
  • Chores
    • Renamed the main Docker image build workflow for clarity.
    • Updated workflow dependencies to reflect the new job names.
    • Improved the Dockerfile for the EVM single application to streamline and automate the build process.

@coderabbitai

coderabbitai Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The workflow for building Docker images was updated: the main job was renamed, and a new job was added to build and push a Docker image for the EVM single app. The EVM single app's Dockerfile was refactored to streamline and clarify the build process, removing manual instructions.

Changes

File(s) Change Summary
.github/workflows/test.yml Renamed build-docker-image job to build-rollkit-image; added build-rollkit-evm-single-image job; updated dependencies.
apps/evm/single/Dockerfile Refactored Dockerfile to improve build automation, dependency handling, and removed manual instructions.

Suggested reviewers

  • tac0turtle
  • alpe

Poem

A Docker hop, a workflow skip,
New images built with every pip.
The EVM single’s path made clear,
With tidy steps and code sincere.
A rabbit cheers with every run—
CI/CD is so much fun!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.

@github-actions

github-actions Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedJun 20, 2025, 10:03 AM

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Summary of Changes

Hello @chatton, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the continuous integration pipeline for the evm-single application by updating its Dockerfile. My primary goal is to enable the automated building and pushing of the evm-single Docker image to the GitHub Container Registry (GHCR) on pull requests, which will facilitate more robust and integrated testing, particularly with tastora.

Highlights

  • Dockerfile Refactor: I've refactored the apps/evm/single/Dockerfile to implement a multi-stage build process. This change streamlines the image creation by performing the Go binary compilation within the Dockerfile itself, rather than relying on a pre-built binary or external build steps.
  • Build Process Integration: The evm-single application's Go binary is now built directly inside the build-env stage of the Dockerfile using CGO_ENABLED=0 GOOS=linux go build -o evm-single .. This ensures a self-contained, statically linked binary suitable for the final Alpine image.
  • Dependency Addition: I've added ca-certificates to the final Alpine image (RUN apk --no-cache add ca-certificates). This is crucial for enabling secure network communication within the container, such as fetching external resources or interacting with APIs.
  • Binary Copy Path Update: The COPY --from=build-env instruction has been updated to reflect the correct path of the compiled binary within the build stage (/src/apps/evm/single/evm-single), ensuring the application executable is correctly placed in the final image.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Comment thread .github/workflows/test.yml Fixed
Comment thread .github/workflows/test.yml Dismissed
Comment thread .github/workflows/test.yml Dismissed
Comment thread .github/workflows/test.yml Dismissed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

The Dockerfile for the evm-single application was refactored to use a multi-stage build. The suggestions focus on optimizing the Docker build process by improving layer caching and reducing the final binary size.


WORKDIR /src

COPY . .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Consider copying go.mod and go.sum and running go mod download in a separate step before copying the source code to leverage Docker layer caching. This way, the dependency layer is only rebuilt when go.mod or go.sum change.

COPY go.mod go.sum ./
RUN go mod download
COPY . .


WORKDIR /src/apps/evm/single
RUN CGO_ENABLED=0 GOOS=linux go build -o evm-single .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Run go mod tidy before go build to prune unused dependencies. Also, use -ldflags="-s -w" to strip debugging information from the binary, reducing its size.

RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o evm-single .

@codecov

codecov Bot commented Jun 20, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.33%. Comparing base (bc16469) to head (45e36c7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2381   +/-   ##
=======================================
  Coverage   72.33%   72.33%           
=======================================
  Files          65       65           
  Lines        6315     6315           
=======================================
  Hits         4568     4568           
  Misses       1345     1345           
  Partials      402      402           
Flag Coverage Δ
combined 72.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatton
chatton marked this pull request as ready for review June 20, 2025 12:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (3)
.github/workflows/test.yml (2)

65-66: Scope the build context for faster Docker builds
Rather than context: ., consider context: apps/evm/single to reduce upload size and speed up the build.


41-49: Extract common build steps to DRY up the workflow
Both build-rollkit-image and build-rollkit-evm-single-image share identical checkout, buildx, and login steps. Consider moving them into a reusable workflow or composite action to reduce duplication.

apps/evm/single/Dockerfile (1)

13-13: Strip debug info to reduce binary size
Add linker flags to minimize the artifact:

- RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -o evm-single .
+ RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o evm-single .
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bc16469 and 45e36c7.

📒 Files selected for processing (2)
  • .github/workflows/test.yml (2 hunks)
  • apps/evm/single/Dockerfile (1 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeQL
.github/workflows/test.yml

[warning] 53-53: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash


[warning] 56-56: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash


[warning] 63-63: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash

🪛 Hadolint (2.12.0)
apps/evm/single/Dockerfile

[error] 5-5: Use COPY instead of ADD for files and folders

(DL3020)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary
🔇 Additional comments (3)
.github/workflows/test.yml (2)

17-18: Explicit package write permissions added
Limiting GITHUB_TOKEN to packages: write scopes the token appropriately for the Docker push step.


73-73: Update needs to reflect renamed job
The docker-tests job correctly depends on build-rollkit-image after renaming.

apps/evm/single/Dockerfile (1)

17-17: Ensure ca-certificates in final image
Installing CA certificates is crucial for HTTPS operations; this is a good inclusion.


- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Pin the setup-buildx-action to a full commit SHA
Using floating tags like @v3 can introduce unexpected updates. Pin to a specific commit or digest for immutability and reproducibility.

🧰 Tools
🪛 GitHub Check: CodeQL

[warning] 53-53: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step Uses Step uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash

🤖 Prompt for AI Agents
In .github/workflows/test.yml at line 53, the action
'docker/setup-buildx-action' is referenced using a floating tag '@v3', which can
lead to unexpected updates. Replace '@v3' with a specific full commit SHA to pin
the action version, ensuring immutability and reproducibility of the workflow.


- name: Log in to GHCR
uses: docker/login-action@v3
with:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Pin the login-action to a full commit SHA
Locking this action to a digest or commit prevents unexpected behavior from upstream changes.

🧰 Tools
🪛 GitHub Check: CodeQL

[warning] 56-56: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step Uses Step uses 'docker/login-action' with ref 'v3', not a pinned commit hash

🤖 Prompt for AI Agents
In .github/workflows/test.yml at line 56, the docker/login-action is currently
referenced by a version tag (v3). To prevent unexpected behavior from upstream
changes, update this reference to use a full commit SHA instead of the version
tag. Find the latest commit SHA for docker/login-action@v3 and replace "v3" with
that full commit SHA in the uses line.


- name: Build and push rollkit-evm-single Docker image
uses: docker/build-push-action@v6
with:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Pin the build-push-action to a full commit SHA
Switch from @v6 to a concrete SHA or digest to ensure consistent builds over time.

🧰 Tools
🪛 GitHub Check: CodeQL

[warning] 63-63: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Tests / Code Coverage' step Uses Step uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash

🤖 Prompt for AI Agents
In .github/workflows/test.yml at line 63, the usage of docker/build-push-action
is currently pinned to the version tag @v6, which can lead to inconsistent
builds as the tag may point to different commits over time. Replace @v6 with a
specific full commit SHA or digest from the action's repository to ensure the
workflow uses a fixed, immutable version of the action for consistent and
reproducible builds.

Comment on lines +5 to +10
ADD core core

# Uncomment the following lines to build the binary from source in the dockerfile directly
# WORKDIR /src/apps/evm/single
COPY go.mod go.sum ./
RUN go mod download

# RUN go mod tidy -compat=1.19 && \
# CGO_ENABLED=0 go build -o /src/evm-single .
COPY . .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Optimize Docker layer ordering and replace ADD

  • Replace ADD core core with COPY core core (Hadolint DL3020).
  • Move COPY go.mod go.sum and RUN go mod download before copying source files to leverage layer caching when dependencies don’t change.
🧰 Tools
🪛 Hadolint (2.12.0)

[error] 5-5: Use COPY instead of ADD for files and folders

(DL3020)

🤖 Prompt for AI Agents
In apps/evm/single/Dockerfile lines 5 to 10, replace the ADD instruction with
COPY for adding the core directory to follow best practices. Also, reorder the
Dockerfile commands to copy go.mod and go.sum and run go mod download before
copying the rest of the source files. This change optimizes Docker layer caching
by isolating dependency installation from source code changes.

@chatton
chatton added this pull request to the merge queue Jun 20, 2025
Merged via the queue into main with commit a6a3a94 Jun 20, 2025
47 of 48 checks passed
@chatton
chatton deleted the cian/build-eth-app-on-prs branch June 20, 2025 14:40
@github-project-automation github-project-automation Bot moved this to Done in Evolve Jun 20, 2025
@tac0turtle tac0turtle removed this from Evolve Aug 25, 2025
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.

4 participants