Skip to content

ref(preprod): Call status check tasks synchronously#112120

Merged
NicoHinderling merged 2 commits into
masterfrom
nicohinderling/ref/sync-preprod-status-check-tasks
Apr 2, 2026
Merged

ref(preprod): Call status check tasks synchronously#112120
NicoHinderling merged 2 commits into
masterfrom
nicohinderling/ref/sync-preprod-status-check-tasks

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

@NicoHinderling NicoHinderling commented Apr 2, 2026

Replace apply_async calls with direct synchronous invocations for preprod
status check tasks in the approval endpoint and GitHub check run webhook handler.

This ensures status checks run inline rather than being dispatched to the Celery
task queue, giving immediate feedback on approval actions.

sentry URL for tracking the latency of our status check tasks

Replace apply_async calls with direct synchronous invocations for
preprod status check tasks in both the approval endpoint and the
GitHub check run webhook handler.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 2, 2026
@NicoHinderling NicoHinderling marked this pull request as ready for review April 2, 2026 16:52
@NicoHinderling NicoHinderling requested a review from a team as a code owner April 2, 2026 16:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Backend Test Failures

Failures on a17f297 in this run:

tests/sentry/preprod/vcs/webhooks/test_github_check_run.py::HandlePreprodCheckRunEventTest::test_creates_approval_for_valid_requestlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py:196: in test_creates_approval_for_valid_request
    mock_task.apply_async.assert_called_once_with(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:988: in assert_called_once_with
    raise AssertionError(msg)
E   AssertionError: Expected 'apply_async' to be called once. Called 0 times.

Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_approve.py
Comment thread src/sentry/preprod/vcs/webhooks/github_check_run.py
Copy link
Copy Markdown
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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/sentry/preprod/vcs/webhooks/github_check_run.py
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_approve.py Outdated
Comment thread src/sentry/preprod/vcs/webhooks/github_check_run.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Backend Test Failures

Failures on 3d8b020 in this run:

tests/sentry/preprod/vcs/webhooks/test_github_check_run.py::HandlePreprodCheckRunEventTest::test_allows_different_user_to_create_new_approvallog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py:400: in test_allows_different_user_to_create_new_approval
    handle_preprod_check_run_event(
src/sentry/preprod/vcs/webhooks/github_check_run.py:231: in handle_preprod_check_run_event
    raise ValueError(f"Unknown identifier: {identifier}")
E   ValueError: Unknown identifier: approve_size
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py::HandlePreprodCheckRunEventTest::test_checks_latest_approval_not_firstlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py:451: in test_checks_latest_approval_not_first
    handle_preprod_check_run_event(
src/sentry/preprod/vcs/webhooks/github_check_run.py:231: in handle_preprod_check_run_event
    raise ValueError(f"Unknown identifier: {identifier}")
E   ValueError: Unknown identifier: approve_size
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py::HandlePreprodCheckRunEventTest::test_creates_approval_for_valid_requestlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py:178: in test_creates_approval_for_valid_request
    handle_preprod_check_run_event(
src/sentry/preprod/vcs/webhooks/github_check_run.py:231: in handle_preprod_check_run_event
    raise ValueError(f"Unknown identifier: {identifier}")
E   ValueError: Unknown identifier: approve_size
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py::HandlePreprodCheckRunEventTest::test_creates_approvals_for_all_sibling_artifactslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py:221: in test_creates_approvals_for_all_sibling_artifacts
    handle_preprod_check_run_event(
src/sentry/preprod/vcs/webhooks/github_check_run.py:231: in handle_preprod_check_run_event
    raise ValueError(f"Unknown identifier: {identifier}")
E   ValueError: Unknown identifier: approve_size
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py::HandlePreprodCheckRunEventTest::test_skips_duplicate_approval_from_same_userlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py:367: in test_skips_duplicate_approval_from_same_user
    handle_preprod_check_run_event(
src/sentry/preprod/vcs/webhooks/github_check_run.py:231: in handle_preprod_check_run_event
    raise ValueError(f"Unknown identifier: {identifier}")
E   ValueError: Unknown identifier: approve_size

@NicoHinderling NicoHinderling force-pushed the nicohinderling/ref/sync-preprod-status-check-tasks branch from c5818b4 to fb41378 Compare April 2, 2026 17:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

Backend Test Failures

Failures on aaa026f in this run:

tests/sentry/preprod/vcs/webhooks/test_github_check_run.py::HandlePreprodCheckRunEventTest::test_creates_approval_for_valid_requestlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/preprod/vcs/webhooks/test_github_check_run.py:196: in test_creates_approval_for_valid_request
    mock_task.apply_async.assert_called_once_with(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/unittest/mock.py:988: in assert_called_once_with
    raise AssertionError(msg)
E   AssertionError: Expected 'apply_async' to be called once. Called 0 times.

Update assertion from apply_async to direct call to match the
synchronous invocation pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@NicoHinderling NicoHinderling merged commit df00d46 into master Apr 2, 2026
65 checks passed
@NicoHinderling NicoHinderling deleted the nicohinderling/ref/sync-preprod-status-check-tasks branch April 2, 2026 18:15
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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