GitHub pull request tests
When a pull request opens, InsightJet can make a ticket from it and test your app against that ticket. There are two ways:
- The GitHub App posts a comment on the pull request with a link to the ticket and a tick-box. Ticking the box starts a ticket run, and the comment shows the result.
- Your own workflow calls InsightJet with an API key, starts the test and reads the result.
Set up the GitHub App
Section titled “Set up the GitHub App”- Open Settings → Integrations → GitHub. Under Pull request tickets, click Connect the GitHub App and install it on your GitHub account or organization. To add another account, click Add another account. To remove one, uninstall the App on GitHub.
- Open Settings → Automations and add an automation: choose the Repository and Branch, tick A pull request opens, and choose Create a ticket. Only repositories you can see through the App are offered.
What happens on a pull request
Section titled “What happens on a pull request”- Someone opens a pull request against the watched branch.
- InsightJet makes a ticket from its title, description and changed files, and the App posts one comment with the ticket’s link and a Test this pull request box.
- Someone ticks the box. Anyone with write or admin access to the repository can do this; they need no InsightJet account. The test runs as the person who made the automation.
- The comment changes to Running, then to the result: passed, failed or could not check, with a link to the shared result when one can be made, and a Test again box.
Only pull requests by the repository’s owner, members and collaborators make a ticket. Others are skipped: no ticket and no comment. When the pull request is merged later, the same ticket is updated rather than a second one made.
The App keeps one comment per pull request and edits it in place, so a result is never posted twice.
Limits
Section titled “Limits”- 20 tests per GitHub App installation in any 24 hours, counted from ticks of the box. A tick that starts nothing does not count.
- A test uses the agent-hours of the person who made the automation. When they are out of hours, or all their agents are busy, the comment says so and the box comes back.
- Results are posted for runs up to 7 days old.
The Pull request tests panel on the GitHub settings page shows, for each account, how many tests were started in the last 24 hours, when the allowance frees up, the latest tests and how each went, and how many pull requests were skipped for their author.
From your own workflow
Section titled “From your own workflow”Your workflow can make the ticket and start the test itself, with an assistant (MCP) key; an API key (ijk_) is refused here. InsightJet also publishes a GitHub Action, InsightJet/run-tests, that makes these calls for you: see GitHub Actions.
You still need an automation in Settings → Automations that watches the repository and branch with A pull request opens.
- Make an assistant (MCP) key (see Keys) and save it as a repository secret, for example
INSIGHTJET_KEY. - When a pull request opens, send
POST https://insightjet.ai/api/github-action/pull-request-testswith the headerAuthorization: Bearer <key>and a JSON body. - If a test started, ask
GET https://insightjet.ai/api/github-action/ticket-runs/<ticketRunId>with the same header untilstillRunningisfalse.
The body:
| Field | Type | Required | What it is |
|---|---|---|---|
repoFullName | string | Yes | owner/repository |
prNumber | number | Yes | The pull request’s number |
title | string | Yes | Its title, up to 256 characters |
body | string | No | Its description, up to 65,536 characters |
author | string | Yes | The login of whoever opened it |
authorAssociation | string | Yes | GitHub’s author_association, such as MEMBER |
branch | string | Yes | The branch it is opened against |
changedFiles | string[] | No | File names it changes, up to 300 |
start | boolean | No | true to start a test now. Default false: the ticket is made, nothing runs |
Any other field is refused.
curl -s -X POST https://insightjet.ai/api/github-action/pull-request-tests \ -H "Authorization: Bearer $INSIGHTJET_KEY" \ -H "Content-Type: application/json" \ -d '{"repoFullName":"acme/shop","prNumber":42,"title":"Add coupon field","author":"dana","authorAssociation":"MEMBER","branch":"main","start":true}'The answers
Section titled “The answers”POST answers 200 with the ticket’s id and link, started, the ticketRunId of a started test, and appWillPost (whether the GitHub App will also comment). A pull request by someone the repository does not know answers skipped. A test that could not start answers started: false with a reason:
| Reason | Meaning |
|---|---|
daily_limit | The key has started its 20 runs for the last 24 hours. canStartAgainAt says when it frees up. |
already_running | A test of this ticket is still running. |
sign_in_expired | The InsightJet sign-in of the person who made the automation has expired. Ask them to sign in to InsightJet again. |
could_not_check | Anything else on InsightJet’s side. |
GET answers { "stillRunning": true }, or stillRunning: false with a verdict (passed, failed or could_not_check) and the comment text.
Other statuses: 400 for a body that is wrong, 401 for a missing or expired key, 403 when the key’s owner has left the key’s team, 404 when no automation watches that repository and branch (or the run is not one this key started), 413 for a body over 256 KB, 429 after more than 30 POSTs or 120 GETs a minute for one account (Retry-After says how long to wait), and 503 when the result could not be read just then.
Refusals on InsightJet’s side answer 200, so a refusal never has to fail your build. Print the answer and carry on.