-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(onboarding): adds an onboarding backend #44141
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
Conversation
|
This pull request has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you label it "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
…-model-org-onboarding
wedamija
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, only have a few nits.
It might be worth commenting somewhere why we have this abstraction. Demo isn't visible to most sentry devs, so it might not be clear where this is being used.
|
|
||
|
|
||
| class OrganizationOnboardingTaskBackend(OnboardingTaskBackend): | ||
| MODEL = OrganizationOnboardingTask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I feel like we usually use all caps for constants, not class variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wedamija Yea I can change this
| TASK_LOOKUP_BY_KEY = get_task_lookup_by_key() | ||
| SKIPPABLE_TASKS = get_skippable_tasks() | ||
| STATUS_LOOKUP_BY_KEY = get_status_lookup_by_key() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Wondering if it makes sense just to use these functions directly, since they're just reading these as static values off of the model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wedamija I just did it this way to make the diff a little less bad
| from sentry.onboarding_tasks import ( | ||
| create_or_update_onboarding_task, | ||
| get_skippable_tasks, | ||
| get_status_lookup_by_key, | ||
| get_task_lookup_by_key, | ||
| try_mark_onboarding_complete, | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Often the convention when using the service abstraction is to just import it and access properties from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wedamija Let me fix this
This PR sets up an onboarding backend that can swap in a different model for
OrganizationOnboardingTask. The reason we want this is so the sandbox can use the onboarding tasks on the organization serializer which have a different model that's unique per user instead of per org (so each user can do their own onboarding).