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

Migration for all the model changes for Project Templates #69816

Merged
merged 30 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0f7c7aa
Create ProjectTemplate model
saponifi3d Apr 26, 2024
1154167
remove the OptionManager stuff for now
saponifi3d Apr 26, 2024
194b552
update the project model to have a fk to template
saponifi3d Apr 26, 2024
8ca2a60
register the new models
saponifi3d Apr 26, 2024
af76c06
create a migration for the model changes
saponifi3d Apr 26, 2024
bb07c95
Use the DefaultFieldsModel to ensure consistency with other models
saponifi3d Apr 29, 2024
deab365
make this a post deployment migration since it will affect every project
saponifi3d Apr 29, 2024
ae63294
redo migration since there have been a few
saponifi3d Apr 29, 2024
f697d04
add basic tests, these are mostly to help me later
saponifi3d Apr 29, 2024
c5aea00
Don't take down sentry.
saponifi3d Apr 30, 2024
13fd88b
Add constraint to project template names for each org. Chnage 'projec…
saponifi3d Apr 30, 2024
e18aa5d
regenerate the migration based on the model changes
saponifi3d Apr 30, 2024
e325072
region_silo_only_model -> region_silo_model
saponifi3d Apr 30, 2024
1e1f67d
Updating migration version
saponifi3d Apr 30, 2024
95e0f5a
update to new migration
saponifi3d May 2, 2024
2c6b0fb
resolve migration merge conflict
saponifi3d May 2, 2024
8b91242
fixtures and snapshot updates
saponifi3d May 3, 2024
7f0c77b
first pass at updating the helpers/backup.
saponifi3d May 4, 2024
4bd3027
fix merge conflict with test clean pkgs.
saponifi3d May 4, 2024
62d3ab0
add freeze time to the sanitize test, this fixes issue with data_upda…
saponifi3d May 4, 2024
cee26cf
add a todo to make sure to go back and link the project templates cor…
saponifi3d May 4, 2024
44caa0a
update snapshot to fix test
saponifi3d May 4, 2024
8a820c9
update snapshot
saponifi3d May 4, 2024
9aa7a1e
update snapshot
saponifi3d May 4, 2024
865455b
update snapshots
saponifi3d May 4, 2024
4ffdcf1
ignore the date added field
saponifi3d May 7, 2024
2cca59c
Update snapshot to use the compartor for date_updated and date_added
saponifi3d May 7, 2024
c792ceb
Regenerate migration after merge conflict
saponifi3d May 7, 2024
b65de61
Fix merge conflict
saponifi3d May 15, 2024
fe5a369
regenerate model dependencies
saponifi3d May 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 52 additions & 1 deletion fixtures/backup/model_dependencies/detailed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4087,6 +4087,11 @@
"kind": "FlexibleForeignKey",
"model": "sentry.organization",
"nullable": false
},
"template": {
"kind": "FlexibleForeignKey",
"model": "sentry.projecttemplate",
"nullable": true
}
},
"model": "sentry.project",
Expand Down Expand Up @@ -4386,6 +4391,52 @@
]
]
},
"sentry.projecttemplate": {
"dangling": false,
"foreign_keys": {
"organization": {
"kind": "FlexibleForeignKey",
"model": "sentry.organization",
"nullable": false
}
},
"model": "sentry.projecttemplate",
"relocation_dependencies": [],
"relocation_scope": "Organization",
"silos": [
"Region"
],
"table_name": "sentry_projecttemplate",
"uniques": [
[
"name",
"organization"
]
]
},
"sentry.projecttemplateoption": {
"dangling": false,
"foreign_keys": {
"project_template": {
"kind": "FlexibleForeignKey",
"model": "sentry.projecttemplate",
"nullable": false
}
},
"model": "sentry.projecttemplateoption",
"relocation_dependencies": [],
"relocation_scope": "Organization",
"silos": [
"Region"
],
"table_name": "sentry_projecttemplateoption",
"uniques": [
[
"key",
"project_template"
]
]
},
"sentry.projecttransactionthreshold": {
"dangling": false,
"foreign_keys": {
Expand Down Expand Up @@ -6148,4 +6199,4 @@
]
]
}
}
}
11 changes: 9 additions & 2 deletions fixtures/backup/model_dependencies/flat.json
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@
"sentry.projectdebugfile"
],
"sentry.project": [
"sentry.organization"
"sentry.organization",
"sentry.projecttemplate"
],
"sentry.projectartifactbundle": [
"sentry.artifactbundle",
Expand Down Expand Up @@ -606,6 +607,12 @@
"sentry.project",
"sentry.team"
],
"sentry.projecttemplate": [
"sentry.organization"
],
"sentry.projecttemplateoption": [
"sentry.projecttemplate"
],
"sentry.projecttransactionthreshold": [
"sentry.organization",
"sentry.project",
Expand Down Expand Up @@ -845,4 +852,4 @@
"social_auth.usersocialauth": [
"sentry.user"
]
}
}
114 changes: 58 additions & 56 deletions fixtures/backup/model_dependencies/sorted.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,15 @@
"sentry.organizationmapping",
"sentry.organizationoption",
"sentry.perfstringindexer",
"sentry.project",
"sentry.projectintegration",
"sentry.projectkey",
"sentry.projectoption",
"sentry.projectownership",
"sentry.projectplatform",
"sentry.projectredirect",
"sentry.rawevent",
"sentry.projecttemplate",
"sentry.projecttemplateoption",
"sentry.regionimportchunk",
"sentry.regionoutbox",
"sentry.regionscheduleddeletion",
"sentry.regiontombstone",
"sentry.regressiongroup",
"sentry.relay",
"sentry.relayusage",
"sentry.repository",
"sentry.repositoryprojectpathconfig",
"sentry.reprocessingreport",
"sentry.scheduleddeletion",
"sentry.sentryshot",
"sentry.stringindexer",
Expand All @@ -53,21 +44,14 @@
"sentry.user",
"sentry.useravatar",
"sentry.userip",
"sentry.useroption",
"sentry.userpermission",
"sentry.userrole",
"sentry.userroleuser",
"social_auth.usersocialauth",
"sentry.savedsearch",
"sentry.relocation",
"sentry.release",
"sentry.recentsearch",
"sentry.promptsactivity",
"sentry.projecttransactionthresholdoverride",
"sentry.projecttransactionthreshold",
"sentry.projectteam",
"sentry.projectcodeowners",
"sentry.projectbookmark",
"sentry.project",
"sentry.processingissue",
"sentry.orgauthtoken",
"sentry.organizationslugreservation",
Expand All @@ -82,20 +66,15 @@
"sentry.integrationexternalproject",
"sentry.identity",
"sentry.grouptombstone",
"sentry.group",
"sentry.fileblobowner",
"sentry.file",
"sentry.featureadoption",
"sentry.externalissue",
"sentry.externalactor",
"sentry.exporteddata",
"sentry.eventprocessingissue",
"sentry.eventattachment",
"sentry.environment",
"sentry.email",
"sentry.distribution",
"sentry.discoversavedquery",
"sentry.deploy",
"sentry.deletedteam",
"sentry.deletedproject",
"sentry.dashboardtombstone",
Expand All @@ -114,67 +93,59 @@
"sentry.appconnectbuild",
"sentry.apikey",
"sentry.apiapplication",
"sentry.activity",
"replays.replayrecordingsegment",
"hybridcloud.orgauthtokenreplica",
"hybridcloud.organizationslugreservationreplica",
"hybridcloud.externalactorreplica",
"hybridcloud.apikeyreplica",
"feedback.feedback",
"sentry.userreport",
"sentry.useroption",
"sentry.useremail",
"sentry.teamkeytransaction",
"sentry.snubaquery",
"sentry.sentryapp",
"sentry.rule",
"sentry.reprocessingreport",
"sentry.repositoryprojectpathconfig",
"sentry.relocationvalidation",
"sentry.relocationfile",
"sentry.releasethreshold",
"sentry.releaseprojectenvironment",
"sentry.releaseproject",
"sentry.releaseheadcommit",
"sentry.releasefile",
"sentry.releaseenvironment",
"sentry.releasecommit",
"sentry.releaseartifactbundle",
"sentry.releaseactivity",
"sentry.release",
"sentry.regressiongroup",
"sentry.rawevent",
"sentry.querysubscription",
"sentry.pullrequest",
"sentry.promptsactivity",
"sentry.projecttransactionthresholdoverride",
"sentry.projecttransactionthreshold",
"sentry.projectteam",
"sentry.projectredirect",
"sentry.projectplatform",
"sentry.projectownership",
"sentry.projectoption",
"sentry.projectkey",
"sentry.projectintegration",
"sentry.projectdebugfile",
"sentry.projectcodeowners",
"sentry.projectbookmark",
"sentry.projectartifactbundle",
"sentry.proguardartifactrelease",
"sentry.platformexternalissue",
"sentry.organizationmemberteam",
"sentry.organizationmembermapping",
"sentry.organizationavatar",
"sentry.notificationaction",
"sentry.neglectedrule",
"sentry.monitorenvironment",
"sentry.monitorcheckin",
"sentry.latestreporeleaseenvironment",
"sentry.groupsubscription",
"sentry.groupsnooze",
"sentry.groupshare",
"sentry.groupseen",
"sentry.grouprulestatus",
"sentry.groupresolution",
"sentry.grouprelease",
"sentry.groupredirect",
"sentry.groupowner",
"sentry.groupmeta",
"sentry.grouplink",
"sentry.groupinbox",
"sentry.grouphistory",
"sentry.grouphash",
"sentry.groupenvironment",
"sentry.groupemailthread",
"sentry.groupcommitresolution",
"sentry.groupbookmark",
"sentry.groupassignee",
"sentry.group",
"sentry.fileblobindex",
"sentry.exporteddatablob",
"sentry.eventprocessingissue",
"sentry.eventattachment",
"sentry.environmentproject",
"sentry.distribution",
"sentry.discoversavedqueryproject",
"sentry.deploy",
"sentry.debugidartifactbundle",
"sentry.dashboardwidget",
"sentry.dashboardproject",
Expand All @@ -189,7 +160,10 @@
"sentry.apigrant",
"sentry.apiauthorization",
"sentry.alertrule",
"sentry.activity",
"hybridcloud.apitokenreplica",
"sentry.userreport",
"sentry.teamkeytransaction",
"sentry.snubaqueryeventtype",
"sentry.sentryappinstallation",
"sentry.sentryappcomponent",
Expand All @@ -198,12 +172,40 @@
"sentry.rulefirehistory",
"sentry.ruleactivity",
"sentry.relocationvalidationattempt",
"sentry.releaseprojectenvironment",
"sentry.releaseproject",
"sentry.releaseheadcommit",
"sentry.releasefile",
"sentry.releaseenvironment",
"sentry.releasecommit",
"sentry.releaseactivity",
"sentry.pullrequestcommit",
"sentry.pullrequestcomment",
"sentry.platformexternalissue",
"sentry.organizationmemberteamreplica",
"sentry.notificationactionproject",
"sentry.monitorincident",
"sentry.monitorenvbrokendetection",
"sentry.latestreporeleaseenvironment",
"sentry.groupsubscription",
"sentry.groupsnooze",
"sentry.groupshare",
"sentry.groupseen",
"sentry.grouprulestatus",
"sentry.groupresolution",
"sentry.grouprelease",
"sentry.groupredirect",
"sentry.groupowner",
"sentry.groupmeta",
"sentry.grouplink",
"sentry.groupinbox",
"sentry.grouphistory",
"sentry.grouphash",
"sentry.groupenvironment",
"sentry.groupemailthread",
"sentry.groupcommitresolution",
"sentry.groupbookmark",
"sentry.groupassignee",
"sentry.dashboardwidgetquery",
"sentry.alertruletrigger",
"sentry.alertruleprojects",
Expand All @@ -228,4 +230,4 @@
"sentry.incidentseen",
"sentry.incidentproject",
"sentry.incidentactivity"
]
]