• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / relman-auto-nag / #5375

12 Dec 2024 08:13PM CUT coverage: 21.203% (-0.07%) from 21.274%
#5375

push

coveralls-python

jgraham
Add webcompat_score rule

This sets the cf_webcompat_score field to match a value computed in BigQuery.

426 of 2950 branches covered (14.44%)

0 of 31 new or added lines in 1 file covered. (0.0%)

1943 of 9164 relevant lines covered (21.2%)

0.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/bugbot/gcp.py
1
from typing import Iterable, Optional
×
2

3
from google.cloud import bigquery
×
4
from google.oauth2 import service_account
×
5

6
from bugbot import utils
×
7

8
SCOPES = {
×
9
    "cloud-platform": "https://www.googleapis.com/auth/cloud-platform",
10
    "drive": "https://www.googleapis.com/auth/drive",
11
}
12

13

14
def get_bigquery_client(
×
15
    project: str, scopes: Optional[Iterable[str]] = None
16
) -> bigquery.Client:
17
    """Get a bigquery.Client for a given project
18

19
    Args:
20
        project: Name of the project.
21
        scopes: Optional iterable containing the scopes the client should have.
22
                By default this will be the cloud-platform scopes required to
23
                run queries.
24
    Returns:
25
        bigquery.Client
26
    """
27
    scope_urls = (
×
28
        [SCOPES["cloud-platform"]]
29
        if scopes is None
30
        else [SCOPES.get(item, item) for item in scopes]
31
    )
32

33
    credentials = service_account.Credentials.from_service_account_info(
×
34
        utils.get_gcp_service_account_info()
35
    ).with_scopes(scope_urls)
36

37
    return bigquery.Client(project=project, credentials=credentials)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc