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

[WIP] Plan Milestone 3 Transitions #1099

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ajay-sentry
Copy link
Contributor

…updates

Purpose/Motivation

What is the feature? Why is this being done?

Links to relevant tickets

What does this PR do?

Include a brief description of the changes in this PR. Bullet points are your friend.

Notes to Reviewer

Anything to note to the team? Any tips on how to review, or where to start?

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@ajay-sentry ajay-sentry requested a review from a team as a code owner January 15, 2025 17:40
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 15.78947% with 16 lines in your changes missing coverage. Please review.

Project coverage is 86.83%. Comparing base (ddb4755) to head (bef1fa7).

Changes have been made to critical files, which contain lines commonly executed in production. Learn more

❌ We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format.

Files with missing lines Patch % Lines
services/billing.py 0.00% 9 Missing ⚠️
api/internal/owner/serializers.py 0.00% 4 Missing ⚠️
codecov_auth/admin.py 0.00% 1 Missing ⚠️
graphql_api/types/owner/owner.py 50.00% 1 Missing ⚠️
upload/helpers.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1099      +/-   ##
==========================================
- Coverage   96.09%   86.83%   -9.26%     
==========================================
  Files         829      829              
  Lines       19384    19381       -3     
==========================================
- Hits        18627    16830    -1797     
- Misses        757     2551    +1794     
Flag Coverage Δ
unit 60.14% <15.78%> (-35.87%) ⬇️
unit-latest-uploader 60.14% <15.78%> (-35.87%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-notifications
Copy link

codecov-notifications bot commented Jan 15, 2025

❌ 3041 Tests Failed:

Tests completed Failed Passed Skipped
3444 3041 403 7
View the top 3 failed tests by shortest run time
codecov_auth/commands/owner/interactors/tests/test_save_terms_agreement.py::UpdateSaveTermsAgreementInteractorTest::test_update_owner_and_user_when_email_is_not_empty
Stack Traces | 0s run time
self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    def _cursor(self, name=None):
        self.close_if_health_check_failed()
        self.ensure_connection()
        with self.wrap_database_errors:
>           return self._prepare_cursor(self.create_cursor(name))

.../local/lib/python3.12.../backends/base/base.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           psycopg2.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

The above exception was the direct cause of the following exception:

self = <codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest testMethod=test_update_owner_and_user_when_email_is_not_empty>
result = <TestCaseFunction test_update_owner_and_user_when_email_is_not_empty>
debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.
    
        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = getattr(self.__class__, "__unittest_skip__", False) or getattr(
            testMethod, "__unittest_skip__", False
        )
    
        # Convert async test methods.
        if iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))
    
        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

.../local/lib/python3.12.../django/test/testcases.py:419: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/test/testcases.py:1279: in _post_teardown
    self._fixture_teardown()
.../local/lib/python3.12.../django/test/testcases.py:1313: in _fixture_teardown
    call_command(
.../local/lib/python3.12.../core/management/__init__.py:194: in call_command
    return command.execute(*args, **defaults)
.../local/lib/python3.12.../core/management/base.py:458: in execute
    output = self.handle(*args, **options)
.../local/lib/python3.12.../management/commands/flush.py:51: in handle
    sql_list = sql_flush(
.../local/lib/python3.12.../core/management/sql.py:11: in sql_flush
    tables = connection.introspection.django_table_names(
.../local/lib/python3.12.../backends/base/introspection.py:110: in django_table_names
    existing_tables = set(self.table_names(include_views=include_views))
.../local/lib/python3.12.../backends/base/introspection.py:56: in table_names
    with self.connection.cursor() as cursor:
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
.../local/lib/python3.12.../backends/base/base.py:330: in cursor
    return self._cursor()
.../local/lib/python3.12.../backends/base/base.py:307: in _cursor
    with self.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
.../local/lib/python3.12.../backends/base/base.py:308: in _cursor
    return self._prepare_cursor(self.create_cursor(name))
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           django.db.utils.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError
core/commands/commit/tests/test_commit.py::CommitCommandsTest::test_get_file_content_delegate_to_interactor
Stack Traces | 0s run time
self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    def _cursor(self, name=None):
        self.close_if_health_check_failed()
        self.ensure_connection()
        with self.wrap_database_errors:
>           return self._prepare_cursor(self.create_cursor(name))

.../local/lib/python3.12.../backends/base/base.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           psycopg2.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

The above exception was the direct cause of the following exception:

self = <core.commands.commit.tests.test_commit.CommitCommandsTest testMethod=test_get_file_content_delegate_to_interactor>
result = <TestCaseFunction test_get_file_content_delegate_to_interactor>
debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.
    
        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = getattr(self.__class__, "__unittest_skip__", False) or getattr(
            testMethod, "__unittest_skip__", False
        )
    
        # Convert async test methods.
        if iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))
    
        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

.../local/lib/python3.12.../django/test/testcases.py:419: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/test/testcases.py:1279: in _post_teardown
    self._fixture_teardown()
.../local/lib/python3.12.../django/test/testcases.py:1313: in _fixture_teardown
    call_command(
.../local/lib/python3.12.../core/management/__init__.py:194: in call_command
    return command.execute(*args, **defaults)
.../local/lib/python3.12.../core/management/base.py:458: in execute
    output = self.handle(*args, **options)
.../local/lib/python3.12.../management/commands/flush.py:51: in handle
    sql_list = sql_flush(
.../local/lib/python3.12.../core/management/sql.py:11: in sql_flush
    tables = connection.introspection.django_table_names(
.../local/lib/python3.12.../backends/base/introspection.py:110: in django_table_names
    existing_tables = set(self.table_names(include_views=include_views))
.../local/lib/python3.12.../backends/base/introspection.py:56: in table_names
    with self.connection.cursor() as cursor:
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
.../local/lib/python3.12.../backends/base/base.py:330: in cursor
    return self._cursor()
.../local/lib/python3.12.../backends/base/base.py:307: in _cursor
    with self.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
.../local/lib/python3.12.../backends/base/base.py:308: in _cursor
    return self._prepare_cursor(self.create_cursor(name))
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           django.db.utils.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError
graphql_api/tests/test_owner.py::TestOwnerType::test_fetching_repositories_filter_out_okta_enforced
Stack Traces | 0s run time
self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    def _cursor(self, name=None):
        self.close_if_health_check_failed()
        self.ensure_connection()
        with self.wrap_database_errors:
>           return self._prepare_cursor(self.create_cursor(name))

.../local/lib/python3.12.../backends/base/base.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           psycopg2.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

The above exception was the direct cause of the following exception:

self = <graphql_api.tests.test_owner.TestOwnerType testMethod=test_fetching_repositories_filter_out_okta_enforced>
result = <TestCaseFunction test_fetching_repositories_filter_out_okta_enforced>
debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.
    
        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = getattr(self.__class__, "__unittest_skip__", False) or getattr(
            testMethod, "__unittest_skip__", False
        )
    
        # Convert async test methods.
        if iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))
    
        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

.../local/lib/python3.12.../django/test/testcases.py:419: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/test/testcases.py:1279: in _post_teardown
    self._fixture_teardown()
.../local/lib/python3.12.../django/test/testcases.py:1313: in _fixture_teardown
    call_command(
.../local/lib/python3.12.../core/management/__init__.py:194: in call_command
    return command.execute(*args, **defaults)
.../local/lib/python3.12.../core/management/base.py:458: in execute
    output = self.handle(*args, **options)
.../local/lib/python3.12.../management/commands/flush.py:51: in handle
    sql_list = sql_flush(
.../local/lib/python3.12.../core/management/sql.py:11: in sql_flush
    tables = connection.introspection.django_table_names(
.../local/lib/python3.12.../backends/base/introspection.py:110: in django_table_names
    existing_tables = set(self.table_names(include_views=include_views))
.../local/lib/python3.12.../backends/base/introspection.py:56: in table_names
    with self.connection.cursor() as cursor:
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
.../local/lib/python3.12.../backends/base/base.py:330: in cursor
    return self._cursor()
.../local/lib/python3.12.../backends/base/base.py:307: in _cursor
    with self.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
.../local/lib/python3.12.../backends/base/base.py:308: in _cursor
    return self._prepare_cursor(self.create_cursor(name))
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           django.db.utils.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Jan 15, 2025

❌ 3041 Tests Failed:

Tests completed Failed Passed Skipped
3444 3041 403 7
View the top 3 failed tests by shortest run time
graphql_api/tests/test_commit.py::TestCommit::test_compare_with_parent_missing_change_coverage
Stack Traces | 0s run time
self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    def _cursor(self, name=None):
        self.close_if_health_check_failed()
        self.ensure_connection()
        with self.wrap_database_errors:
>           return self._prepare_cursor(self.create_cursor(name))

.../local/lib/python3.12.../backends/base/base.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           psycopg2.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

The above exception was the direct cause of the following exception:

self = <graphql_api.tests.test_commit.TestCommit testMethod=test_compare_with_parent_missing_change_coverage>
result = <TestCaseFunction test_compare_with_parent_missing_change_coverage>
debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.
    
        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = getattr(self.__class__, "__unittest_skip__", False) or getattr(
            testMethod, "__unittest_skip__", False
        )
    
        # Convert async test methods.
        if iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))
    
        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

.../local/lib/python3.12.../django/test/testcases.py:419: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/test/testcases.py:1279: in _post_teardown
    self._fixture_teardown()
.../local/lib/python3.12.../django/test/testcases.py:1313: in _fixture_teardown
    call_command(
.../local/lib/python3.12.../core/management/__init__.py:194: in call_command
    return command.execute(*args, **defaults)
.../local/lib/python3.12.../core/management/base.py:458: in execute
    output = self.handle(*args, **options)
.../local/lib/python3.12.../management/commands/flush.py:51: in handle
    sql_list = sql_flush(
.../local/lib/python3.12.../core/management/sql.py:11: in sql_flush
    tables = connection.introspection.django_table_names(
.../local/lib/python3.12.../backends/base/introspection.py:110: in django_table_names
    existing_tables = set(self.table_names(include_views=include_views))
.../local/lib/python3.12.../backends/base/introspection.py:56: in table_names
    with self.connection.cursor() as cursor:
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
.../local/lib/python3.12.../backends/base/base.py:330: in cursor
    return self._cursor()
.../local/lib/python3.12.../backends/base/base.py:307: in _cursor
    with self.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
.../local/lib/python3.12.../backends/base/base.py:308: in _cursor
    return self._prepare_cursor(self.create_cursor(name))
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           django.db.utils.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError
graphql_api/tests/test_current_user_ariadne.py::ArianeTestCase::test_fetching_my_orgs
Stack Traces | 0s run time
self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    def _cursor(self, name=None):
        self.close_if_health_check_failed()
        self.ensure_connection()
        with self.wrap_database_errors:
>           return self._prepare_cursor(self.create_cursor(name))

.../local/lib/python3.12.../backends/base/base.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           psycopg2.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

The above exception was the direct cause of the following exception:

self = <graphql_api.tests.test_current_user_ariadne.ArianeTestCase testMethod=test_fetching_my_orgs>
result = <TestCaseFunction test_fetching_my_orgs>, debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.
    
        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = getattr(self.__class__, "__unittest_skip__", False) or getattr(
            testMethod, "__unittest_skip__", False
        )
    
        # Convert async test methods.
        if iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))
    
        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

.../local/lib/python3.12.../django/test/testcases.py:419: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/test/testcases.py:1279: in _post_teardown
    self._fixture_teardown()
.../local/lib/python3.12.../django/test/testcases.py:1313: in _fixture_teardown
    call_command(
.../local/lib/python3.12.../core/management/__init__.py:194: in call_command
    return command.execute(*args, **defaults)
.../local/lib/python3.12.../core/management/base.py:458: in execute
    output = self.handle(*args, **options)
.../local/lib/python3.12.../management/commands/flush.py:51: in handle
    sql_list = sql_flush(
.../local/lib/python3.12.../core/management/sql.py:11: in sql_flush
    tables = connection.introspection.django_table_names(
.../local/lib/python3.12.../backends/base/introspection.py:110: in django_table_names
    existing_tables = set(self.table_names(include_views=include_views))
.../local/lib/python3.12.../backends/base/introspection.py:56: in table_names
    with self.connection.cursor() as cursor:
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
.../local/lib/python3.12.../backends/base/base.py:330: in cursor
    return self._cursor()
.../local/lib/python3.12.../backends/base/base.py:307: in _cursor
    with self.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
.../local/lib/python3.12.../backends/base/base.py:308: in _cursor
    return self._prepare_cursor(self.create_cursor(name))
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           django.db.utils.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError
graphql_api/tests/test_pull_comparison.py::TestPullComparison::test_pull_comparison_line_comparisons
Stack Traces | 0s run time
self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    def _cursor(self, name=None):
        self.close_if_health_check_failed()
        self.ensure_connection()
        with self.wrap_database_errors:
>           return self._prepare_cursor(self.create_cursor(name))

.../local/lib/python3.12.../backends/base/base.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           psycopg2.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

The above exception was the direct cause of the following exception:

self = <graphql_api.tests.test_pull_comparison.TestPullComparison testMethod=test_pull_comparison_line_comparisons>
result = <TestCaseFunction test_pull_comparison_line_comparisons>, debug = False

    def _setup_and_call(self, result, debug=False):
        """
        Perform the following in order: pre-setup, run test, post-teardown,
        skipping pre/post hooks if test is set to be skipped.
    
        If debug=True, reraise any errors in setup and use super().debug()
        instead of __call__() to run the test.
        """
        testMethod = getattr(self, self._testMethodName)
        skipped = getattr(self.__class__, "__unittest_skip__", False) or getattr(
            testMethod, "__unittest_skip__", False
        )
    
        # Convert async test methods.
        if iscoroutinefunction(testMethod):
            setattr(self, self._testMethodName, async_to_sync(testMethod))
    
        if not skipped:
            try:
                self._pre_setup()
            except Exception:
                if debug:
                    raise
                result.addError(self, sys.exc_info())
                return
        if debug:
            super().debug()
        else:
            super().__call__(result)
        if not skipped:
            try:
>               self._post_teardown()

.../local/lib/python3.12.../django/test/testcases.py:419: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12.../django/test/testcases.py:1279: in _post_teardown
    self._fixture_teardown()
.../local/lib/python3.12.../django/test/testcases.py:1313: in _fixture_teardown
    call_command(
.../local/lib/python3.12.../core/management/__init__.py:194: in call_command
    return command.execute(*args, **defaults)
.../local/lib/python3.12.../core/management/base.py:458: in execute
    output = self.handle(*args, **options)
.../local/lib/python3.12.../management/commands/flush.py:51: in handle
    sql_list = sql_flush(
.../local/lib/python3.12.../core/management/sql.py:11: in sql_flush
    tables = connection.introspection.django_table_names(
.../local/lib/python3.12.../backends/base/introspection.py:110: in django_table_names
    existing_tables = set(self.table_names(include_views=include_views))
.../local/lib/python3.12.../backends/base/introspection.py:56: in table_names
    with self.connection.cursor() as cursor:
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
.../local/lib/python3.12.../backends/base/base.py:330: in cursor
    return self._cursor()
.../local/lib/python3.12.../backends/base/base.py:307: in _cursor
    with self.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
.../local/lib/python3.12.../backends/base/base.py:308: in _cursor
    return self._prepare_cursor(self.create_cursor(name))
.../local/lib/python3.12.../django/utils/asyncio.py:26: in inner
    return func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <DatabaseWrapper vendor='postgresql' alias='default'>, name = None

    @async_unsafe
    def create_cursor(self, name=None):
        if name:
            # In autocommit mode, the cursor will be used outside of a
            # transaction, hence use a holdable cursor.
            cursor = self.connection.cursor(
                name, scrollable=False, withhold=self.connection.autocommit
            )
        else:
>           cursor = self.connection.cursor()
E           django.db.utils.InterfaceError: connection already closed

.../local/lib/python3.12.../backends/postgresql/base.py:330: InterfaceError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

codecov-public-qa bot commented Jan 15, 2025

❌ 2277 Tests Failed:

Tests completed Failed Passed Skipped
2681 2277 404 6
View the top 3 failed tests by shortest run time
core/commands/repository/interactors/tests/test_get_repository_token.py::GetRepositoryTokenInteractorTest::test_when_repo_has_no_token
Stack Traces | 0s run time
No failure message available
graphql_api/tests/mutation/test_set_upload_token_required.py::SetUploadTokenRequiredTests::test_when_not_part_of_org
Stack Traces | 0s run time
No failure message available
services/tests/test_repo_providers.py::TestRepoProviderService::test_get_adapter_returns_adapter_for_repo_authors_service
Stack Traces | 0s run time
No failure message available

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link
Contributor

github-actions bot commented Jan 15, 2025

❌ 3041 Tests Failed:

Tests completed Failed Passed Skipped
3451 3041 404 6
View the top 3 failed tests by shortest run time
test_cancel_trial_raises_exception_when_current_user_not_part_of_org
Stack Traces | 0.000s run time
No failure message available
test_cancel_trial_raises_exception_when_owner_is_not_in_db
Stack Traces | 0.000s run time
No failure message available
test_cancel_trial_raises_exception_when_owners_trial_status_is_expired
Stack Traces | 0.000s run time
No failure message available

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@ajay-sentry ajay-sentry requested a review from a team as a code owner January 15, 2025 20:02
@@ -131,11 +130,6 @@ def validate_value(self, value: str) -> str:
plan["value"] for plan in plan_service.available_plans(current_owner)
]
if value not in plan_values:
if value in SENTRY_PAID_USER_PLAN_REPRESENTATIONS:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this because it would now just be an extra DB call for a log lol

@@ -149,7 +142,9 @@ def validate(self, plan: Dict[str, Any]) -> Dict[str, Any]:
)

# Validate quantity here because we need access to whole plan object
if plan["value"] in PAID_PLANS:
if plan["value"] in Plan.objects.filter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts about calling all active plans in a single query and then filter as needed?

active_plans = list(
            Plan.objects.filter(
                paid_plan=True, is_active=True
            ).values_list("name", "tier")
        )

active_plan_names = {name for name, _ in active_plans}
team_tier_plans = {name for name, tier in active_plans if tier == TierName.TEAM.value}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooo I like that

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 this pull request may close these issues.

2 participants