feat(seer): Send referrer 'api.cli' on autofix API calls#965
Merged
Conversation
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).
Contributor
|
Contributor
Codecov Results 📊✅ 6963 passed | Total: 6963 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 14079 uncovered lines. 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 |
|
(was me asking jr) |
BYK
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
referrer: "api.cli"to the POST body for bothtriggerRootCauseAnalysisandtriggerSolutionPlanningso the Sentry backend can attribute autofix runs triggered from the CLI.Context
referrerfield toGroupAutofixEndpointCLI = "api.cli"enum value onAutofixReferrerThis PR is the CLI-side counterpart: it sends the
api.clireferrer string on every autofix POST so downstream analytics and Seer can identify CLI-initiated runs.Changes
src/lib/api/seer.ts— addreferrer: "api.cli"to the request body intriggerRootCauseAnalysisandtriggerSolutionPlanningtest/lib/api-client.seer.test.ts— update body assertions to expect the new field