Skip to content

Conversation

@thomasrockhu-codecov
Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov commented Dec 4, 2025

Bumps django to >= 4.2.26 (in this case 4.2.2.7)

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.


Note

Updates Django to >=4.2.26 (resolved to 4.2.27) and disables DB connection health checks in test settings, with minor test/cassette cleanups.

  • Dependencies:
    • Bump django constraint to >=4.2.26,<5.0.0 (resolved to 4.2.27) across pyproject.toml, libs/shared/pyproject.toml, and uv.lock.
  • Tests/Config:
    • In shared/django_apps/settings_test.py, set DATABASES[*].CONN_HEALTH_CHECKS = False and TEST.CONN_HEALTH_CHECKS = False to avoid issues in tests.
    • Remove @respx.mock from two tests in apps/worker/tasks/tests/unit/test_sync_repos_task.py.
    • Normalize cassette request URI by adding trailing / in .../test_simple_call_status_and_notifiers.yaml.

Written by Cursor Bugbot for commit d9fb1b0. This will update automatically on new commits. Configure here.

@codecov-eu
Copy link

codecov-eu bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/shared/shared/django_apps/settings_test.py 80.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@sentry
Copy link

sentry bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.87%. Comparing base (f8b2934) to head (d9fb1b0).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/shared/shared/django_apps/settings_test.py 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #595      +/-   ##
==========================================
+ Coverage   93.85%   93.87%   +0.01%     
==========================================
  Files        1284     1284              
  Lines       46528    46672     +144     
  Branches     1522     1524       +2     
==========================================
+ Hits        43671    43813     +142     
- Misses       2547     2548       +1     
- Partials      310      311       +1     
Flag Coverage Δ
apiunit 96.57% <ø> (+0.02%) ⬆️
sharedintegration 38.80% <80.00%> (+0.01%) ⬆️
sharedunit 88.76% <80.00%> (-0.01%) ⬇️
workerintegration 58.60% <ø> (-0.01%) ⬇️
workerunit 91.21% <ø> (+<0.01%) ⬆️

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.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 4, 2025

CodSpeed Performance Report

Merging #595 will not alter performance

Comparing th/django-4.2.27 (d9fb1b0) with main (7383d2c)1

Summary

✅ 9 untouched

Footnotes

  1. No successful run was found on main (6cea286) during the generation of this report, so 7383d2c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/shared/shared/django_apps/settings_test.py 80.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

pyproject.toml Outdated
"django-postgres-extra>=2.0.8",
"django-prometheus>=2.3.1",
"django>=4.2.25,<5.0.0",
"django=4.2.26,<5.0.0",

This comment was marked as outdated.

Comment on lines 158 to 162
"TEST": {
"CONN_HEALTH_CHECKS": False,
},
}
}

This comment was marked as outdated.

db_config["CONN_HEALTH_CHECKS"] = False
if "TEST" not in db_config:
db_config["TEST"] = {}
db_config["TEST"]["CONN_HEALTH_CHECKS"] = False
Copy link

Choose a reason for hiding this comment

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

Bug: Health check fix missing from API test settings

The CONN_HEALTH_CHECKS = False fix was applied only to shared.django_apps.settings_test, but codecov.settings_test (used for API tests) follows a different import chain through settings_devsettings_basedb_settings, which does not include this override. If Django 4.2.26+ connection health checks interfere with test database setup/teardown as the comment indicates, API tests could still experience these issues since they inherit the default CONN_HEALTH_CHECKS = True from db_settings.

Fix in Cursor Fix in Web

Comment on lines +92 to 97
if "TEST" not in db_config:
db_config["TEST"] = {}
db_config["TEST"]["CONN_HEALTH_CHECKS"] = False

# # Database
# # https://docs.djangoproject.com/en/4.2/ref/settings/#databases
Copy link

Choose a reason for hiding this comment

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

Bug: CodecovAPI tests will fail or hang due to CONN_HEALTH_CHECKS=True with Django 4.2.26+, as the fix in settings_test.py is not applied.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The CodecovAPI application's test suite will run with CONN_HEALTH_CHECKS=True when using Django 4.2.26/4.2.27 because its settings inheritance chain does not include shared.django_apps.settings_test. This will cause database connection issues during test setup/teardown, leading to test failures or hangs. The pull request intended to set CONN_HEALTH_CHECKS=False for Django 4.2.26+ to avoid these issues, but the fix was not applied to CodecovAPI.

💡 Suggested Fix

Ensure apps/codecov-api/codecov/settings_test.py or its imported settings correctly inherit or explicitly set CONN_HEALTH_CHECKS=False for Django 4.2.26+ to prevent test failures.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: libs/shared/shared/django_apps/settings_test.py#L92-L97

Potential issue: The `CodecovAPI` application's test suite will run with
`CONN_HEALTH_CHECKS=True` when using Django 4.2.26/4.2.27 because its settings
inheritance chain does not include `shared.django_apps.settings_test`. This will cause
database connection issues during test setup/teardown, leading to test failures or
hangs. The pull request intended to set `CONN_HEALTH_CHECKS=False` for Django 4.2.26+ to
avoid these issues, but the fix was not applied to `CodecovAPI`.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5891920

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