Skip to content

ref(seer): Propagate viewer_context to feedback Seer call sites#109714

Merged
azulus merged 2 commits intomasterfrom
viewer-context/feedback
Mar 4, 2026
Merged

ref(seer): Propagate viewer_context to feedback Seer call sites#109714
azulus merged 2 commits intomasterfrom
viewer-context/feedback

Conversation

@azulus
Copy link
Member

@azulus azulus commented Mar 2, 2026

Pass SeerViewerContext to all Seer API wrapper call sites in the feedback module.

PR #109697 added an optional viewer_context parameter to all Seer API wrapper functions. This PR updates the call sites in the feedback module to construct and pass SeerViewerContext from available org/user data:

  • Endpoints (organization_feedback_categories, organization_feedback_summary): Pass both organization_id and user_id
  • Ingest (create_feedback): Pass organization_id only (no user in ingest context)
  • Intermediate functions (spam_detection, label_generation, title_generation): Thread viewer_context parameter through to underlying API calls

No behavior change — viewer_context defaults to None which preserves the existing behavior of not sending the header.

Co-Authored-By: Claude noreply@anthropic.com

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Backend Test Failures

Failures on 3d7c81b in this run:

tests/sentry/feedback/usecases/ingest/test_create_feedback.py::test_create_feedback_issue_title_from_seerlog
tests/sentry/feedback/usecases/ingest/test_create_feedback.py:814: in test_create_feedback_issue_title_from_seer
    mock_get_feedback_title.assert_called_once_with(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:989: in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:977: in assert_called_with
    raise AssertionError(_error_message()) from cause
E   AssertionError: expected call not found.
E   Expected: get_feedback_title('The login button is broken and the UI is slow', 4557725013442560, True)
E     Actual: get_feedback_title('The login button is broken and the UI is slow', 4557725013442560, True, viewer_context={'organization_id': 4557725013442560})
tests/sentry/feedback/usecases/ingest/test_create_feedback.py::test_create_feedback_issue_titlelog
tests/sentry/feedback/usecases/ingest/test_create_feedback.py:781: in test_create_feedback_issue_title
    mock_get_feedback_title.assert_called_once_with(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:989: in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:977: in assert_called_with
    raise AssertionError(_error_message()) from cause
E   AssertionError: expected call not found.
E   Expected: get_feedback_title('This is a very long feedback message that describes multiple issues with the application including performance problems, UI bugs, and various other concerns that users are experiencing', 4557725042933760, False)
E     Actual: get_feedback_title('This is a very long feedback message that describes multiple issues with the application including performance problems, UI bugs, and various other concerns that users are experiencing', 4557725042933760, False, viewer_context={'organization_id': 4557725042933760})

azulus added 2 commits March 3, 2026 17:15
Pass SeerViewerContext to all Seer API wrapper call sites in the
feedback module. At API endpoints, both organization_id and user_id
are provided. In background tasks/ingest, only organization_id is
available. Intermediate functions thread the parameter through.
@azulus azulus force-pushed the viewer-context/feedback branch from 6f4ee1d to 9e4fbaa Compare March 4, 2026 01:15
@azulus azulus merged commit 50411f7 into master Mar 4, 2026
76 checks passed
@azulus azulus deleted the viewer-context/feedback branch March 4, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants