Build CI/CD pipelines¶
The repository includes two main workflows and one supporting workflow. Both main workflows run the same Fluent API tests but differ in how they handle failures.
Workflow 1: Test Flight Booking Fluent - Kahu¶
File: test_adk_flight_booking_fluent_kahu.yml
This workflow runs the agent tests and, on failure, creates a GitHub issue and triggers the Kahu SRE Agent for automated root cause analysis.
graph LR
A[Run Tests] -->|Fail| B[Create Issue]
B --> C["Comment @kahu investigate"]
C --> D[Kahu SRE Agent]
D --> E[Post RCA to Issue]
How it works¶
-
Run tests with
continue-on-error: trueso the workflow continues past failures: -
Create a GitHub issue with the full test output embedded.
-
Comment
@kahu investigateon the issue, including the GitHub run ID and app name:- name: Comment @kahu investigate on issue run: | BODY="@kahu investigate test failure on github_${GITHUB_RUN_ID} for app ${APP}" gh issue comment "${ISSUE_NUM}" --body "${BODY}"This comment triggers the Kahu SRE Agent workflow, which fetches traces from Okahu Cloud, calls the SRE Agent API, and posts the root cause analysis back as a comment.
Workflow 2: Test Flight Booking Fluent - Claude + Okahu Eval¶
File: test_adk_flight_booking_fluent_auto_pr_claude_okahu_eval.yml
This workflow also runs the tests and creates an issue on failure, but goes further — it assigns Claude as an AI coding agent to investigate, fix the code, and run Okahu evaluations.
graph LR
A[Run Tests] -->|Fail| B[Create Issue]
B --> C["Comment /kahu investigate"]
C --> D[Assign Claude Agent]
D --> E[Claude Investigates & Fixes]
How it works¶
-
Run tests — same as Workflow 1, with traces sent to Okahu Cloud via
MONOCLE_EXPORTER: okahu. -
Create a GitHub issue with test output.
-
Comment
/kahu investigatewith constraints that tell Claude to wait for the Kahu analysis before proceeding:- name: Comment /kahu investigate on issue run: | BODY="/kahu investigate test failure on github_${GITHUB_RUN_ID} for app ${APP} Constraints: - You must wait for the return response of /kahu before calling other MCPs. - Then quote the response so the analysis is recognized from /kahu itself. - Do NOT create a PR. - Do NOT push commits. - Only investigate and post findings as an issue comment." gh issue comment "${ISSUE_NUM}" --body "${BODY}" -
Assign Claude to the issue using the GitHub GraphQL API:
- name: Assign Claude agent run: | ISSUE_NODE_ID="$(gh api "repos/.../issues/${ISSUE_NUM}" --jq .node_id)" QUERY="mutation { addAssigneesToAssignable(input: { assignableId: \"${ISSUE_NODE_ID}\", assigneeIds: [\"BOT_kgDODnPHJg\"] }) { ... } }" gh api graphql -f query="$QUERY"Once assigned, Claude reads the issue, waits for Kahu's analysis, then investigates the failure using Okahu MCP tools.
Key difference¶
| Kahu workflow | Claude + Okahu Eval workflow | |
|---|---|---|
| Failure response | Automated RCA posted as comment | Claude investigates, fixes code, runs evals |
| Agent | Kahu SRE Agent (analysis only) | Claude Code (analysis + code changes) |
| Kahu trigger | @kahu (direct) |
/kahu (via Claude, with constraints) |
| Permissions | contents: read |
contents: write, pull-requests: write |
Kahu SRE Agent workflow¶
File: kahu_sre_agent.yml
This supporting workflow is triggered by @kahu mentions in issue bodies or comments. It is not run directly — it is invoked by the two workflows above.
What it does¶
- Extracts the query from the
@kahucomment (e.g.,investigate test failure on github_12345 for app my_app) - Resolves trace IDs by calling the Okahu API with the GitHub run ID
- Calls the Kahu SRE Agent API with the query and trace context
- Posts the analysis back as a comment on the issue
if: |
github.event.sender.login == github.repository_owner &&
(
(github.event_name == 'issues' && contains(github.event.issue.body, '@kahu')) ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@kahu'))
)
Owner-only trigger
The workflow only fires when github.event.sender.login == github.repository_owner. This is why you must fork the repository — the workflow won't trigger for non-owners.
Running the workflows¶
- Go to the Actions tab in your forked repository
- Select either workflow from the left sidebar
- Click Run workflow to trigger it manually
Start with Kahu
Run the Kahu workflow first to see the automated RCA flow. Once you're comfortable with how traces and issues work, try the Claude + Okahu Eval workflow for the full autonomous remediation loop.