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

mozilla / relman-auto-nag / #5311

04 Nov 2024 05:43PM CUT coverage: 21.399% (-0.1%) from 21.516%
#5311

push

coveralls-python

jgraham
Add a rule to sync [webcompat:sightline] whiteboard entry

This should be set on all bugs that are part of the webcompat metrics
set, and by no bugs that aren't.

This initial approach just gets all the bugs that are either in that
set or have the whiteboard entry, and implements the logic to update
them in the client. Given that we expect initially to have ~700 bugs
in that set, this means we need to set the maximum number of bugs to
update to something rather high.

426 of 2906 branches covered (14.66%)

0 of 54 new or added lines in 3 files covered. (0.0%)

1 existing line in 1 file now uncovered.

1942 of 9075 relevant lines covered (21.4%)

0.21 hits per line

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

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

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

NEW
6
from bugbot import utils
×
7

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

13

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

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

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

NEW
36
    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