Skip to content

chore(migrations): Removed vendored code from SafePostgresDatabaseSchemaEditor. #90457

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

Open
wants to merge 1 commit into
base: danf/migrations-remove-allow-run-sql
Choose a base branch
from

Conversation

wedamija
Copy link
Member

We vendored and slightly modified this code in #79052.

We've removed the code that actually uses this change in #90455. I copied the code from our migration framework back over this, and there are no other customizations, so we can safely remove.

…hemaEditor`.

We vendored and slightly modified this code in #79052.

We've removed the code that actually uses this change in #90455. I copied the code from our migration framework back over this, and there are no other customizations, so we can safely remove.
@wedamija wedamija requested review from evanpurkhiser and a team April 25, 2025 23:26
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 25, 2025
Copy link

codecov bot commented Apr 25, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
25294 1 25293 306
View the top 2 failed test(s) by shortest run time
tests.sentry.migrations.test_0870_delete_non_member_views.DeleteNonMemberViewsTest::test_deletes_non_member_views
Stack Traces | 0.006s run time
#x1B[1m#x1B[31m.venv/lib/python3.13....../site-packages/pytest_django/plugin.py#x1B[0m:565: in _django_setup_unittest
    request.getfixturevalue("django_db_setup")
#x1B[1m#x1B[31m.venv/lib/python3.13....../site-packages/pytest_django/plugin.py#x1B[0m:565: in _django_setup_unittest
    request.getfixturevalue("django_db_setup")
#x1B[1m#x1B[31m.venv/lib/python3.13.../site-packages/pytest_django/fixtures.py#x1B[0m:144: in django_db_setup
    db_cfg = setup_databases(
#x1B[1m#x1B[31m.venv/lib/python3.13.../django/test/utils.py#x1B[0m:206: in setup_databases
    connection.creation.create_test_db(
#x1B[1m#x1B[31m.venv/lib/python3.13.../backends/base/creation.py#x1B[0m:78: in create_test_db
    call_command(
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/__init__.py#x1B[0m:194: in call_command
    return command.execute(*args, **defaults)
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/base.py#x1B[0m:459: in execute
    output = self.handle(*args, **options)
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/base.py#x1B[0m:107: in wrapper
    res = handle_func(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../management/commands/migrate.py#x1B[0m:118: in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/executor.py#x1B[0m:18: in __init__
    self.loader = MigrationLoader(self.connection)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:58: in __init__
    self.build_graph()
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:229: in build_graph
    self.load_disk()
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:120: in load_disk
    migration_module = import_module(migration_path)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1.../x64/lib/python3.13/importlib/__init__.py#x1B[0m:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
#x1B[1m#x1B[.../sentry/migrations/0001_squashed_0484_break_org_member_user_fk.py#x1B[0m:44: in <module>
    class Migration(CheckedMigration):
#x1B[1m#x1B[.../sentry/migrations/0001_squashed_0484_break_org_member_user_fk.py#x1B[0m:6046: in Migration
    SafeRunSQL(
#x1B[1m#x1B[.../new_migrations/monkey/special.py#x1B[0m:7: in __init__
    super().__init__(*args, **kwargs)
#x1B[1m#x1B[31mE   TypeError: RunSQL.__init__() got an unexpected keyword argument 'use_statements'#x1B[0m
tests.sentry.notifications.test_notificationmessage_table_constraints.TestUpdateNotificationMessageConstraintsForActionGroupOpenPeriod::test_constraint_allows_different_action_group_combinations
Stack Traces | 0.006s run time
#x1B[1m#x1B[31m.venv/lib/python3.13.../site-packages/pytest_django/plugin.py#x1B[0m:565: in _django_setup_unittest
    request.getfixturevalue("django_db_setup")
#x1B[1m#x1B[31m.venv/lib/python3.13.../site-packages/pytest_django/fixtures.py#x1B[0m:144: in django_db_setup
    db_cfg = setup_databases(
#x1B[1m#x1B[31m.venv/lib/python3.13.../django/test/utils.py#x1B[0m:206: in setup_databases
    connection.creation.create_test_db(
#x1B[1m#x1B[31m.venv/lib/python3.13.../backends/base/creation.py#x1B[0m:78: in create_test_db
    call_command(
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/__init__.py#x1B[0m:194: in call_command
    return command.execute(*args, **defaults)
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/base.py#x1B[0m:459: in execute
    output = self.handle(*args, **options)
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/base.py#x1B[0m:107: in wrapper
    res = handle_func(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../management/commands/migrate.py#x1B[0m:118: in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/executor.py#x1B[0m:18: in __init__
    self.loader = MigrationLoader(self.connection)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:58: in __init__
    self.build_graph()
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:229: in build_graph
    self.load_disk()
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:120: in load_disk
    migration_module = import_module(migration_path)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1.../x64/lib/python3.13/importlib/__init__.py#x1B[0m:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
#x1B[1m#x1B[.../sentry/migrations/0001_squashed_0484_break_org_member_user_fk.py#x1B[0m:44: in <module>
    class Migration(CheckedMigration):
#x1B[1m#x1B[.../sentry/migrations/0001_squashed_0484_break_org_member_user_fk.py#x1B[0m:6046: in Migration
    SafeRunSQL(
#x1B[1m#x1B[.../new_migrations/monkey/special.py#x1B[0m:7: in __init__
    super().__init__(*args, **kwargs)
#x1B[1m#x1B[31mE   TypeError: RunSQL.__init__() got an unexpected keyword argument 'use_statements'#x1B[0m
View the full list of 1 ❄️ flaky tests
tests.sentry.workflow_engine.migrations.test_0047_migrate_issue_alerts.TestMigrateIssueAlerts::test_2

Flake rate in main: 7.25% (Passed 64 times, Failed 5 times)

Stack Traces | 0.006s run time
#x1B[1m#x1B[31m.venv/lib/python3.13........./site-packages/pytest_django/plugin.py#x1B[0m:565: in _django_setup_unittest
    request.getfixturevalue("django_db_setup")
#x1B[1m#x1B[31m.venv/lib/python3.13........./site-packages/pytest_django/plugin.py#x1B[0m:565: in _django_setup_unittest
    request.getfixturevalue("django_db_setup")
#x1B[1m#x1B[31m.venv/lib/python3.13........./site-packages/pytest_django/plugin.py#x1B[0m:565: in _django_setup_unittest
    request.getfixturevalue("django_db_setup")
#x1B[1m#x1B[31m.venv/lib/python3.13.../site-packages/pytest_django/fixtures.py#x1B[0m:144: in django_db_setup
    db_cfg = setup_databases(
#x1B[1m#x1B[31m.venv/lib/python3.13.../django/test/utils.py#x1B[0m:206: in setup_databases
    connection.creation.create_test_db(
#x1B[1m#x1B[31m.venv/lib/python3.13.../backends/base/creation.py#x1B[0m:78: in create_test_db
    call_command(
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/__init__.py#x1B[0m:194: in call_command
    return command.execute(*args, **defaults)
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/base.py#x1B[0m:459: in execute
    output = self.handle(*args, **options)
#x1B[1m#x1B[31m.venv/lib/python3.13.../core/management/base.py#x1B[0m:107: in wrapper
    res = handle_func(*args, **kwargs)
#x1B[1m#x1B[31m.venv/lib/python3.13.../management/commands/migrate.py#x1B[0m:118: in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/executor.py#x1B[0m:18: in __init__
    self.loader = MigrationLoader(self.connection)
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:58: in __init__
    self.build_graph()
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:229: in build_graph
    self.load_disk()
#x1B[1m#x1B[31m.venv/lib/python3.13.../db/migrations/loader.py#x1B[0m:120: in load_disk
    migration_module = import_module(migration_path)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1.../x64/lib/python3.13/importlib/__init__.py#x1B[0m:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
#x1B[1m#x1B[.../sentry/migrations/0001_squashed_0484_break_org_member_user_fk.py#x1B[0m:44: in <module>
    class Migration(CheckedMigration):
#x1B[1m#x1B[.../sentry/migrations/0001_squashed_0484_break_org_member_user_fk.py#x1B[0m:6046: in Migration
    SafeRunSQL(
#x1B[1m#x1B[.../new_migrations/monkey/special.py#x1B[0m:7: in __init__
    super().__init__(*args, **kwargs)
#x1B[1m#x1B[31mE   TypeError: RunSQL.__init__() got an unexpected keyword argument 'use_statements'#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant