Skip to content

Conversation

@scefali
Copy link
Contributor

@scefali scefali commented Feb 3, 2023

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).

@github-actions
Copy link
Contributor

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 Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@scefali scefali marked this pull request as ready for review March 9, 2023 19:54
@scefali scefali requested review from a team and wedamija March 9, 2023 19:54
Copy link
Member

@wedamija wedamija left a 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
Copy link
Member

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

Copy link
Contributor Author

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

Comment on lines 16 to 18
TASK_LOOKUP_BY_KEY = get_task_lookup_by_key()
SKIPPABLE_TASKS = get_skippable_tasks()
STATUS_LOOKUP_BY_KEY = get_status_lookup_by_key()
Copy link
Member

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.

Copy link
Contributor Author

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

Comment on lines 8 to 14
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,
)
Copy link
Member

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.

Copy link
Contributor Author

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

@scefali scefali merged commit 3085053 into master Mar 13, 2023
@scefali scefali deleted the feat/custom-model-org-onboarding branch March 13, 2023 15:48
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
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.

3 participants