Skip to content

chore(seer): Remove code-review-beta flag usages - backend - #132099

Draft
suejungshin wants to merge 1 commit into
masterfrom
sshin/sunset-cr-beta-flag
Draft

suejungshin wants to merge 1 commit into
masterfrom
sshin/sunset-cr-beta-flag

Conversation

@suejungshin

@suejungshin suejungshin commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Remove usages of code-review-beta flag in the backend so we can delete the flag completely that in a subsequent PR. There will be a separate PR for the frontend usages

Note, merge this first

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on cf02fdc in this run:

tests/sentry/integrations/cursor_origin/test_code_review.py::CodeReviewFromWebhookTest::test_a_merge_tells_seer_the_pull_request_closed — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/cursor_origin/test_code_review.py:180: in test_a_merge_tells_seer_the_pull_request_closed
    assert self.mock_seer.call_args.kwargs["path"] == "/v1/code_review/pr-closed"
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   AttributeError: 'NoneType' object has no attribute 'kwargs'
tests/sentry/integrations/cursor_origin/test_code_review.py::CodeReviewFromWebhookTest::test_a_service_account_author_is_reviewed_as_a_bot — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/cursor_origin/test_code_review.py:205: in test_a_service_account_author_is_reviewed_as_a_bot
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/integrations/cursor_origin/test_code_review.py::CodeReviewFromWebhookTest::test_an_app_author_is_reviewed_as_a_bot — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/cursor_origin/test_code_review.py:195: in test_an_app_author_is_reviewed_as_a_bot
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/integrations/cursor_origin/test_code_review.py::CodeReviewFromWebhookTest::test_an_opened_pull_request_is_reviewed — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/integrations/cursor_origin/test_code_review.py:154: in test_an_opened_pull_request_is_reviewed
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/test_preflight.py::TestCodeReviewPreflightService::test_allowed_when_beta_org_has_repo_settings_enabled — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/test_preflight.py:95: in test_allowed_when_beta_org_has_repo_settings_enabled
    assert result.allowed is True
E   AssertionError: assert False is True
E    +  where False = CodeReviewPreflightResult(allowed=False, settings=None, denial_reason=<PreflightDenialReason.ORG_NOT_ELIGIBLE_FOR_CODE_REVIEW: 'org_not_eligible_for_code_review'>).allowed
tests/sentry/seer/code_review/test_preflight.py::TestCodeReviewPreflightService::test_allowed_when_seer_added_and_code_review_beta_org_has_repo_settings — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/test_preflight.py:158: in test_allowed_when_seer_added_and_code_review_beta_org_has_repo_settings
    assert result.allowed is True
E   AssertionError: assert False is True
E    +  where False = CodeReviewPreflightResult(allowed=False, settings=None, denial_reason=<PreflightDenialReason.ORG_NOT_ELIGIBLE_FOR_CODE_REVIEW: 'org_not_eligible_for_code_review'>).allowed
tests/sentry/seer/code_review/webhooks/test_check_run.py::CheckRunEventWebhookTest::test_base_case — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_check_run.py:25: in test_base_case
    mock_task.delay.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'delay' to have been called once. Called 0 times.
tests/sentry/seer/code_review/test_preflight.py::TestCodeReviewPreflightService::test_denied_when_beta_org_has_no_repo_settings — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/test_preflight.py:77: in test_denied_when_beta_org_has_no_repo_settings
    assert result.denial_reason == PreflightDenialReason.REPO_CODE_REVIEW_DISABLED
E   AssertionError: assert <PreflightDen..._code_review'> == <PreflightDen...iew_disabled'>
E     
E     �[0m�[91m- repo_code_review_disabled�[39;49;00m�[90m�[39;49;00m
E     �[92m+ org_not_eligible_for_code_review�[39;49;00m�[90m�[39;49;00m
tests/sentry/seer/code_review/webhooks/test_check_run.py::CheckRunEventWebhookTest::test_check_run_enqueues_task_for_processing — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_check_run.py:106: in test_check_run_enqueues_task_for_processing
    mock_task.delay.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'delay' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_check_run.py::CheckRunEventWebhookTest::test_check_run_fails_when_action_missing — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_check_run.py:54: in test_check_run_fails_when_action_missing
    mock_logger.error.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'error' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_check_run.py::CheckRunEventWebhookTest::test_check_run_fails_when_external_id_missing — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_check_run.py:70: in test_check_run_fails_when_external_id_missing
    mock_logger.exception.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'exception' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_issue_comment.py::IssueCommentEventWebhookTest::test_skips_reaction_when_no_comment_id — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_issue_comment.py:134: in test_skips_reaction_when_no_comment_id
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_check_run.py::CheckRunEventWebhookTest::test_check_run_fails_when_external_id_not_numeric — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_check_run.py:91: in test_check_run_fails_when_external_id_not_numeric
    mock_logger.exception.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'exception' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_issue_comment.py::IssueCommentEventWebhookTest::test_success_case_uses_review_request_endpoint — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_issue_comment.py:155: in test_success_case_uses_review_request_endpoint
    self.mock_reaction.assert_called_once_with(
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:990: in assert_called_once_with
    raise AssertionError(msg)
E   AssertionError: Expected 'create_comment_reaction' to be called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_pull_request.py::PullRequestEventWebhookTest::test_pull_request_closed_draft_still_sends_to_seer — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_pull_request.py:386: in test_pull_request_closed_draft_still_sends_to_seer
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_close_sends_when_triggers_configured — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:453: in test_close_sends_when_triggers_configured
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_close_still_sends_for_draft_mr — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:347: in test_close_still_sends_for_draft_mr
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_review_request.py::RequestReviewTest::test_a_close_is_sent_to_the_closed_endpoint — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_review_request.py:113: in test_a_close_is_sent_to_the_closed_endpoint
    sent = self._sent()
           ^^^^^^^^^^^^
tests/sentry/seer/code_review/webhooks/test_review_request.py:83: in _sent
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_pull_request.py::PullRequestEventWebhookTest::test_pull_request_closed_uses_pr_closed_endpoint — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_pull_request.py:244: in test_pull_request_closed_uses_pr_closed_endpoint
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_close_uses_pr_closed_endpoint — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:215: in test_close_uses_pr_closed_endpoint
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_distinct_commits_are_not_deduped — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:714: in test_distinct_commits_are_not_deduped
    assert self.mock_seer.call_count == 2
E   AssertionError: assert 0 == 2
E    +  where 0 = <MagicMock name='make_seer_request' id='256220374177440'>.call_count
E    +    where <MagicMock name='make_seer_request' id='256220374177440'> = <test_merge_request.MergeRequestEventWebhookTest testMethod=test_distinct_commits_are_not_deduped>.mock_seer
tests/sentry/seer/code_review/webhooks/test_review_request.py::RequestReviewTest::test_a_denial_is_logged_with_its_reason — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_review_request.py:187: in test_a_denial_is_logged_with_its_reason
    assert logged["code_review.review_request.denied"]["denial_reason"] == (
E   AssertionError: assert <PreflightDen..._code_review'> == 'org_contributor_not_found'
E     
E     �[0m�[91m- org_contributor_not_found�[39;49;00m�[90m�[39;49;00m
E     �[92m+ org_not_eligible_for_code_review�[39;49;00m�[90m�[39;49;00m
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_duplicate_delivery_after_ttl_processes_again — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:685: in test_duplicate_delivery_after_ttl_processes_again
    assert self.mock_seer.call_count == 1
E   AssertionError: assert 0 == 1
E    +  where 0 = <MagicMock name='make_seer_request' id='256220385819488'>.call_count
E    +    where <MagicMock name='make_seer_request' id='256220385819488'> = <test_merge_request.MergeRequestEventWebhookTest testMethod=test_duplicate_delivery_after_ttl_processes_again>.mock_seer
tests/sentry/seer/code_review/webhooks/test_pull_request.py::PullRequestEventWebhookTest::test_pull_request_opened_uses_review_request_endpoint — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_pull_request.py:72: in test_pull_request_opened_uses_review_request_endpoint
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_review_request.py::RequestReviewTest::test_a_disabled_trigger_is_logged — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_review_request.py:197: in test_a_disabled_trigger_is_logged
    assert "code_review.review_request.trigger_disabled" in logged
E   AssertionError: assert 'code_review.review_request.trigger_disabled' in {'code_review.review_request.denied': {'organization_id': 4559215080898592, 'repository_id': 83, 'provider': 'github', 'event_type': 'pull_request', ...}}
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_duplicate_delivery_within_window_skipped — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:674: in test_duplicate_delivery_within_window_skipped
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_review_request.py::RequestReviewTest::test_a_draft_still_sends_its_close — log
[gw1] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_review_request.py:147: in test_a_draft_still_sends_its_close
    assert self._sent()["path"] == "/v1/code_review/pr-closed"
           ^^^^^^^^^^^^
tests/sentry/seer/code_review/webhooks/test_review_request.py:83: in _sent
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_merge_uses_pr_closed_endpoint — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:227: in test_merge_uses_pr_closed_endpoint
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_pull_request.py::PullRequestEventWebhookTest::test_pull_request_ready_for_review_action — log
[gw2] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_pull_request.py:158: in test_pull_request_ready_for_review_action
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.
tests/sentry/seer/code_review/webhooks/test_merge_request.py::MergeRequestEventWebhookTest::test_open_uses_review_request_endpoint — log
[gw0] linux -- Python 3.13.18 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/seer/code_review/webhooks/test_merge_request.py:171: in test_open_uses_review_request_endpoint
    self.mock_seer.assert_called_once()
/opt/hostedtoolcache/Python/3.13.18/arm64/lib/python3.13/unittest/mock.py:958: in assert_called_once
    raise AssertionError(msg)
E   AssertionError: Expected 'make_seer_request' to have been called once. Called 0 times.

... and 44 more failures.

This branch has not been deployed

No deployments
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.

1 participant