Skip to content

Commit e3ddc58

Browse files
authored
fix(onboarding): don't attempt to record onboarding tasks if onboardi… (#100180)
1 parent b76f207 commit e3ddc58

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

src/sentry/models/options/organization_option.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_value_bulk_id(
3636

3737
def get_value(
3838
self,
39-
organization: Organization,
39+
organization: Organization | int,
4040
key: str,
4141
default: Any | None = None,
4242
validate: Callable[[object], bool] | None = None,

src/sentry/models/organizationonboardingtask.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from sentry.db.models.fields.hybrid_cloud_foreign_key import HybridCloudForeignKey
2222
from sentry.db.models.fields.jsonfield import LegacyTextJSONField
2323
from sentry.db.models.manager.base import BaseManager
24+
from sentry.models.options.organization_option import OrganizationOption
2425
from sentry.utils import metrics
2526

2627

@@ -69,6 +70,13 @@ def record(
6970
f"status={status} unsupported must be {OnboardingTaskStatus.COMPLETE}."
7071
)
7172

73+
if options.get("sentry:skip-record-onboarding-tasks-if-complete"):
74+
onboarding_complete_option = OrganizationOption.objects.get_value(
75+
organization_id, "onboarding:complete", None
76+
)
77+
if onboarding_complete_option:
78+
return False
79+
7280
cache_key = f"organizationonboardingtask:{organization_id}:{task}"
7381

7482
if cache.get(cache_key) is None:

src/sentry/options/defaults.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3493,3 +3493,11 @@
34933493
default=False,
34943494
flags=FLAG_AUTOMATOR_MODIFIABLE,
34953495
)
3496+
3497+
# Skip recording onboarding tasks if organization onboarding is already complete
3498+
register(
3499+
"sentry:skip-record-onboarding-tasks-if-complete",
3500+
type=Bool,
3501+
default=False,
3502+
flags=FLAG_AUTOMATOR_MODIFIABLE,
3503+
)

0 commit comments

Comments
 (0)