Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit a99b9f2

Browse files
authored
Merge branch 'main' into tony/coverage-single-upload
2 parents 93b0f48 + 1af369e commit a99b9f2

22 files changed

+1171
-2645
lines changed

codecov/settings_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@
115115

116116
DATABASE_ROUTERS = ["codecov.db.DatabaseRouter"]
117117

118+
# GCS
119+
GCS_BUCKET_NAME = "codecov"
120+
121+
118122
# Password validation
119123
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators
120124

codecov/settings_staging.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
COOKIE_SAME_SITE = "None"
7373
SESSION_COOKIE_SAMESITE = "None"
7474

75+
GCS_BUCKET_NAME = "codecov-staging"
76+
7577
CSRF_TRUSTED_ORIGINS = [
7678
get_config("setup", "trusted_origin", default="https://*.codecov.dev")
7779
]

core/signals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def update_repository(
1818
log.info(f"Signal triggered for repository {instance.repoid}")
1919
created: bool = kwargs["created"]
2020
changes: Dict[str, Any] = instance.tracker.changed()
21-
tracked_fields: List[str] = ["name", "upload_token"]
21+
tracked_fields: List[str] = ["name", "upload_token", "activated", "active"]
2222

2323
if created or any([field in changes for field in tracked_fields]):
2424
data = {

core/tests/test_signals.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ def test_shelter_repo_sync(mocker):
1010
publish = mocker.patch("google.cloud.pubsub_v1.PublisherClient.publish")
1111

1212
# this triggers the publish via Django signals
13-
repo = RepositoryFactory(repoid=91728376, author=OwnerFactory(ownerid=555))
13+
repo = RepositoryFactory(
14+
repoid=91728376, author=OwnerFactory(ownerid=555), active=False, activated=False
15+
)
1416

1517
# triggers publish on create
1618
publish.assert_has_calls(
@@ -38,13 +40,27 @@ def test_shelter_repo_sync(mocker):
3840
b'{"type": "repo", "sync": "one", "id": 91728376}',
3941
)
4042

43+
# Does not trigger another publish with untracked field
4144
repo.message = "foo"
4245
repo.save()
4346

4447
publish_calls = publish.call_args_list
45-
# does not trigger another publish
4648
assert len(publish_calls) == 3
4749

50+
# Triggers call when active is changed
51+
repo.active = True
52+
repo.save()
53+
54+
publish_calls = publish.call_args_list
55+
assert len(publish_calls) == 4
56+
57+
# Triggers call when activated is changed
58+
repo.activated = True
59+
repo.save()
60+
61+
publish_calls = publish.call_args_list
62+
assert len(publish_calls) == 5
63+
4864

4965
@pytest.mark.django_db
5066
def test_shelter_commit_sync(mocker):

graphql_api/tests/test_flake_aggregates.py

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)