-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(backup): Don't assign is_unclaimed
in global import
#57738
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
Scope: Backend
Automatically applied to PRs that change backend components
label
Oct 6, 2023
azaslavsky
force-pushed
the
azaslavsky/backup/fix_dangling_exports
branch
from
October 7, 2023 00:12
a79ef11
to
0ee6c61
Compare
azaslavsky
force-pushed
the
azaslavsky/backup/is_unclaimed_global
branch
from
October 7, 2023 00:12
6b863b7
to
be1b748
Compare
hubertdeng123
approved these changes
Oct 10, 2023
Base automatically changed from
azaslavsky/backup/fix_dangling_exports
to
azaslavsky/backup/unique_coverage
October 11, 2023 00:27
azaslavsky
force-pushed
the
azaslavsky/backup/unique_coverage
branch
from
October 11, 2023 00:34
e00a6af
to
6a1db02
Compare
azaslavsky
force-pushed
the
azaslavsky/backup/is_unclaimed_global
branch
from
October 11, 2023 00:38
be1b748
to
f3b2188
Compare
azaslavsky
changed the base branch from
azaslavsky/backup/unique_coverage
to
azaslavsky/backup/fix_dangling_exports
October 11, 2023 00:38
azaslavsky
force-pushed
the
azaslavsky/backup/fix_dangling_exports
branch
from
October 11, 2023 18:46
3ee1a9e
to
4b9415d
Compare
azaslavsky
force-pushed
the
azaslavsky/backup/is_unclaimed_global
branch
from
October 11, 2023 18:46
f3b2188
to
ac57677
Compare
There are a small number of models that have no unambiguous direct connection to their relocation scope's root model - these are called "dangling" models. The key factor that defines them, and makes them difficult to handle, is that we cannot use our "query already exported foreign keys" filtering methodology to select only the models relevant to our export targets, because these models have no foreign keys that connect them back to the root of that target. For example, `TimeSeriesSnapshot` has no foreign keys at all, see: https://tinyurl.com/27z4x6tk. In cases like the one above, we ended up exporting ALL of the `TimeSeriesSnapshot`s in the database - clearly a very bad outcome when we only want to export those related to a specific org! A better approach is to define custom filtering logic for these models, thereby enabling them to use "adjacent" models in the model graph to select only models that we care about for a given export. In the example above, we query all `Incident`s filtered down by our previous exports to get a sneak-peek at the set of `IncidentSnapshot`s (a set that is currently empty due to going in reverse dependency order), then use that information to work backwards to grab the `TimeSeriesSnapshot`s we need. The upshot is that this commit introduces a generic method for constructing filtered queries for a specific model, the overridable `query_for_relocation_export`. Issue: getsentry/team-ospo#203
Importing a user in `ImportScope.Global` should never result in them being marked `is_unclaimed`. Issue: getsentry/team-ospo@203
azaslavsky
force-pushed
the
azaslavsky/backup/fix_dangling_exports
branch
from
October 11, 2023 20:49
88c9bae
to
806b10c
Compare
azaslavsky
force-pushed
the
azaslavsky/backup/is_unclaimed_global
branch
from
October 11, 2023 20:49
ac57677
to
4da3918
Compare
Base automatically changed from
azaslavsky/backup/fix_dangling_exports
to
master
October 11, 2023 22:37
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Importing a user in
ImportScope.Global
should never result in them being markedis_unclaimed
.Issue: getsentry/team-ospo#203