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

Regression in 24.11.1: GitLab OAuth signup fails due to unchecked Pub/Sub initialization #1005

@CerebralXor

Description

@CerebralXor

In version 24.11.1, a regression was introduced in PR #940 (commit 8d317ae) where the new ShelterPubsub implementation unconditionally tries to initialize a Google Cloud Pub/Sub client, even when Pub/Sub is not configured. This causes user signup to fail when using GitLab OAuth.

The previous implementation (commit 63bcae7) had a guard clause that only initialized Pub/Sub if both project_id and topic_id were configured. This guard was lost in the refactor.

Steps to reproduce:

  • Deploy self-hosted with the codecov/self-hosted-api:24.11.1 container image and without any Google Cloud Pub/Sub configuration
  • Attempt to sign up using GitLab OAuth
  • Signup fails with error:
    google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found

Fix suggestion:
Add a guard clause in ShelterPubsub.__init__ to only initialize the Pub/Sub client if both SHELTER_PUBSUB_PROJECT_ID and SHELTER_PUBSUB_SYNC_REPO_TOPIC_ID are configured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions