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

Add "custom" relocation scope for models that, situationally, fit best in one or another #186

Closed
Tracked by #153
azaslavsky opened this issue Aug 14, 2023 · 0 comments

Comments

@azaslavsky
Copy link

azaslavsky commented Aug 14, 2023

After #166 is successfully added, most import/export operations will be successfully described the single __relocation_scope__ attribute on Sentry models. There are, however, a small smattering of Sentry models that require more nuanced handling. In particular, instances of the model may sometimes fit better in one scope or another, depending on that particulars of that instance itself.

Consider NotificationAction. The naive thing to do would be to give it a global relocation scope, since it depends on Integration and SentryApp. But both of those dependencies are actually optional. That means that for instances of the model where at least one is set, that instance is in the global scope. When neither is set, the instance can (and should!) be exported in the organization scope.

The basic outline for how to handle this would be to add a Variable entry to the RelocationScope enum, which would then signal to the exporter/importer that the model definition itself has a special method (perhaps __resolve_relocation_scope__()?) that will derive and return the correct relocation scope for any give instance of the model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant