On an eventNeeds a repository

Write the missing tests

A PR with passing checks

A nightly schedule starts an agent that finds untested code, writes the tests and opens a pull request by morning.

View .md

Best for

  • Codebases with thin coverage on code that changes often
  • Teams that review tests in the morning

Uses

  • A connected GitHub repository
  • A Project
  • An automation with a schedule trigger

Automation · Nightly tests

POST /o/{org}/p/{project}/automations/{automation}/triggers
promptFind the least-tested module changed in the last week, write tests for its untested paths, and open a pull request. Keep production code unchanged.
{
  "kind": "schedule",
  "config": {
    "cron": "0 2 * * *",
    "timezone": "America/Los_Angeles"
  }
}
Fig. The automation: its prompt, and the trigger that starts a run. Field names are the API's.

Watch it work, then read what comes back

GET /o/{org}/sessions/{session}/events
event: tool_usebash · git log --since=7.days --stat
event: thinkingrefunds.ts changed 9 times and has no tests for partial refunds.
event: tool_usewrite · refunds.test.ts
event: tool_result18 passed
event: messageOpened a pull request with 6 new tests.
Fig. The live stream while it works. Event names are the stream's.
GET /o/{org}/sessions/{session}
status
completed
branch
rush/tests-refunds
pr_url
github.com/acme/payments/pull/…
total_cost_usd
0.52
Fig. The session when it ends. Field names are the API's.

Steps

  1. 01

    Pick the Project

    The schedule runs in the Project's repository, with its skills and connections.

  2. 02

    Add a schedule

    A schedule trigger takes a cron expression and a timezone, or every for a fixed interval.

  3. 03

    Read the morning pull request

    Each night opens one pull request on its own branch. Failing checks end the run needs_review.

In the API and the docs