Skip to main content

Lab 9 - CI

Put an agent where it helps most and risks least: in CI, explaining failures. Push a change that breaks a test, open a pull request on your fork, and watch an agent explain your mistake in public. You keep the merge button.

Module9 - CI & Toolchain Integration
Time15 minutes
Shop presetclean: CI starts its own shop from the pinned image, whatever your local shop does
You needLab 0 done: your fork, and gh auth status signed in
You start fromYour fork, with your work of the day committed

Steps​

  1. Enable Actions on your fork: open its Actions tab on GitHub and confirm that you want to run its workflows. Three are provided in .github/workflows/:

    WorkflowRunsDoes
    run-tests.ymlon every push and pull requestruns the suite against the pinned shop and uploads the results
    agent-triage.ymlwhen a pull request's tests failposts one comment with the failed tests and, with a credential, an agent's root cause
    heal-suggestions.ymlwhen you start itturns heals into a suggestion pull request (the stretch goal)

    A fourth workflow builds this workshop's website. It runs only in the workshop's own repository, never on your fork.

  2. Optionally give the triage agent a credential. Without one, the lab still works: the comment then lists the failed tests, without an analysis. With one, an agent adds the root cause. Set a spending cap on any key first.

    You haveSet these secrets on your forkThe analysis comes from
    a Claude subscriptionCLAUDE_CODE_OAUTH_TOKEN, from claude setup-tokenthe Claude Code Action
    an Anthropic API keyANTHROPIC_API_KEYthe Claude Code Action
    a key for any OpenAI-compatible endpoint, for example your healing keyTRIAGE_MODEL, TRIAGE_BASE_URL, TRIAGE_API_KEYone call to that model
    gh secret set CLAUDE_CODE_OAUTH_TOKEN --repo <your-handle>/ai-engineering-robotframework

    gh secret set asks for the value, so it never lands in your shell history.

  3. Make a branch and break something. For example, change an expected value in a test you wrote today, or in tests/api/smoke.robot. Commit it yourself, in the terminal:

    git switch -c lab-09-break
    git commit -am "Break a test on purpose"
    git push -u origin lab-09-break
  4. Open a pull request on your fork, not on the workshop's repository:

    gh pr create --repo <your-handle>/ai-engineering-robotframework --base main --head lab-09-break --fill
  5. Watch the checks until they finish:

    gh pr checks --repo <your-handle>/ai-engineering-robotframework --watch
  6. Read the comment:

    gh pr view --repo <your-handle>/ai-engineering-robotframework --comments

    Does the root cause it names match what you broke? What evidence does it give? Would you trust it on a change you had not made yourself?

  7. Close the pull request without merging:

    gh pr close --repo <your-handle>/ai-engineering-robotframework lab-09-break

Stretch​

Start the heal-suggestion workflow from the Actions tab (Run workflow). It runs the suite against a drifted shop with healing on, and opens a pull request that proposes the heals as changes. Review it the way you triaged heals in Lab 8: merge nothing you would reject. It needs your healing model as the secrets HEAL_MODEL, HEAL_BASE_URL and HEAL_API_KEY; without them, it ends with a notice and changes nothing. Forks do not let GitHub Actions open pull requests by default: then the run's summary links the branch with the heals, and you open the pull request yourself.

Compare with the reference​

When you are done, compare your result with the reference: what the rehearsal produced, why it is a good result, and the answers the debrief covers. Open it after the lab: it gives the answers away.

If your agent fails​

This lab needs no agent of your own: the agent runs in CI. If Actions will not run on your fork, follow the recorded walkthrough of this lab.