Skip to content

feat(seer): Send referrer 'api.cli' on autofix API calls#965

Merged
BYK merged 1 commit into
mainfrom
hector/add-cli-autofix-referrer
May 14, 2026
Merged

feat(seer): Send referrer 'api.cli' on autofix API calls#965
BYK merged 1 commit into
mainfrom
hector/add-cli-autofix-referrer

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior Bot commented May 14, 2026

Add referrer: "api.cli" to the POST body for both triggerRootCauseAnalysis and triggerSolutionPlanning so the Sentry backend can attribute autofix runs triggered from the CLI.

Context

This PR is the CLI-side counterpart: it sends the api.cli referrer string on every autofix POST so downstream analytics and Seer can identify CLI-initiated runs.

Changes

  • src/lib/api/seer.ts — add referrer: "api.cli" to the request body in triggerRootCauseAnalysis and triggerSolutionPlanning
  • test/lib/api-client.seer.test.ts — update body assertions to expect the new field

Add `referrer: "api.cli"` to the POST body for both
`triggerRootCauseAnalysis` and `triggerSolutionPlanning` so the
Sentry backend can attribute autofix runs triggered from the CLI.

Depends on getsentry/sentry#115497 (accept referrer input) and
getsentry/sentry#115514 (register CLI referrer value).
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-965/

Built to branch gh-pages at 2026-05-14 10:41 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

6963 passed | Total: 6963 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 14079 uncovered lines.
✅ Project coverage is 77.12%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    77.12%    77.12%        —%
==========================================
  Files          320       320         —
  Lines        61521     61523        +2
  Branches         0         0         —
==========================================
+ Hits         47442     47444        +2
- Misses       14079     14079         —
- Partials         0         0         —

Generated by Codecov Action

@chromy chromy marked this pull request as ready for review May 14, 2026 10:46
@chromy
Copy link
Copy Markdown

chromy commented May 14, 2026

(was me asking jr)

@BYK BYK merged commit 41977f3 into main May 14, 2026
27 checks passed
@BYK BYK deleted the hector/add-cli-autofix-referrer branch May 14, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants