Skip to content

feat(ci): add Claude Code GitHub Action for integration testing#517

Closed
MartianGreed wants to merge 1 commit intomainfrom
feat/claude-code-ci
Closed

feat(ci): add Claude Code GitHub Action for integration testing#517
MartianGreed wants to merge 1 commit intomainfrom
feat/claude-code-ci

Conversation

@MartianGreed
Copy link
Collaborator

@MartianGreed MartianGreed commented Jan 22, 2026

Summary

  • Add integration-test.yaml workflow for manual dispatch integration testing with Claude Code
  • Add claude-assistant.yaml workflow for interactive @claude mentions and test-integration label triggers
  • Include dojo-integration-test skill for running the full Dojo stack (katana, torii, sozo)

Setup Required

  1. Add ANTHROPIC_API_KEY to repository secrets
  2. Optionally create test-integration label

Usage

  • Manual: Actions → "Integration Test with Claude" → Run workflow (with optional PR number)
  • Interactive: Comment @claude on any PR/issue
  • Label: Add test-integration label to trigger

Summary by CodeRabbit

  • Documentation

    • Added two comprehensive skill guides: one for Dojo integration testing and one for updating gRPC proto bindings, including setup, workflows, verification, and troubleshooting.
  • Chores

    • Added CI workflows to run and orchestrate integration tests via manual dispatch, PRs, and comment triggers.
  • Tests

    • Improved benchmark timing support to enable more precise duration measurements.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Adds two Claude-driven GitHub Actions workflows, two new SKILL.md documentation artifacts, and a small benchmark timing declaration change for Bun nanoseconds; no public API or exported declarations were modified.

Changes

Cohort / File(s) Summary
Documentation Skills
\.claude/skills/dojo-integration-test/SKILL.md, \.claude/skills/update-grpc-proto/SKILL.md
Two new skill documents: a comprehensive Dojo integration-test guide and a detailed gRPC proto update workflow (procedures, commands, troubleshooting).
CI/CD Workflows
\.github/workflows/claude-assistant.yaml, \.github/workflows/integration-test.yaml
Two new GitHub Actions workflows: claude-assistant (comment/label-triggered Claude-driven actions) and integration-test (manual dispatch for integration tests with Dojo/Bun, PR ref handling, and Claude code-action invocation).
Benchmarking tweak
packages/grpc/src/benchmarks/effect-functional.bench.ts
Adds a global Bun declaration and uses Bun.nanoseconds() for benchmark timing measurement.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant GitHub as GitHub (Event)
participant Runner as Actions Runner
participant Repo as Repository
participant Dojo as Dojo/Bun Tooling
participant Claude as Claude API

GitHub->>Runner: trigger workflow (comment/label or manual dispatch)
Runner->>Repo: checkout code (incl. submodules, PR ref)
Runner->>Dojo: setup Dojo & Bun environments
Runner->>Repo: install/build dependencies
Runner->>Claude: invoke code-action (skill prompt, inputs, max_turns)
Claude->>Runner: return analysis/commands
Runner->>Dojo: execute integration/test commands
Dojo->>Runner: return test results/logs
Runner->>Claude: (optional) send results for follow-up
Runner->>GitHub: post status/comment

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped in docs and workflows bright,

Claudes now listen to comments at night,
Bun ticks the clock while Katana spins,
Contracts and tests twirl with soft grins,
I nibble the logs and celebrate the light.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding Claude Code GitHub Action for integration testing, which aligns with the core modifications across all files.
Description check ✅ Passed The description covers all required template sections with clear, actionable information: summary of changes, setup requirements, and usage instructions. However, the issue linking and checklist items are not explicitly addressed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

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

🤖 Fix all issues with AI agents
In @.claude/skills/dojo-integration-test/SKILL.md:
- Around line 15-18: The `asdf current` invocation in the SKILL.md incorrectly
passes multiple plugin names at once; update the documentation so the `asdf
current` command is used correctly by either showing a chained check for each
plugin (run `asdf current` for sozo, katana, torii, and scarb individually) or
by suggesting `asdf current` with no args to list all plugins; reference the
`asdf current` command and the plugin names sozo, katana, torii, scarb when
editing the example.

In @.github/workflows/claude-assistant.yaml:
- Around line 20-23: The workflow currently checks out code without resolving
the PR head ref (actions/checkout@v4 in the steps block), which causes
issue_comment triggers to use the default branch; add a step that resolves the
PR head ref (when the issue_comment targets a PR) using the GitHub API or
actions/github-script to find the PR for github.event.issue.number and output
the head.ref (e.g., set step id get_pr_head and output ref), then change the
actions/checkout step to use with: ref: ${{ steps.get_pr_head.outputs.ref }}
(falling back to github.ref or default branch when no PR is found).
- Around line 16-19: Add an explicit top-level permissions block to the workflow
so it only requests the minimal rights required (avoid relying on implicit
defaults); modify the workflow definition that contains the if condition for
triggering (the job using the claude-code-action trigger) to include a
permissions: mapping with at least contents: read, issues: write, and
pull-requests: write to ensure external contributors can trigger the action and
to make permissions explicit for reviewers.

In @.github/workflows/integration-test.yaml:
- Around line 23-26: Add an explicit minimal permissions block to the workflow
to restrict GITHUB_TOKEN scope: add a top-level permissions entry with
"contents: read" so the workflow (which uses actions/checkout@v4 and may run
with a pr_number input) only has read access to repository contents and cannot
access or exfiltrate secrets like ANTHROPIC_API_KEY; place this permissions
block at the workflow root (same level as on: and jobs:) to ensure it applies to
the entire workflow.
🧹 Nitpick comments (4)
.github/workflows/integration-test.yaml (1)

33-35: Consider pinning Bun version for reproducible builds.

Using bun-version: latest can lead to inconsistent CI behavior if Bun releases a breaking change. Consider pinning to a specific version (e.g., 1.1.x) for reproducibility.

Suggested fix
       - uses: oven-sh/setup-bun@v1
         with:
-          bun-version: latest
+          bun-version: "1.1.45"
.claude/skills/dojo-integration-test/SKILL.md (1)

168-197: Quick start workflow uses brittle sleep commands for service readiness.

Using fixed sleep durations is unreliable—services may start faster or slower depending on the environment. Consider polling with retries for more robust health checks.

Suggested improvement for health checks
# Instead of: sleep 2
# Use polling with timeout:
for i in {1..30}; do
  curl -s localhost:5050 > /dev/null && break
  sleep 1
done

# Similarly for torii:
for i in {1..30}; do
  curl -s localhost:8080/health > /dev/null && break
  sleep 1
done
.github/workflows/claude-assistant.yaml (2)

8-9: Unused trigger events opened and assigned on issues.

The job condition only checks for @claude in comments or the test-integration label. The opened and assigned events on issues will never satisfy the condition (unless the issue body/title contains @claude, which isn't checked). Consider removing these unused triggers to avoid confusion.

Suggested fix
   issues:
-    types: [opened, assigned, labeled]
+    types: [labeled]

30-32: Same concern: Consider pinning Bun version.

Consistent with the feedback on integration-test.yaml, consider pinning the Bun version for reproducible builds.

Comment on lines 15 to 28
1. **Required asdf plugins**: sozo, katana, torii, scarb
```bash
asdf current sozo katana torii scarb
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Incorrect asdf current command syntax.

asdf current accepts only one plugin name at a time, not multiple. This command will fail.

Suggested fix
 1. **Required asdf plugins**: sozo, katana, torii, scarb
    ```bash
-   asdf current sozo katana torii scarb
+   asdf current sozo && asdf current katana && asdf current torii && asdf current scarb
    ```

Alternatively, use asdf current without arguments to list all plugins, or check each individually.

📝 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
1. **Required asdf plugins**: sozo, katana, torii, scarb
```bash
asdf current sozo katana torii scarb
```
1. **Required asdf plugins**: sozo, katana, torii, scarb
🤖 Prompt for AI Agents
In @.claude/skills/dojo-integration-test/SKILL.md around lines 15 - 18, The
`asdf current` invocation in the SKILL.md incorrectly passes multiple plugin
names at once; update the documentation so the `asdf current` command is used
correctly by either showing a chained check for each plugin (run `asdf current`
for sozo, katana, torii, and scarb individually) or by suggesting `asdf current`
with no args to list all plugins; reference the `asdf current` command and the
plugin names sozo, katana, torii, scarb when editing the example.

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

🤖 Fix all issues with AI agents
In @.claude/skills/dojo-integration-test/SKILL.md:
- Around line 244-246: The Quick Start snippet uses an invalid multi-plugin call
"asdf current sozo katana torii scarb"; update it to invoke asdf current once
per plugin (e.g., replace that single line with four separate commands calling
"asdf current" for each plugin: sozo, katana, torii, and scarb) so the
documentation shows the correct usage and will work when copy-pasted.
♻️ Duplicate comments (1)
.claude/skills/dojo-integration-test/SKILL.md (1)

25-28: Incorrect asdf current command syntax was addressed per past review.

The fix from the previous review was applied here.

🧹 Nitpick comments (1)
packages/grpc/src/benchmarks/effect-functional.bench.ts (1)

1-7: Move the declare const Bun statement after all imports.

The global declaration is placed between the bun:test import and local imports, breaking the import grouping convention. Per coding guidelines, imports should be grouped: external dependencies → workspace packages → relative imports, with no interleaving declarations.

Suggested reordering
 import { describe, test, expect } from "bun:test";
-
-declare const Bun: { nanoseconds: () => number };
-
 import { ToriiGrpcClient } from "../torii-client";
 import { makeToriiClient } from "../torii-client-functional";
 import type { Query } from "@dojoengine/torii-wasm";
+
+declare const Bun: { nanoseconds: () => number };

Comment on lines +244 to +246
```bash
# 1. Check prerequisites
asdf current sozo katana torii scarb
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Same asdf current syntax issue in Quick Start section.

Line 246 uses the same incorrect multi-plugin syntax. The asdf current command only accepts one plugin name at a time.

Suggested fix
 # 1. Check prerequisites
-asdf current sozo katana torii scarb
+asdf current sozo && asdf current katana && asdf current torii && asdf current scarb
🤖 Prompt for AI Agents
In @.claude/skills/dojo-integration-test/SKILL.md around lines 244 - 246, The
Quick Start snippet uses an invalid multi-plugin call "asdf current sozo katana
torii scarb"; update it to invoke asdf current once per plugin (e.g., replace
that single line with four separate commands calling "asdf current" for each
plugin: sozo, katana, torii, and scarb) so the documentation shows the correct
usage and will work when copy-pasted.

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