Get a CI recipe for a saved test
get_ci_recipeGet a CI recipe for a saved test (permission: read)
The CI job that gates each pull or merge request on this saved test: it waits for the preview deploy, replays the journeys against it as a dry run (POST /targets/{id}/scans with url) and fails the job on a critical diff or a broken step. The YAML embeds only the API base, the target id and the pinned journey id, and reads the key from the ANALYTICSPROOF_API_KEY secret (an edit key; secret.where says where the platform keeps it). placement: on GitHub content is the whole workflow file at path; on GitLab (merge_job) and Bitbucket (merge_step) it is a fragment to merge into the existing file at path, never written over it. readiness.blockers are fixed in AnalyticsProof, not in the repository; readiness.warnings do not stop the job. journeys defaults to all when more than one journey of the test can run, else one; journeyId pins one journey (not with all). preview defaults to github_deployments on GitHub (the newest successful non-production deployment of the head commit) and placeholder elsewhere (fill in PREVIEW_URL); deploy_job (GitLab) takes previewJob, the job whose dotenv report sets PREVIEW_URL; pattern takes previewPattern, an http(s) URL that may use the CI variables of the platform. A refused value is 400 invalid_request on its parameter; a non-website target is 400 scan_type_mismatch; a journey of another target is 400 journey_mismatch on journeyId.
The job reads the API key from the CI secret the answer names; section 10 of https://analyticsproof.com/agents.md says how to provide it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"platform": "<platform>"
},
"name": "get_ci_recipe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Saved test id: from GET /targets or the POST /targets answer. | |
| preview | No | Where the job takes the preview URL from; default github_deployments on GitHub, placeholder elsewhere. | |
| journeys | No | Replay one journey or all runnable journeys of the test; default all when more than one can run and no journeyId is pinned, else one. | |
| platform | Yes | The CI platform the job is written for. | |
| journeyId | No | Pin one journey of this test (journeys=one). | |
| previewJob | No | With preview=deploy_job (GitLab): the deploy job named in needs:. | |
| previewPattern | No | With preview=pattern: the preview URL, e.g. https://deploy-preview-$BITBUCKET_PR_ID--site.netlify.app (GitHub: $GITHUB_HEAD_REF, $PR_NUMBER; GitLab: $CI_MERGE_REQUEST_IID, $CI_COMMIT_REF_SLUG; Bitbucket: $BITBUCKET_PR_ID). |