Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(hybridcloud) Move outbox tasks to sentry.hybridcloud #75739

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,8 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
"sentry.data_export.tasks",
"sentry.discover.tasks",
"sentry.hybridcloud.tasks.deliver_webhooks",
"sentry.hybridcloud.tasks.backfill_outboxes",
"sentry.hybridcloud.tasks.deliver_from_outbox",
Comment on lines +740 to +741
Copy link
Member Author

Choose a reason for hiding this comment

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

The tasks didn't have their names changed, so updating CELERY_IMPORTS should be all that is necessary for tasks to continue executing without interruption.

"sentry.incidents.tasks",
"sentry.integrations.github.tasks",
"sentry.integrations.github.tasks.pr_comment",
Expand All @@ -752,7 +754,6 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
"sentry.tasks.auth",
"sentry.tasks.auto_remove_inbox",
"sentry.tasks.auto_resolve_issues",
"sentry.tasks.backfill_outboxes",
"sentry.tasks.embeddings_grouping.backfill_seer_grouping_records_for_project",
"sentry.tasks.beacon",
"sentry.tasks.check_auth",
Expand All @@ -768,7 +769,6 @@ def SOCIAL_AUTH_DEFAULT_USERNAME() -> str:
"sentry.tasks.deletion.scheduled",
"sentry.tasks.deletion.groups",
"sentry.tasks.deletion.hybrid_cloud",
"sentry.tasks.deliver_from_outbox",
"sentry.tasks.digests",
"sentry.tasks.email",
"sentry.tasks.files",
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/hybridcloud/outbox/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ def handle_async_replication(self, region_name: str, shard_identifier: int) -> N
def run_outbox_replications_for_self_hosted(*args: Any, **kwds: Any) -> None:
from django.conf import settings

from sentry.hybridcloud.tasks.backfill_outboxes import backfill_outboxes_for
from sentry.models.outbox import OutboxBase
from sentry.tasks.backfill_outboxes import backfill_outboxes_for

if not settings.SENTRY_SELF_HOSTED:
return
Expand Down
2 changes: 2 additions & 0 deletions src/sentry/hybridcloud/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .backfill_outboxes import * # noqa
from .deliver_from_outbox import * # noqa
from .deliver_webhooks import * # noqa
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from django.conf import settings
from django.db.models import Max, Min

from sentry.hybridcloud.tasks.backfill_outboxes import backfill_outboxes_for
from sentry.models.outbox import ControlOutboxBase, OutboxBase, OutboxFlushError, RegionOutboxBase
from sentry.silo.base import SiloMode
from sentry.tasks.backfill_outboxes import backfill_outboxes_for
from sentry.tasks.base import instrumented_task
from sentry.utils import metrics
from sentry.utils.env import in_test_environment
Expand Down
5 changes: 4 additions & 1 deletion src/sentry/testutils/outbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
from django.core.handlers.wsgi import WSGIRequest

from sentry.hybridcloud.models.webhookpayload import THE_PAST, WebhookPayload
from sentry.hybridcloud.tasks.deliver_from_outbox import (
enqueue_outbox_jobs,
enqueue_outbox_jobs_control,
)
from sentry.models.outbox import OutboxBase
from sentry.silo.base import SiloMode
from sentry.tasks.deliver_from_outbox import enqueue_outbox_jobs, enqueue_outbox_jobs_control
from sentry.testutils.silo import assume_test_silo_mode


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

from sentry.db.models import BaseModel
from sentry.hybridcloud.outbox.base import run_outbox_replications_for_self_hosted
from sentry.hybridcloud.tasks.backfill_outboxes import (
backfill_outboxes_for,
get_backfill_key,
get_processing_state,
process_outbox_backfill_batch,
)
from sentry.models.authidentity import AuthIdentity
from sentry.models.authidentityreplica import AuthIdentityReplica
from sentry.models.authprovider import AuthProvider
Expand All @@ -13,12 +19,6 @@
from sentry.models.organizationmapping import OrganizationMapping
from sentry.models.outbox import ControlOutbox, RegionOutbox, outbox_context
from sentry.silo.base import SiloMode
from sentry.tasks.backfill_outboxes import (
backfill_outboxes_for,
get_backfill_key,
get_processing_state,
process_outbox_backfill_batch,
)
from sentry.testutils.factories import Factories
from sentry.testutils.helpers import override_options
from sentry.testutils.outbox import outbox_runner
Expand Down
Loading