Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codecov/settings_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
)

SHELTER_SHARED_SECRET = get_config("setup", "shelter_shared_secret", default=None)
SHELTER_ENABLED = get_config("setup", "shelter_enabled", default=True)

SENTRY_ENV = os.environ.get("CODECOV_ENV", False)
SENTRY_DSN = os.environ.get("SERVICES__SENTRY__SERVER_DSN", None)
Expand Down
2 changes: 2 additions & 0 deletions codecov/settings_enterprise.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@
]

GUEST_ACCESS = get_config("setup", "guest_access", default=True)

SHELTER_ENABLED = get_config("setup", "shelter_enabled", default=False)

Check warning on line 76 in codecov/settings_enterprise.py

View check run for this annotation

Codecov Notifications / codecov/patch

codecov/settings_enterprise.py#L76

Added line #L76 was not covered by tests
6 changes: 6 additions & 0 deletions utils/shelter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
return cls._instance

def __init__(self) -> None:
if not settings.SHELTER_ENABLED:
return

Check warning on line 27 in utils/shelter.py

View check run for this annotation

Codecov Notifications / codecov/patch

utils/shelter.py#L27

Added line #L27 was not covered by tests

if not self.pubsub_publisher:
self.pubsub_publisher = pubsub_v1.PublisherClient()
pubsub_project_id: str = settings.SHELTER_PUBSUB_PROJECT_ID
Expand All @@ -32,6 +35,9 @@
self.topic_path = self.pubsub_publisher.topic_path(pubsub_project_id, topic_id)

def publish(self, data: Dict[str, Any]) -> None:
if not settings.SHELTER_ENABLED:
return

Check warning on line 39 in utils/shelter.py

View check run for this annotation

Codecov Notifications / codecov/patch

utils/shelter.py#L39

Added line #L39 was not covered by tests

try:
self.pubsub_publisher.publish(
self.topic_path,
Expand Down
Loading