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 org-based filtering to import/export #167

Closed
Tracked by #153
azaslavsky opened this issue Jul 27, 2023 · 0 comments · Fixed by getsentry/sentry#55430
Closed
Tracked by #153

Add org-based filtering to import/export #167

azaslavsky opened this issue Jul 27, 2023 · 0 comments · Fixed by getsentry/sentry#55430

Comments

@azaslavsky
Copy link

No description provided.

azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 16, 2023
This change contains a number of small improvements, including:

- Renaming some files for greater clarity
- Generalizing the `BackupTestCase` class, which creates an
  "exhaustive" database state for testing backups. We'll be using this
  much more in the future as we implement features like org-based
  filtering.
- Sped up `test_models` and `test_releases` considerably. These tests
  both inherit from `TransactionTestCase`, which already does the heavy
  lifting of rolling back any DB changes made during a test. However, we
  were also manually flushing the database during the `setUp` phase,
  resuling in a repeat of this super time consuming action. Removing it
  makes the average test case in one of these files go from ~6 seconds
  to less than 3!
- Because we are now running various tests with the `reset_pks` flag set
  to `True` or `False` depending on the behavior we want to exercise,
  I've added a check to `import_export_then_validate` to ensure that pks
  have either all changes or all stayed the same, depending on the flag
  setting.

Issue: getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 16, 2023
This change contains a number of small improvements, including:

- Renaming some files for greater clarity
- Generalizing the `BackupTestCase` class, which creates an "exhaustive"
database state for testing backups. We'll be using this much more in the
future as we implement features like org-based filtering.
- Sped up `test_models` and `test_releases` considerably. These tests
both inherit from `TransactionTestCase`, which already does the heavy
lifting of rolling back any DB changes made during a test. However, we
were also manually flushing the database during the `setUp` phase,
resuling in a repeat of this super time consuming action. Removing it
makes the average test case in one of these files go from ~6 seconds to
less than 3!
- Because we are now running various tests with the `reset_pks` flag set
to `True` or `False` depending on the behavior we want to exercise, I've
added a check to `import_export_then_validate` to ensure that pks have
either all changes or all stayed the same, depending on the flag
setting.

Issue: getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 16, 2023
This is part of a 4-step migration process, wherein we replace all use
of `__include_in_export__` with the more specific and useful
`__relocation_scope__`:

1. Define the new `ReloationScope` enum. (<- you are here)
2. Add the appropriate enum value to `__relocation_scope__` on all
models
3. Replace all code that interacts with `__include_in_export__` with
code that uses `__relocation_scope__` in the same way.
4. Remove all uses of `__include_in_export__`.

Issue: getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 30, 2023
This change allows us to filter imports by either user (in the user
scope) or organization (in the org scope). This allows, for example, a
subset of available users to be imported, or a subset of available
organizations from a large JSON dump.

Issue: getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 30, 2023
This feature allows user to control what subset of their database they
export, filtered by either user (when exporting in user scope) or
organisation (when exporting in org scope). The available filters are a
mirror of those offered for import scopes.

Closes getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 30, 2023
This change allows us to filter imports by either user (in the user
scope) or organization (in the org scope). This allows, for example, a
subset of available users to be imported, or a subset of available
organizations from a large JSON dump.

Issue: getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 30, 2023
This feature allows user to control what subset of their database they
export, filtered by either user (when exporting in user scope) or
organisation (when exporting in org scope). The available filters are a
mirror of those offered for import scopes.

Closes getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 30, 2023
This change allows us to filter imports by either user (in the user
scope) or organization (in the org scope). This allows, for example, a
subset of available users to be imported, or a subset of available
organizations from a large JSON dump.

Issue: getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 31, 2023
This feature allows user to control what subset of their database they
export, filtered by either user (when exporting in user scope) or
organisation (when exporting in org scope). The available filters are a
mirror of those offered for import scopes.

Closes getsentry/team-ospo#167
azaslavsky added a commit to getsentry/sentry that referenced this issue Aug 31, 2023
This feature allows user to control what subset of their database they
export, filtered by either user (when exporting in user scope) or
organisation (when exporting in org scope). The available filters are a
mirror of those offered for import scopes.

Closes getsentry/team-ospo#167
EricHasegawa pushed a commit to getsentry/sentry that referenced this issue Sep 6, 2023
This feature allows user to control what subset of their database they
export, filtered by either user (when exporting in user scope) or
organisation (when exporting in org scope). The available filters are a
mirror of those offered for import scopes.

Closes getsentry/team-ospo#167
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

Successfully merging a pull request may close this issue.

1 participant