Skip to content

Conversation

@MicBun
Copy link
Member

@MicBun MicBun commented Oct 20, 2025

compliment for our ghcr releases, so we don't broke it every single time

resolves: #86

Summary by CodeRabbit

  • Chores
    • CI pipeline updated to install required system dependencies, stop building one Docker image locally, and pull two pre-built images instead — speeding and simplifying builds.
    • Test setup made configurable to allow Docker image sources to be supplied via environment variables, enabling more flexible testing and deployment scenarios.
@MicBun MicBun requested a review from outerlook October 20, 2025 05:03
@MicBun MicBun self-assigned this Oct 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Walkthrough

CI workflow now installs system dependencies, stops building local Docker images, and pulls two pre-built images; test fixtures were updated to read container image names from environment variables with defaults.

Changes

Cohort / File(s) Summary
CI workflow
.github/workflows/ci.yaml
Added system deps installation step (apt-get update + patchelf); removed local build steps for tn-db and kwil-cli; replaced single image pull with a "Pull Docker images" step that pulls ghcr.io/trufnetwork/node:latest and kwildb/postgres:latest; formatting/line-break adjustments.
Test fixtures
tests/fixtures/test_trufnetwork.py
Replaced hard-coded container image strings with environment-variable-driven values: POSTGRES_CONTAINER.image = os.environ.get("POSTGRES_IMAGE", "kwildb/postgres:latest") and TN_DB_CONTAINER.image = os.environ.get("TN_DB_IMAGE", "ghcr.io/trufnetwork/node:latest").

Sequence Diagram(s)

sequenceDiagram autonumber actor GitHubActions as "GitHub Actions Runner" participant Shell as "Shell" participant Docker as "Docker" participant Tests as "pytest (tests/fixtures)" GitHubActions ->> Shell: checkout code GitHubActions ->> Shell: install system deps\n(apt-get update && install patchelf) Shell ->> Docker: pull ghcr.io/trufnetwork/node:latest Shell ->> Docker: pull kwildb/postgres:latest GitHubActions ->> Tests: run test suite Note right of Tests #DFF7DF: fixtures read images from\nenvironment variables with defaults Tests -->> Docker: start containers using images Tests ->> GitHubActions: report results 
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped into CI with a cheer,

Pulled images from the registry near,
Env vars whisper which images to use,
No local builds, just smoother cues,
A tiny rabbit dance for the new deploys here 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The primary changes to pull Docker images from GHCR and update test fixtures are in-scope. However, the addition of a dedicated system dependencies installation step (apt-get update and install patchelf) appears to be outside the stated objectives of using pre-built Docker images from GHCR. While this step may be necessary infrastructure for the CI to function properly, it is not directly related to the main objective and should either be documented as a supporting change or clarified as to why it is required in conjunction with the GHCR image migration. Clarify the necessity of the patchelf installation step and its relationship to the GHCR image migration. If it is required to support the pre-built images or resolve the CI failure, add a comment in the workflow or update the PR description to explain this dependency. Alternatively, if this is an unrelated fix, consider moving it to a separate PR to keep the changeset focused on the primary objective.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "chore: use pre-built Docker images from GHCR for CI" is clear, specific, and directly summarizes the main change in the changeset. The modifications to the CI workflow replace local Docker image builds with pulls from GHCR, and the test fixtures are updated to support dynamic image configuration—both of which align precisely with the title's stated objective. The title is concise and informative without unnecessary noise.
Linked Issues Check ✅ Passed The changes in this pull request address the primary objectives from issue #86. The CI workflow has been updated to pull pre-built Docker images from GHCR (ghcr.io/trufnetwork/node:latest and kwildb/postgres:latest) instead of building them locally, which directly addresses the root cause of the CI failure. The test fixtures now use environment variables that default to these latest GHCR images, ensuring the CI automatically pulls the latest versions without requiring code changes. These modifications align with the requirement to update CI to use pre-built Docker images from GHCR and ensure automatic pulls of the latest versions.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fixCi

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@pr-time-tracker
Copy link

pr-time-tracker bot commented Oct 20, 2025

Time Submission Status

Member Status Time Action Last Update
MicBun ✅ Submitted 2h Update time Oct 20, 2025, 3:12 PM
@outerlook ❌ Missing - ⚠️ Submit time -
Copy link
Contributor

@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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2ede88 and 0663d7c.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml (2 hunks)
  • tests/fixtures/test_trufnetwork.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test Native Build on macos-latest
  • GitHub Check: Test Docker Distribution (Linux)
  • GitHub Check: Test Native Build on ubuntu-latest
  • GitHub Check: test
🔇 Additional comments (2)
tests/fixtures/test_trufnetwork.py (1)

67-67: Good: Environment variable configuration enables runtime flexibility.

The environment-variable-based image configuration correctly aligns with the CI workflow and provides runtime flexibility without code changes.

Note: Consider pinning to a specific version tag instead of :latest for improved reproducibility in CI environments, though this is a minor concern.

.github/workflows/ci.yaml (1)

22-25: LGTM!

The system dependencies installation is properly implemented. patchelf is commonly required for Python binary extensions and Go-Python bindings like gopy.

Copy link
Contributor

@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)
.github/workflows/ci.yaml (1)

88-93: Consider explicitly setting image environment variables for clarity.

While the test fixtures default to the same image versions that the CI pulls (both use :latest), it would be clearer and more maintainable to explicitly set POSTGRES_IMAGE and TN_DB_IMAGE in the test step's environment. This ensures tests use the exact versions pulled by CI and makes the dependency explicit.

Apply this diff:

 - name: Run tests run: | source .venv/bin/activate pytest tests/test_*.py env: NODE_REPO_DIR: ${{ github.workspace }}/tmp-node + POSTGRES_IMAGE: kwildb/postgres:latest + TN_DB_IMAGE: ghcr.io/trufnetwork/node:latest

Based on past review comments.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0663d7c and e0057d8.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml (2 hunks)
  • tests/fixtures/test_trufnetwork.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (3)
tests/fixtures/test_trufnetwork.py (2)

59-59: Good improvement: Image is now configurable via environment variable.

Making the Postgres image configurable via the POSTGRES_IMAGE environment variable improves flexibility and testability. The default value (kwildb/postgres:latest) now matches what the CI workflow pulls, resolving the version mismatch noted in past reviews.


67-67: LGTM: Consistent configurability pattern.

The same environment variable pattern applied to the TN-DB container image provides consistent configurability across test fixtures. The default value correctly points to the GHCR image as intended by the PR.

.github/workflows/ci.yaml (1)

22-25: patchelf is actively used and required — no changes needed.

The concern in the review comment is incorrect. patchelf is used in the Makefile to set RPATH on the generated shared library _trufnetwork_sdk_c_bindings.so, which is created by the gopy build process. This fixes the shared library loading on Linux by allowing the library to locate its dependencies using $ORIGIN. The installation is essential for the build pipeline on Linux systems.

Likely an incorrect or invalid review comment.

@MicBun MicBun merged commit 03de495 into main Oct 20, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants