Skip to content

Conversation

@roggenkemper
Copy link
Member

@roggenkemper roggenkemper commented Nov 26, 2025

adds the gen ai consent + hide ai features check to the llm issue detection - since we are still using an allow list, this won't have any immediate impact but will be a necessary check once we start expanding the scope of projects allowed

fixes https://linear.app/getsentry/issue/ID-1100/add-ai-consent-to-detection

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 26, 2025
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing feature flag in tests

The tests test_detect_llm_issues_no_transactions and test_detect_llm_issues_no_traces are missing the @with_feature("organizations:gen-ai-features") decorator. Since detect_llm_issues_for_project now checks for this feature flag and returns early if it's not enabled, these tests will exit before reaching the code paths they're trying to test, causing the tests to pass vacuously without actually validating the intended behavior.

tests/sentry/tasks/test_llm_issue_detection.py#L32-L36

@patch("sentry.tasks.llm_issue_detection.get_transactions_for_project")
def test_detect_llm_issues_no_transactions(self, mock_get_transactions):
mock_get_transactions.return_value = []
detect_llm_issues_for_project(self.project.id)

tests/sentry/tasks/test_llm_issue_detection.py#L40-L49

@patch("sentry.tasks.llm_issue_detection.random.sample")
def test_detect_llm_issues_no_traces(self, mock_sample, mock_get_transactions, mock_get_trace):
mock_transaction = Mock()
mock_transaction.name = "test_tx"
mock_transaction.project_id = self.project.id
mock_get_transactions.return_value = [mock_transaction]
mock_sample.side_effect = lambda x, n: x
mock_get_trace.return_value = None
detect_llm_issues_for_project(self.project.id)

Fix in Cursor Fix in Web


@linear
Copy link

linear bot commented Nov 26, 2025

@roggenkemper roggenkemper marked this pull request as ready for review November 26, 2025 19:52
@roggenkemper roggenkemper requested a review from a team as a code owner November 26, 2025 19:52
@roggenkemper roggenkemper merged commit 4ff17b8 into master Nov 26, 2025
67 checks passed
@roggenkemper roggenkemper deleted the roggenkemper/addconsentcheck branch November 26, 2025 20:27
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.

3 participants