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

Use shared report_service and test factories #849

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

Swatinem
Copy link
Contributor

@Swatinem Swatinem commented Oct 2, 2024

Purpose/Motivation

This switches most of the code using the report_builder service to use that same code imported from shared (except some functions specific to api).

Similarly, the core.tests.factories were also duplicated in shared, so this switches over to those factories, deleting them from api.

The primary reason here is that the shared code has been changed to remove the obsolete report_builder feature.
This feature was recently removed from worker and its configuration from the k8s config.
It is currently not enabled in production.

I believe this feature does not pull its weight, as querying multiple tables and fetching the files_array file from storage is most likely slower than just fetching the report_json from storage instead.

Links to relevant tickets

codecov/engineering-team#2554

@Swatinem Swatinem requested a review from a team October 2, 2024 08:30
@Swatinem Swatinem self-assigned this Oct 2, 2024
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.25%. Comparing base (e14d14d) to head (f26a4e4).
Report is 1 commits behind head on main.

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

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #849      +/-   ##
==========================================
- Coverage   96.26%   96.25%   -0.02%     
==========================================
  Files         823      823              
  Lines       19235    19049     -186     
==========================================
- Hits        18516    18335     -181     
+ Misses        719      714       -5     
Flag Coverage Δ
unit 92.52% <100.00%> (-0.11%) ⬇️
unit-latest-uploader 92.52% <100.00%> (-0.11%) ⬇️

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-staging
Copy link

codecov-staging bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Oct 2, 2024

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
2706 3 2703 6
View the top 3 failed tests by shortest run time
codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest test_update_user_when_agreement_is_true
Stack Traces | 0.348s run time
self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30&gt;
sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
params = (datetime.datetime(2024, 10, 21, 8, 22, 59, 167046, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'patricia51@gmail.com', 'codecov-user', False, False, ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               psycopg2.errors.NotNullViolation: null value in column "email_opt_in" of relation "users" violates not-null constraint
E               DETAIL:  Failing row contains (3989, 6fd317f3-2d4f-4573-9b61-bf99e576f25c, 2024-10-21 08:22:59.167046+00, 2022-01-01 00:00:00+00, patricia51@gmail.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

.../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

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

self = &lt;codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest testMethod=test_update_user_when_agreement_is_true&gt;

    @freeze_time("2022-01-01T00:00:00")
    def test_update_user_when_agreement_is_true(self):
&gt;       self.execute(
            current_user=self.current_user,
            input={"terms_agreement": True, "customer_intent": "Business"},
        )

.../interactors/tests/test_save_terms_agreement.py:52: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12............/site-packages/asgiref/sync.py:240: in __call__
    return call_result.result()
.../local/lib/python3.12....../concurrent/futures/_base.py:449: in result
    return self.__get_result()
.../local/lib/python3.12....../concurrent/futures/_base.py:401: in __get_result
    raise self._exception
.../local/lib/python3.12............/site-packages/asgiref/sync.py:306: in main_wrap
    result = await self.awaitable(*args, **kwargs)
.../local/lib/python3.12............/site-packages/asgiref/sync.py:448: in __call__
    ret = await asyncio.wait_for(future, timeout=None)
.../local/lib/python3.12/asyncio/tasks.py:520: in wait_for
    return await fut
.../local/lib/python3.12.../site-packages/asgiref/current_thread_executor.py:22: in run
    result = self.fn(*self.args, **self.kwargs)
codecov/db/__init__.py:82: in thread_handler
    return super().thread_handler(loop, *args, **kwargs)
.../local/lib/python3.12............/site-packages/asgiref/sync.py:490: in thread_handler
    return func(*args, **kwargs)
.../owner/interactors/save_terms_agreement.py:62: in execute
    return self.update_terms_agreement(typed_input)
.../owner/interactors/save_terms_agreement.py:38: in update_terms_agreement
    self.current_user.save()
.../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
.../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
.../local/lib/python3.12.../db/models/base.py:990: in _save_table
    updated = self._do_update(
.../local/lib/python3.12.../site-packages/django_prometheus/models.py:47: in _do_update
    return super()._do_update(*args, **kwargs)
.../local/lib/python3.12.../db/models/base.py:1054: in _do_update
    return filtered._update(values) &gt; 0
.../local/lib/python3.12.../db/models/query.py:1231: in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
.../local/lib/python3.12.../models/sql/compiler.py:1984: in execute_sql
    cursor = super().execute_sql(result_type)
.../local/lib/python3.12.../models/sql/compiler.py:1562: in execute_sql
    cursor.execute(sql, params)
.../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
.../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
.../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
.../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
.../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30&gt;
sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
params = (datetime.datetime(2024, 10, 21, 8, 22, 59, 167046, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'patricia51@gmail.com', 'codecov-user', False, False, ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               django.db.utils.IntegrityError: null value in column "email_opt_in" of relation "users" violates not-null constraint
E               DETAIL:  Failing row contains (3989, 6fd317f3-2d4f-4573-9b61-bf99e576f25c, 2024-10-21 08:22:59.167046+00, 2022-01-01 00:00:00+00, patricia51@gmail.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

.../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest test_update_owner_and_user_when_email_is_not_empty
Stack Traces | 0.35s run time
self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710&gt;
sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
params = (datetime.datetime(2024, 10, 21, 8, 22, 57, 676393, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'oevans@yahoo.com', 'codecov-user', False, False, ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               psycopg2.errors.NotNullViolation: null value in column "email_opt_in" of relation "users" violates not-null constraint
E               DETAIL:  Failing row contains (3987, 02a58c23-6e39-46cc-817b-6dcb286faac3, 2024-10-21 08:22:57.676393+00, 2022-01-01 00:00:00+00, oevans@yahoo.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

.../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

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

self = &lt;codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest testMethod=test_update_owner_and_user_when_email_is_not_empty&gt;

    @freeze_time("2022-01-01T00:00:00")
    def test_update_owner_and_user_when_email_is_not_empty(self):
&gt;       self.execute(
            current_user=self.current_user,
            input={
                "business_email": "something@email.com",
                "terms_agreement": True,
                "customer_intent": "Business",
            },
        )

.../interactors/tests/test_save_terms_agreement.py:66: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12............/site-packages/asgiref/sync.py:240: in __call__
    return call_result.result()
.../local/lib/python3.12....../concurrent/futures/_base.py:449: in result
    return self.__get_result()
.../local/lib/python3.12....../concurrent/futures/_base.py:401: in __get_result
    raise self._exception
.../local/lib/python3.12............/site-packages/asgiref/sync.py:306: in main_wrap
    result = await self.awaitable(*args, **kwargs)
.../local/lib/python3.12............/site-packages/asgiref/sync.py:448: in __call__
    ret = await asyncio.wait_for(future, timeout=None)
.../local/lib/python3.12/asyncio/tasks.py:520: in wait_for
    return await fut
.../local/lib/python3.12.../site-packages/asgiref/current_thread_executor.py:22: in run
    result = self.fn(*self.args, **self.kwargs)
codecov/db/__init__.py:82: in thread_handler
    return super().thread_handler(loop, *args, **kwargs)
.../local/lib/python3.12............/site-packages/asgiref/sync.py:490: in thread_handler
    return func(*args, **kwargs)
.../owner/interactors/save_terms_agreement.py:62: in execute
    return self.update_terms_agreement(typed_input)
.../owner/interactors/save_terms_agreement.py:38: in update_terms_agreement
    self.current_user.save()
.../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
.../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
.../local/lib/python3.12.../db/models/base.py:990: in _save_table
    updated = self._do_update(
.../local/lib/python3.12.../site-packages/django_prometheus/models.py:47: in _do_update
    return super()._do_update(*args, **kwargs)
.../local/lib/python3.12.../db/models/base.py:1054: in _do_update
    return filtered._update(values) &gt; 0
.../local/lib/python3.12.../db/models/query.py:1231: in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
.../local/lib/python3.12.../models/sql/compiler.py:1984: in execute_sql
    cursor = super().execute_sql(result_type)
.../local/lib/python3.12.../models/sql/compiler.py:1562: in execute_sql
    cursor.execute(sql, params)
.../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
.../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
.../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
.../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
.../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710&gt;
sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
params = (datetime.datetime(2024, 10, 21, 8, 22, 57, 676393, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'oevans@yahoo.com', 'codecov-user', False, False, ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               django.db.utils.IntegrityError: null value in column "email_opt_in" of relation "users" violates not-null constraint
E               DETAIL:  Failing row contains (3987, 02a58c23-6e39-46cc-817b-6dcb286faac3, 2024-10-21 08:22:57.676393+00, 2022-01-01 00:00:00+00, oevans@yahoo.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

.../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest test_update_user_when_agreement_is_false
Stack Traces | 0.361s run time
self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0&gt;
sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
params = (datetime.datetime(2024, 10, 21, 8, 22, 58, 235199, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'jamesmontoya@moran-decker.com', 'codecov-user', False, False, ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               psycopg2.errors.NotNullViolation: null value in column "email_opt_in" of relation "users" violates not-null constraint
E               DETAIL:  Failing row contains (3988, e5a511e0-06ae-42e0-9389-ae15208fb087, 2024-10-21 08:22:58.235199+00, 2022-01-01 00:00:00+00, jamesmontoya@moran-decker.com, codecov-user, f, f, f, 2022-01-01 00:00:00, Business, null).

.../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

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

self = &lt;codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest testMethod=test_update_user_when_agreement_is_false&gt;

    @freeze_time("2022-01-01T00:00:00")
    def test_update_user_when_agreement_is_false(self):
&gt;       self.execute(
            current_user=self.current_user,
            input={"terms_agreement": False, "customer_intent": "Business"},
        )

.../interactors/tests/test_save_terms_agreement.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
.../local/lib/python3.12............/site-packages/asgiref/sync.py:240: in __call__
    return call_result.result()
.../local/lib/python3.12....../concurrent/futures/_base.py:449: in result
    return self.__get_result()
.../local/lib/python3.12....../concurrent/futures/_base.py:401: in __get_result
    raise self._exception
.../local/lib/python3.12............/site-packages/asgiref/sync.py:306: in main_wrap
    result = await self.awaitable(*args, **kwargs)
.../local/lib/python3.12............/site-packages/asgiref/sync.py:448: in __call__
    ret = await asyncio.wait_for(future, timeout=None)
.../local/lib/python3.12/asyncio/tasks.py:520: in wait_for
    return await fut
.../local/lib/python3.12.../site-packages/asgiref/current_thread_executor.py:22: in run
    result = self.fn(*self.args, **self.kwargs)
codecov/db/__init__.py:82: in thread_handler
    return super().thread_handler(loop, *args, **kwargs)
.../local/lib/python3.12............/site-packages/asgiref/sync.py:490: in thread_handler
    return func(*args, **kwargs)
.../owner/interactors/save_terms_agreement.py:62: in execute
    return self.update_terms_agreement(typed_input)
.../owner/interactors/save_terms_agreement.py:38: in update_terms_agreement
    self.current_user.save()
.../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
.../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
.../local/lib/python3.12.../db/models/base.py:990: in _save_table
    updated = self._do_update(
.../local/lib/python3.12.../site-packages/django_prometheus/models.py:47: in _do_update
    return super()._do_update(*args, **kwargs)
.../local/lib/python3.12.../db/models/base.py:1054: in _do_update
    return filtered._update(values) &gt; 0
.../local/lib/python3.12.../db/models/query.py:1231: in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
.../local/lib/python3.12.../models/sql/compiler.py:1984: in execute_sql
    cursor = super().execute_sql(result_type)
.../local/lib/python3.12.../models/sql/compiler.py:1562: in execute_sql
    cursor.execute(sql, params)
.../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
.../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
.../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
.../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
.../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
.../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0&gt;
sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
params = (datetime.datetime(2024, 10, 21, 8, 22, 58, 235199, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'jamesmontoya@moran-decker.com', 'codecov-user', False, False, ...)
ignored_wrapper_args = (False, {'connection': &lt;DatabaseWrapper vendor='postgresql' alias='default'&gt;, 'cursor': &lt;django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0&gt;})

    def _execute(self, sql, params, *ignored_wrapper_args):
        self.db.validate_no_broken_transaction()
        with self.db.wrap_database_errors:
            if params is None:
                # params default might be backend specific.
                return self.cursor.execute(sql)
            else:
&gt;               return self.cursor.execute(sql, params)
E               django.db.utils.IntegrityError: null value in column "email_opt_in" of relation "users" violates not-null constraint
E               DETAIL:  Failing row contains (3988, e5a511e0-06ae-42e0-9389-ae15208fb087, 2024-10-21 08:22:58.235199+00, 2022-01-01 00:00:00+00, jamesmontoya@moran-decker.com, codecov-user, f, f, f, 2022-01-01 00:00:00, Business, null).

.../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

Copy link

codecov-public-qa bot commented Oct 2, 2024

Test Failures Detected: Due to failing tests, we cannot provide coverage reports at this time.

❌ Failed Test Results:

Completed 2712 tests with 3 failed, 2703 passed and 6 skipped.

View the full list of failed tests

pytest

  • Class name: codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest
    Test name: test_update_owner_and_user_when_email_is_not_empty

    self = <django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710>
    sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
    params = (datetime.datetime(2024, 10, 21, 8, 22, 57, 676393, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'oevans@yahoo.com', 'codecov-user', False, False, ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "email_opt_in" of relation "users" violates not-null constraint
    E DETAIL: Failing row contains (3987, 02a58c23-6e39-46cc-817b-6dcb286faac3, 2024-10-21 08:22:57.676393+00, 2022-01-01 00:00:00+00, oevans@yahoo.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    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>

    @freeze_time("2022-01-01T00:00:00")
    def test_update_owner_and_user_when_email_is_not_empty(self):
    > self.execute(
    current_user=self.current_user,
    input={
    "business_email": "something@email.com",
    "terms_agreement": True,
    "customer_intent": "Business",
    },
    )

    .../interactors/tests/test_save_terms_agreement.py:66:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:240: in __call__
    return call_result.result()
    .../local/lib/python3.12....../concurrent/futures/_base.py:449: in result
    return self.__get_result()
    .../local/lib/python3.12....../concurrent/futures/_base.py:401: in __get_result
    raise self._exception
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:306: in main_wrap
    result = await self.awaitable(*args, **kwargs)
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:448: in __call__
    ret = await asyncio.wait_for(future, timeout=None)
    .../local/lib/python3.12/asyncio/tasks.py:520: in wait_for
    return await fut
    .../local/lib/python3.12.../site-packages/asgiref/current_thread_executor.py:22: in run
    result = self.fn(*self.args, **self.kwargs)
    codecov/db/__init__.py:82: in thread_handler
    return super().thread_handler(loop, *args, **kwargs)
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:490: in thread_handler
    return func(*args, **kwargs)
    .../owner/interactors/save_terms_agreement.py:62: in execute
    return self.update_terms_agreement(typed_input)
    .../owner/interactors/save_terms_agreement.py:38: in update_terms_agreement
    self.current_user.save()
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:990: in _save_table
    updated = self._do_update(
    .../local/lib/python3.12.../site-packages/django_prometheus/models.py:47: in _do_update
    return super()._do_update(*args, **kwargs)
    .../local/lib/python3.12.../db/models/base.py:1054: in _do_update
    return filtered._update(values) > 0
    .../local/lib/python3.12.../db/models/query.py:1231: in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
    .../local/lib/python3.12.../models/sql/compiler.py:1984: in execute_sql
    cursor = super().execute_sql(result_type)
    .../local/lib/python3.12.../models/sql/compiler.py:1562: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710>
    sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
    params = (datetime.datetime(2024, 10, 21, 8, 22, 57, 676393, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'oevans@yahoo.com', 'codecov-user', False, False, ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3ba094b710>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "email_opt_in" of relation "users" violates not-null constraint
    E DETAIL: Failing row contains (3987, 02a58c23-6e39-46cc-817b-6dcb286faac3, 2024-10-21 08:22:57.676393+00, 2022-01-01 00:00:00+00, oevans@yahoo.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest
    Test name: test_update_user_when_agreement_is_false

    self = <django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0>
    sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
    params = (datetime.datetime(2024, 10, 21, 8, 22, 58, 235199, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'jamesmontoya@moran-decker.com', 'codecov-user', False, False, ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "email_opt_in" of relation "users" violates not-null constraint
    E DETAIL: Failing row contains (3988, e5a511e0-06ae-42e0-9389-ae15208fb087, 2024-10-21 08:22:58.235199+00, 2022-01-01 00:00:00+00, jamesmontoya@moran-decker.com, codecov-user, f, f, f, 2022-01-01 00:00:00, Business, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    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_user_when_agreement_is_false>

    @freeze_time("2022-01-01T00:00:00")
    def test_update_user_when_agreement_is_false(self):
    > self.execute(
    current_user=self.current_user,
    input={"terms_agreement": False, "customer_intent": "Business"},
    )

    .../interactors/tests/test_save_terms_agreement.py:38:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:240: in __call__
    return call_result.result()
    .../local/lib/python3.12....../concurrent/futures/_base.py:449: in result
    return self.__get_result()
    .../local/lib/python3.12....../concurrent/futures/_base.py:401: in __get_result
    raise self._exception
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:306: in main_wrap
    result = await self.awaitable(*args, **kwargs)
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:448: in __call__
    ret = await asyncio.wait_for(future, timeout=None)
    .../local/lib/python3.12/asyncio/tasks.py:520: in wait_for
    return await fut
    .../local/lib/python3.12.../site-packages/asgiref/current_thread_executor.py:22: in run
    result = self.fn(*self.args, **self.kwargs)
    codecov/db/__init__.py:82: in thread_handler
    return super().thread_handler(loop, *args, **kwargs)
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:490: in thread_handler
    return func(*args, **kwargs)
    .../owner/interactors/save_terms_agreement.py:62: in execute
    return self.update_terms_agreement(typed_input)
    .../owner/interactors/save_terms_agreement.py:38: in update_terms_agreement
    self.current_user.save()
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:990: in _save_table
    updated = self._do_update(
    .../local/lib/python3.12.../site-packages/django_prometheus/models.py:47: in _do_update
    return super()._do_update(*args, **kwargs)
    .../local/lib/python3.12.../db/models/base.py:1054: in _do_update
    return filtered._update(values) > 0
    .../local/lib/python3.12.../db/models/query.py:1231: in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
    .../local/lib/python3.12.../models/sql/compiler.py:1984: in execute_sql
    cursor = super().execute_sql(result_type)
    .../local/lib/python3.12.../models/sql/compiler.py:1562: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0>
    sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
    params = (datetime.datetime(2024, 10, 21, 8, 22, 58, 235199, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'jamesmontoya@moran-decker.com', 'codecov-user', False, False, ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3ba09cacc0>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "email_opt_in" of relation "users" violates not-null constraint
    E DETAIL: Failing row contains (3988, e5a511e0-06ae-42e0-9389-ae15208fb087, 2024-10-21 08:22:58.235199+00, 2022-01-01 00:00:00+00, jamesmontoya@moran-decker.com, codecov-user, f, f, f, 2022-01-01 00:00:00, Business, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError
  • Class name: codecov_auth.commands.owner.interactors.tests.test_save_terms_agreement.UpdateSaveTermsAgreementInteractorTest
    Test name: test_update_user_when_agreement_is_true

    self = <django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30>
    sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
    params = (datetime.datetime(2024, 10, 21, 8, 22, 59, 167046, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'patricia51@gmail.com', 'codecov-user', False, False, ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E psycopg2.errors.NotNullViolation: null value in column "email_opt_in" of relation "users" violates not-null constraint
    E DETAIL: Failing row contains (3989, 6fd317f3-2d4f-4573-9b61-bf99e576f25c, 2024-10-21 08:22:59.167046+00, 2022-01-01 00:00:00+00, patricia51@gmail.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: NotNullViolation

    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_user_when_agreement_is_true>

    @freeze_time("2022-01-01T00:00:00")
    def test_update_user_when_agreement_is_true(self):
    > self.execute(
    current_user=self.current_user,
    input={"terms_agreement": True, "customer_intent": "Business"},
    )

    .../interactors/tests/test_save_terms_agreement.py:52:
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:240: in __call__
    return call_result.result()
    .../local/lib/python3.12....../concurrent/futures/_base.py:449: in result
    return self.__get_result()
    .../local/lib/python3.12....../concurrent/futures/_base.py:401: in __get_result
    raise self._exception
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:306: in main_wrap
    result = await self.awaitable(*args, **kwargs)
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:448: in __call__
    ret = await asyncio.wait_for(future, timeout=None)
    .../local/lib/python3.12/asyncio/tasks.py:520: in wait_for
    return await fut
    .../local/lib/python3.12.../site-packages/asgiref/current_thread_executor.py:22: in run
    result = self.fn(*self.args, **self.kwargs)
    codecov/db/__init__.py:82: in thread_handler
    return super().thread_handler(loop, *args, **kwargs)
    .../local/lib/python3.12............/site-packages/asgiref/sync.py:490: in thread_handler
    return func(*args, **kwargs)
    .../owner/interactors/save_terms_agreement.py:62: in execute
    return self.update_terms_agreement(typed_input)
    .../owner/interactors/save_terms_agreement.py:38: in update_terms_agreement
    self.current_user.save()
    .../local/lib/python3.12.../db/models/base.py:814: in save
    self.save_base(
    .../local/lib/python3.12.../db/models/base.py:877: in save_base
    updated = self._save_table(
    .../local/lib/python3.12.../db/models/base.py:990: in _save_table
    updated = self._do_update(
    .../local/lib/python3.12.../site-packages/django_prometheus/models.py:47: in _do_update
    return super()._do_update(*args, **kwargs)
    .../local/lib/python3.12.../db/models/base.py:1054: in _do_update
    return filtered._update(values) > 0
    .../local/lib/python3.12.../db/models/query.py:1231: in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
    .../local/lib/python3.12.../models/sql/compiler.py:1984: in execute_sql
    cursor = super().execute_sql(result_type)
    .../local/lib/python3.12.../models/sql/compiler.py:1562: in execute_sql
    cursor.execute(sql, params)
    .../local/lib/python3.12.../site-packages/sentry_sdk/utils.py:1730: in runner
    return sentry_patched_function(*args, **kwargs)
    .../local/lib/python3.12.../integrations/django/__init__.py:651: in execute
    result = real_execute(self, sql, params)
    .../local/lib/python3.12.../db/backends/utils.py:67: in execute
    return self._execute_with_wrappers(
    .../local/lib/python3.12.../db/backends/utils.py:80: in _execute_with_wrappers
    return executor(sql, params, many, context)
    .../local/lib/python3.12.../db/backends/utils.py:84: in _execute
    with self.db.wrap_database_errors:
    .../local/lib/python3.12.../django/db/utils.py:91: in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    self = <django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30>
    sql = 'UPDATE "users" SET "created_at" = %s, "updated_at" = %s, "email" = %s, "name" = %s, "is_staff" = %s, "is_superuser" =...erms_agreement" = %s, "terms_agreement_at" = %s, "customer_intent" = %s, "email_opt_in" = NULL WHERE "users"."id" = %s'
    params = (datetime.datetime(2024, 10, 21, 8, 22, 59, 167046, tzinfo=datetime.timezone.utc), FakeDatetime(2022, 1, 1, 0, 0, tzinfo=datetime.timezone.utc), 'patricia51@gmail.com', 'codecov-user', False, False, ...)
    ignored_wrapper_args = (False, {'connection': <DatabaseWrapper vendor='postgresql' alias='default'>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x7f3ba094bb30>})

    def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
    if params is None:
    # params default might be backend specific.
    return self.cursor.execute(sql)
    else:
    > return self.cursor.execute(sql, params)
    E django.db.utils.IntegrityError: null value in column "email_opt_in" of relation "users" violates not-null constraint
    E DETAIL: Failing row contains (3989, 6fd317f3-2d4f-4573-9b61-bf99e576f25c, 2024-10-21 08:22:59.167046+00, 2022-01-01 00:00:00+00, patricia51@gmail.com, codecov-user, f, f, t, 2022-01-01 00:00:00, Business, null).

    .../local/lib/python3.12.../db/backends/utils.py:89: IntegrityError

@Swatinem Swatinem marked this pull request as draft October 2, 2024 10:12
Copy link
Contributor

github-actions bot commented Oct 2, 2024

This PR includes changes to shared. Please review them here: codecov/shared@a97eb0a...f8cbb65

@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch 4 times, most recently from 12d6b59 to a57b56c Compare October 2, 2024 12:34
@Swatinem Swatinem marked this pull request as ready for review October 2, 2024 12:54
core/tests/factories.py Outdated Show resolved Hide resolved
services/report.py Outdated Show resolved Hide resolved
@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch from a57b56c to 1eb29d3 Compare October 4, 2024 13:06
@Swatinem Swatinem requested a review from a team as a code owner October 4, 2024 13:06
Copy link
Contributor

github-actions bot commented Oct 4, 2024

This PR includes changes to shared. Please review them here: codecov/shared@88117b9...bf3b6ee

@Swatinem Swatinem requested a review from matt-codecov October 4, 2024 13:07
@Swatinem Swatinem changed the title Remove report_builder feature Use shared report_service and test factories Oct 4, 2024
@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch 2 times, most recently from 895de8d to 3c5e3b1 Compare October 7, 2024 09:26
Copy link
Contributor

github-actions bot commented Oct 7, 2024

This PR includes changes to shared. Please review them here: codecov/shared@88117b9...bf3b6ee

@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch from 3c5e3b1 to 076573a Compare October 7, 2024 14:26
Copy link
Contributor

@nora-codecov nora-codecov left a comment

Choose a reason for hiding this comment

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

love this cleanup, only question is about OwnerFactory - I see some spots where you've swapped it to the shared factory, and others where you've left it referring to the api factory, any reason other than this pr getting too big?

requirements.in Outdated Show resolved Hide resolved
@Swatinem
Copy link
Contributor Author

I see some spots where you've swapped it to the shared factory, and others where you've left it referring to the api factory

This might just be an oversight.
This PR still has a ton of failures, and merge conflicts by now, so I will turn it into a draft in the meantime before fixing all that. Thanks for the review nevertheless :-)

@Swatinem Swatinem marked this pull request as draft October 14, 2024 08:13
@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch from 076573a to c5e6616 Compare October 16, 2024 10:40
Copy link
Contributor

This PR includes changes to shared. Please review them here: codecov/shared@88117b9...3cac029

@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch 2 times, most recently from de1361f to 0510f64 Compare October 16, 2024 11:10
@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch 2 times, most recently from d3ee9b5 to 640f16e Compare October 16, 2024 11:53
@Swatinem Swatinem marked this pull request as ready for review October 16, 2024 12:31
@Swatinem Swatinem requested a review from nora-codecov October 16, 2024 12:32
@Swatinem
Copy link
Contributor Author

I rebased the PR, and fixed all of the remaining tests, so things are green 🎉
I would appreciate another review, and hope to get this landed rather sooner than later :-)

@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch from 640f16e to f9a15d8 Compare October 21, 2024 08:13
Copy link
Contributor

github-actions bot commented Oct 21, 2024

This PR includes changes to shared. Please review them here: codecov/shared@88117b9...f0e213c

@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch 2 times, most recently from 267ac89 to e4f56a9 Compare October 21, 2024 08:44
This switches most of the code using the `report_builder` service to use that same code imported from `shared` (except some functions specific to `api`).

Similarly, the `core.tests.factories` were also duplicated in shared, so this switches over to those factories, deleting them from `api`.
@Swatinem Swatinem force-pushed the swatinem/rm-reportbuilder branch from e4f56a9 to f26a4e4 Compare October 21, 2024 09:01
@Swatinem Swatinem added this pull request to the merge queue Oct 21, 2024
Merged via the queue into main with commit 4546df1 Oct 21, 2024
17 of 19 checks passed
@Swatinem Swatinem deleted the swatinem/rm-reportbuilder branch October 21, 2024 15:24
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.

5 participants