libmozdata 0.2.16__tar.gz → 0.2.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libmozdata-0.2.16/libmozdata.egg-info → libmozdata-0.2.19}/PKG-INFO +1 -1
- libmozdata-0.2.19/VERSION +1 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/HGFileInfo.py +1 -3
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/bugzilla.py +16 -21
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/connection.py +2 -1
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/hgmozilla.py +2 -4
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/phabricator.py +24 -2
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/redash.py +1 -3
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/socorro.py +3 -5
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/utils.py +6 -7
- {libmozdata-0.2.16 → libmozdata-0.2.19/libmozdata.egg-info}/PKG-INFO +1 -1
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata.egg-info/requires.txt +0 -1
- {libmozdata-0.2.16 → libmozdata-0.2.19}/requirements.txt +0 -1
- libmozdata-0.2.16/VERSION +0 -1
- {libmozdata-0.2.16 → libmozdata-0.2.19}/MANIFEST.in +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/README.md +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/BZInfo.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/FXRevision.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/FileStats.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/__init__.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/buildhub.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/clouseau.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/config.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/fx_trains.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/handler.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/lando.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/modules.json +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/modules.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/patchanalysis.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/vcs_map.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/versions.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata/wiki_parser.py +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata.egg-info/SOURCES.txt +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata.egg-info/dependency_links.txt +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata.egg-info/not-zip-safe +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/libmozdata.egg-info/top_level.txt +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/setup.cfg +0 -0
- {libmozdata-0.2.16 → libmozdata-0.2.19}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.2.19
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
import logging
|
|
6
6
|
import re
|
|
7
7
|
|
|
8
|
-
import six
|
|
9
|
-
|
|
10
8
|
from . import hgmozilla
|
|
11
9
|
from .connection import Query
|
|
12
10
|
|
|
@@ -32,7 +30,7 @@ class HGFileInfo(object):
|
|
|
32
30
|
self.node = node
|
|
33
31
|
self.date_type = "date" if date_type == "creation" else "pushdate"
|
|
34
32
|
self.data = {}
|
|
35
|
-
self.paths = [paths] if isinstance(paths,
|
|
33
|
+
self.paths = [paths] if isinstance(paths, str) else paths
|
|
36
34
|
for p in self.paths:
|
|
37
35
|
self.data[p] = []
|
|
38
36
|
self.bug_pattern = re.compile(r"[\t ]*[Bb][Uu][Gg][\t ]*([0-9]+)")
|
|
@@ -6,7 +6,6 @@ import functools
|
|
|
6
6
|
import re
|
|
7
7
|
|
|
8
8
|
import requests
|
|
9
|
-
import six
|
|
10
9
|
from requests import HTTPError
|
|
11
10
|
|
|
12
11
|
import libmozdata.versions
|
|
@@ -75,7 +74,7 @@ class Bugzilla(BugzillaBase):
|
|
|
75
74
|
super(Bugzilla, self).__init__(Bugzilla.URL, queries=queries, **kwargs)
|
|
76
75
|
else:
|
|
77
76
|
super(Bugzilla, self).__init__(Bugzilla.URL, **kwargs)
|
|
78
|
-
if isinstance(bugids,
|
|
77
|
+
if isinstance(bugids, str) or isinstance(bugids, dict):
|
|
79
78
|
self.bugids = [bugids]
|
|
80
79
|
elif isinstance(bugids, int):
|
|
81
80
|
self.bugids = [str(bugids)]
|
|
@@ -196,9 +195,9 @@ class Bugzilla(BugzillaBase):
|
|
|
196
195
|
|
|
197
196
|
def __merge_fields(f1, f2):
|
|
198
197
|
if f1:
|
|
199
|
-
f1 = {f1} if isinstance(f1,
|
|
198
|
+
f1 = {f1} if isinstance(f1, str) else set(f1)
|
|
200
199
|
if f2:
|
|
201
|
-
f2 = {f2} if isinstance(f2,
|
|
200
|
+
f2 = {f2} if isinstance(f2, str) else set(f2)
|
|
202
201
|
return list(f1.union(f2))
|
|
203
202
|
else:
|
|
204
203
|
return f1
|
|
@@ -257,7 +256,7 @@ class Bugzilla(BugzillaBase):
|
|
|
257
256
|
|
|
258
257
|
@staticmethod
|
|
259
258
|
def get_links(bugids):
|
|
260
|
-
if isinstance(bugids,
|
|
259
|
+
if isinstance(bugids, str) or isinstance(bugids, int):
|
|
261
260
|
return "https://bugzilla.mozilla.org/" + str(bugids)
|
|
262
261
|
else:
|
|
263
262
|
return ["https://bugzilla.mozilla.org/" + str(bugid) for bugid in bugids]
|
|
@@ -594,7 +593,7 @@ class Bugzilla(BugzillaBase):
|
|
|
594
593
|
header = self.get_header()
|
|
595
594
|
specials = {"count_only", "limit", "order", "offset"}
|
|
596
595
|
for query in self.bugids:
|
|
597
|
-
if isinstance(query,
|
|
596
|
+
if isinstance(query, str):
|
|
598
597
|
url = Bugzilla.API_URL + "?" + query
|
|
599
598
|
self.bugs_results.append(
|
|
600
599
|
self.session.get(
|
|
@@ -730,7 +729,7 @@ class Bugzilla(BugzillaBase):
|
|
|
730
729
|
bugs = json["bugs"]
|
|
731
730
|
if bugs:
|
|
732
731
|
for key in bugs.keys():
|
|
733
|
-
if isinstance(key,
|
|
732
|
+
if isinstance(key, str) and key.isdigit():
|
|
734
733
|
comments = bugs[key]
|
|
735
734
|
self.commenthandler.handle(comments, key)
|
|
736
735
|
elif self.RAISE_ERROR:
|
|
@@ -775,7 +774,7 @@ class Bugzilla(BugzillaBase):
|
|
|
775
774
|
bugs = json["bugs"]
|
|
776
775
|
if bugs:
|
|
777
776
|
for key in bugs.keys():
|
|
778
|
-
if isinstance(key,
|
|
777
|
+
if isinstance(key, str) and key.isdigit():
|
|
779
778
|
attachments = bugs[key]
|
|
780
779
|
self.attachmenthandler.handle(attachments, key)
|
|
781
780
|
elif self.RAISE_ERROR:
|
|
@@ -861,7 +860,7 @@ class BugzillaUser(BugzillaBase):
|
|
|
861
860
|
self.fault_user_handler = Handler.get(fault_user_handler, user_data)
|
|
862
861
|
|
|
863
862
|
if user_names is not None:
|
|
864
|
-
if isinstance(user_names,
|
|
863
|
+
if isinstance(user_names, str) or isinstance(user_names, int):
|
|
865
864
|
user_names = [user_names]
|
|
866
865
|
|
|
867
866
|
params = [
|
|
@@ -870,8 +869,7 @@ class BugzillaUser(BugzillaBase):
|
|
|
870
869
|
"names": [
|
|
871
870
|
user_name
|
|
872
871
|
for user_name in user_names
|
|
873
|
-
if isinstance(user_name,
|
|
874
|
-
and not user_name.isdigit()
|
|
872
|
+
if isinstance(user_name, str) and not user_name.isdigit()
|
|
875
873
|
],
|
|
876
874
|
"ids": [
|
|
877
875
|
str(user_id)
|
|
@@ -891,7 +889,7 @@ class BugzillaUser(BugzillaBase):
|
|
|
891
889
|
**kwargs,
|
|
892
890
|
)
|
|
893
891
|
elif search_strings is not None:
|
|
894
|
-
if isinstance(search_strings,
|
|
892
|
+
if isinstance(search_strings, str):
|
|
895
893
|
search_strings = [search_strings]
|
|
896
894
|
|
|
897
895
|
queries = []
|
|
@@ -952,9 +950,9 @@ class BugzillaProduct(BugzillaBase):
|
|
|
952
950
|
|
|
953
951
|
if include_fields:
|
|
954
952
|
if "include_fields" in params:
|
|
955
|
-
if isinstance(include_fields,
|
|
953
|
+
if isinstance(include_fields, str):
|
|
956
954
|
include_fields = [include_fields]
|
|
957
|
-
if isinstance(params.get("include_fields"),
|
|
955
|
+
if isinstance(params.get("include_fields"), str):
|
|
958
956
|
params["include_fields"] = [params["include_fields"]]
|
|
959
957
|
|
|
960
958
|
params["include_fields"] = list(
|
|
@@ -965,9 +963,9 @@ class BugzillaProduct(BugzillaBase):
|
|
|
965
963
|
|
|
966
964
|
if product_types:
|
|
967
965
|
if "type" in params:
|
|
968
|
-
if isinstance(product_types,
|
|
966
|
+
if isinstance(product_types, str):
|
|
969
967
|
product_types = [product_types]
|
|
970
|
-
if isinstance(params.get("type"),
|
|
968
|
+
if isinstance(params.get("type"), str):
|
|
971
969
|
params["type"] = [params["type"]]
|
|
972
970
|
|
|
973
971
|
params["type"] = list(set(params["type"]).union(product_types))
|
|
@@ -975,9 +973,7 @@ class BugzillaProduct(BugzillaBase):
|
|
|
975
973
|
params["type"] = product_types
|
|
976
974
|
|
|
977
975
|
elif product_names is not None:
|
|
978
|
-
if isinstance(product_names,
|
|
979
|
-
product_names, int
|
|
980
|
-
):
|
|
976
|
+
if isinstance(product_names, str) or isinstance(product_names, int):
|
|
981
977
|
product_names = [product_names]
|
|
982
978
|
|
|
983
979
|
params = {
|
|
@@ -986,8 +982,7 @@ class BugzillaProduct(BugzillaBase):
|
|
|
986
982
|
"names": [
|
|
987
983
|
product_name
|
|
988
984
|
for product_name in product_names
|
|
989
|
-
if isinstance(product_name,
|
|
990
|
-
and not product_name.isdigit()
|
|
985
|
+
if isinstance(product_name, str) and not product_name.isdigit()
|
|
991
986
|
],
|
|
992
987
|
"ids": [
|
|
993
988
|
str(product_id)
|
|
@@ -61,7 +61,8 @@ class Connection(object):
|
|
|
61
61
|
)
|
|
62
62
|
|
|
63
63
|
# Error 429 is for 'Too many requests' => we retry
|
|
64
|
-
|
|
64
|
+
# Also retry on server errors.
|
|
65
|
+
STATUS_FORCELIST = [429, 500, 502, 503, 504]
|
|
65
66
|
|
|
66
67
|
def __init__(self, base_url, queries=None, **kwargs):
|
|
67
68
|
"""Constructor
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
3
3
|
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
4
4
|
|
|
5
|
-
import six
|
|
6
|
-
|
|
7
5
|
from . import config
|
|
8
6
|
from .connection import Connection, Query
|
|
9
7
|
|
|
@@ -244,7 +242,7 @@ class FileInfo(Mercurial):
|
|
|
244
242
|
|
|
245
243
|
__base = {"node": node, "file": None}
|
|
246
244
|
|
|
247
|
-
if isinstance(paths,
|
|
245
|
+
if isinstance(paths, str):
|
|
248
246
|
__base["file"] = paths
|
|
249
247
|
_dict = {}
|
|
250
248
|
data[paths] = _dict
|
|
@@ -334,7 +332,7 @@ class Annotate(Mercurial):
|
|
|
334
332
|
|
|
335
333
|
__base = {"node": node, "file": None}
|
|
336
334
|
|
|
337
|
-
if isinstance(paths,
|
|
335
|
+
if isinstance(paths, str):
|
|
338
336
|
__base["file"] = paths
|
|
339
337
|
_dict = {}
|
|
340
338
|
data[paths] = _dict
|
|
@@ -19,7 +19,9 @@ HGMO_JSON_REV_URL_TEMPLATE = "https://hg.mozilla.org/mozilla-central/json-rev/{}
|
|
|
19
19
|
MOZILLA_PHABRICATOR_PROD = "https://phabricator.services.mozilla.com/api/"
|
|
20
20
|
|
|
21
21
|
PhabricatorPatch = collections.namedtuple(
|
|
22
|
-
"PhabricatorPatch",
|
|
22
|
+
"PhabricatorPatch",
|
|
23
|
+
"id, phid, patch, base_revision, commits, merged, first_public_parent",
|
|
24
|
+
defaults=[None],
|
|
23
25
|
)
|
|
24
26
|
|
|
25
27
|
logger = logging.getLogger(__name__)
|
|
@@ -705,13 +707,33 @@ class PhabricatorAPI(object):
|
|
|
705
707
|
diff_phid=diff["phid"], attachments={"commits": True}
|
|
706
708
|
)
|
|
707
709
|
commits = diffs[0]["attachments"]["commits"].get("commits", [])
|
|
710
|
+
query_diffs = self.request("differential.querydiffs", ids=[diff["id"]])
|
|
711
|
+
properties = query_diffs.get(str(diff["id"]), {}).get("properties", {})
|
|
712
|
+
local_commits = properties.get("local:commits") or {}
|
|
713
|
+
if not local_commits:
|
|
714
|
+
logger.warn("Diff %s has no local:commits property", diff["id"])
|
|
715
|
+
|
|
716
|
+
first_public_parent = None
|
|
717
|
+
# local:commits is keyed by the local commit node, which may differ from
|
|
718
|
+
# the public commit identifier exposed by Phabricator's commits attachment
|
|
719
|
+
# hence iterating over values (there is only one in the dict but key unknown).
|
|
720
|
+
for local_commit in local_commits.values():
|
|
721
|
+
first_public_parent = local_commit.get("firstPublicParent")
|
|
722
|
+
if first_public_parent:
|
|
723
|
+
break
|
|
708
724
|
logger.info(
|
|
709
725
|
"Adding patch #{} to stack ({})".format(
|
|
710
726
|
diff["id"], "merged" if merged else "non-merged"
|
|
711
727
|
)
|
|
712
728
|
)
|
|
713
729
|
return PhabricatorPatch(
|
|
714
|
-
diff["id"],
|
|
730
|
+
diff["id"],
|
|
731
|
+
diff["phid"],
|
|
732
|
+
patch,
|
|
733
|
+
diff["baseRevision"],
|
|
734
|
+
commits,
|
|
735
|
+
merged,
|
|
736
|
+
first_public_parent,
|
|
715
737
|
)
|
|
716
738
|
|
|
717
739
|
# Load full diff when not provided by user
|
|
@@ -6,8 +6,6 @@ import functools
|
|
|
6
6
|
import re
|
|
7
7
|
from datetime import timedelta
|
|
8
8
|
|
|
9
|
-
import six
|
|
10
|
-
|
|
11
9
|
from . import config, utils
|
|
12
10
|
from .connection import Connection, Query
|
|
13
11
|
|
|
@@ -93,7 +91,7 @@ class Redash(Connection):
|
|
|
93
91
|
dict: containing result in json for each query
|
|
94
92
|
"""
|
|
95
93
|
data = {}
|
|
96
|
-
if isinstance(query_ids,
|
|
94
|
+
if isinstance(query_ids, str):
|
|
97
95
|
url = Redash.API_URL + "/" + query_ids + "/results.json"
|
|
98
96
|
Redash(
|
|
99
97
|
Query(
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
3
3
|
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
4
4
|
|
|
5
|
-
import six
|
|
6
|
-
|
|
7
5
|
from . import config, utils
|
|
8
6
|
from .connection import Connection, Query
|
|
9
7
|
|
|
@@ -85,7 +83,7 @@ class SuperSearch(Socorro):
|
|
|
85
83
|
"url" in k
|
|
86
84
|
or "email" in k
|
|
87
85
|
or (
|
|
88
|
-
(isinstance(v, list) or isinstance(v,
|
|
86
|
+
(isinstance(v, list) or isinstance(v, str))
|
|
89
87
|
and ("url" in v or "email" in v)
|
|
90
88
|
)
|
|
91
89
|
):
|
|
@@ -175,7 +173,7 @@ class ProcessedCrash(Socorro):
|
|
|
175
173
|
data = {}
|
|
176
174
|
__base = {"crash_id": None, "datatype": "processed"}
|
|
177
175
|
|
|
178
|
-
if isinstance(crashids,
|
|
176
|
+
if isinstance(crashids, str):
|
|
179
177
|
__base["crash_id"] = crashids
|
|
180
178
|
_dict = {}
|
|
181
179
|
data[crashids] = _dict
|
|
@@ -243,7 +241,7 @@ class Bugs(Socorro):
|
|
|
243
241
|
if signature in data:
|
|
244
242
|
data[signature].add(hit["id"])
|
|
245
243
|
|
|
246
|
-
if isinstance(signatures,
|
|
244
|
+
if isinstance(signatures, str):
|
|
247
245
|
data = {signatures: set()}
|
|
248
246
|
Bugs(
|
|
249
247
|
params={"signatures": signatures},
|
|
@@ -14,7 +14,6 @@ from itertools import count
|
|
|
14
14
|
import dateutil.parser
|
|
15
15
|
import pytz
|
|
16
16
|
import requests
|
|
17
|
-
import six
|
|
18
17
|
from dateutil.relativedelta import relativedelta
|
|
19
18
|
from requests.utils import quote
|
|
20
19
|
from urllib3.util.retry import Retry
|
|
@@ -87,7 +86,7 @@ def get_timestamp(dt):
|
|
|
87
86
|
Returns:
|
|
88
87
|
int: the corresponding timestamp
|
|
89
88
|
"""
|
|
90
|
-
if isinstance(dt,
|
|
89
|
+
if isinstance(dt, str):
|
|
91
90
|
dt = datetime.now(timezone.utc) if dt == "now" else get_date_ymd(dt)
|
|
92
91
|
return int(calendar.timegm(dt.timetuple()))
|
|
93
92
|
|
|
@@ -162,7 +161,7 @@ def get_date(_date, delta=None):
|
|
|
162
161
|
Returns:
|
|
163
162
|
str: the date as a string 'Year-month-day'
|
|
164
163
|
"""
|
|
165
|
-
if isinstance(_date,
|
|
164
|
+
if isinstance(_date, str):
|
|
166
165
|
_date = get_date_ymd(_date)
|
|
167
166
|
if delta:
|
|
168
167
|
_date -= timedelta(delta)
|
|
@@ -351,16 +350,16 @@ def get_channels():
|
|
|
351
350
|
|
|
352
351
|
|
|
353
352
|
def get_str_list(x):
|
|
354
|
-
if isinstance(x,
|
|
353
|
+
if isinstance(x, str):
|
|
355
354
|
return [x]
|
|
356
|
-
if isinstance(x,
|
|
355
|
+
if isinstance(x, int):
|
|
357
356
|
return [str[x]]
|
|
358
357
|
if isinstance(x, list) or isinstance(x, set):
|
|
359
|
-
return [str(y) if isinstance(y,
|
|
358
|
+
return [str(y) if isinstance(y, int) else y for y in x]
|
|
360
359
|
|
|
361
360
|
|
|
362
361
|
def get_x_fwed_for_str(s):
|
|
363
|
-
if isinstance(s,
|
|
362
|
+
if isinstance(s, str):
|
|
364
363
|
return ", ".join(map(lambda x: x.strip(" \t"), s.split(",")))
|
|
365
364
|
else:
|
|
366
365
|
return ", ".join(map(lambda x: x.strip(" \t"), s))
|
libmozdata-0.2.16/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.2.16
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|