libmozdata 0.2.4__tar.gz → 0.2.7__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.
Files changed (39) hide show
  1. {libmozdata-0.2.4/libmozdata.egg-info → libmozdata-0.2.7}/PKG-INFO +1 -1
  2. libmozdata-0.2.7/VERSION +1 -0
  3. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/bugzilla.py +9 -0
  4. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/clouseau.py +18 -9
  5. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/phabricator.py +7 -3
  6. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/release_owners.py +2 -4
  7. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/socorro.py +7 -0
  8. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/utils.py +37 -0
  9. {libmozdata-0.2.4 → libmozdata-0.2.7/libmozdata.egg-info}/PKG-INFO +1 -1
  10. libmozdata-0.2.4/VERSION +0 -1
  11. {libmozdata-0.2.4 → libmozdata-0.2.7}/MANIFEST.in +0 -0
  12. {libmozdata-0.2.4 → libmozdata-0.2.7}/README.md +0 -0
  13. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/BZInfo.py +0 -0
  14. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/FXRevision.py +0 -0
  15. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/FileStats.py +0 -0
  16. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/HGFileInfo.py +0 -0
  17. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/__init__.py +0 -0
  18. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/buildhub.py +1 -1
  19. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/config.py +0 -0
  20. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/connection.py +0 -0
  21. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/fx_trains.py +0 -0
  22. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/handler.py +0 -0
  23. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/hgmozilla.py +0 -0
  24. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/lando.py +0 -0
  25. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/modules.json +0 -0
  26. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/modules.py +0 -0
  27. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/patchanalysis.py +0 -0
  28. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/redash.py +0 -0
  29. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/vcs_map.py +0 -0
  30. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/versions.py +0 -0
  31. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata/wiki_parser.py +0 -0
  32. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata.egg-info/SOURCES.txt +0 -0
  33. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata.egg-info/dependency_links.txt +0 -0
  34. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata.egg-info/not-zip-safe +0 -0
  35. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata.egg-info/requires.txt +0 -0
  36. {libmozdata-0.2.4 → libmozdata-0.2.7}/libmozdata.egg-info/top_level.txt +0 -0
  37. {libmozdata-0.2.4 → libmozdata-0.2.7}/requirements.txt +0 -0
  38. {libmozdata-0.2.4 → libmozdata-0.2.7}/setup.cfg +0 -0
  39. {libmozdata-0.2.4 → libmozdata-0.2.7}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: libmozdata
3
- Version: 0.2.4
3
+ Version: 0.2.7
4
4
  Summary: Library to access and aggregate several Mozilla data sources.
5
5
  Home-page: https://github.com/mozilla/libmozdata
6
6
  Author: Mozilla Release Management
@@ -0,0 +1 @@
1
+ 0.2.7
@@ -404,6 +404,15 @@ class Bugzilla(BugzillaBase):
404
404
  "inbound",
405
405
  )
406
406
  ]
407
+ elif channel == "autoland":
408
+ landing_patterns += [
409
+ (
410
+ re.compile(
411
+ r"://hg.mozilla.org/integration/autoland/rev/([0-9a-f]+)"
412
+ ),
413
+ "autoland",
414
+ )
415
+ ]
407
416
  else:
408
417
  raise Exception("Unexpected channel: " + channel)
409
418
 
@@ -2,6 +2,9 @@
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
+
6
+ from libmozdata.utils import batched
7
+
5
8
  from . import config
6
9
  from .connection import Connection, Query
7
10
 
@@ -54,14 +57,20 @@ class Reports(CrashClouseau):
54
57
  dict: the reports by signatures
55
58
  """
56
59
  data = {}
57
- cls(
58
- params={
59
- "signatures": signatures,
60
- "product": product,
61
- "channel": channel,
62
- },
63
- handler=cls._default_handler,
64
- handlerdata=data,
65
- ).wait()
60
+ requests = [
61
+ cls(
62
+ params={
63
+ "signatures": signatures_batch,
64
+ "product": product,
65
+ "channel": channel,
66
+ },
67
+ handler=cls._default_handler,
68
+ handlerdata=data,
69
+ )
70
+ for signatures_batch in batched(signatures, 20)
71
+ ]
72
+
73
+ for request in requests:
74
+ request.wait()
66
75
 
67
76
  return data
@@ -7,6 +7,7 @@ import collections
7
7
  import enum
8
8
  import json
9
9
  import logging
10
+ from functools import cached_property
10
11
  from urllib.parse import urlencode, urlparse
11
12
 
12
13
  import hglib
@@ -213,9 +214,12 @@ class PhabricatorAPI(object):
213
214
  self.url = url
214
215
  assert self.url.endswith("/api/"), "Phabricator API must end with /api/"
215
216
 
216
- # Test authentication
217
- self.user = self.request("user.whoami")
218
- logger.info("Authenticated on {} as {}".format(self.url, self.user["realName"]))
217
+ @cached_property
218
+ def user(self):
219
+ """
220
+ Return the authenticated user details
221
+ """
222
+ return self.request("user.whoami")
219
223
 
220
224
  @property
221
225
  def hostname(self):
@@ -48,7 +48,6 @@ def get_owners():
48
48
  "Secondary",
49
49
  "Engineering REO",
50
50
  "Release Duty",
51
- "QA Owner",
52
51
  "Corresponding ESR",
53
52
  "Release Date",
54
53
  ] != table[0]:
@@ -58,7 +57,7 @@ def get_owners():
58
57
  for row in table[1:]:
59
58
  try:
60
59
  # sometimes the date is 2019-XX-XX (when the date is not known)
61
- release_date = utils.get_date_ymd(row[7])
60
+ release_date = utils.get_date_ymd(row[6])
62
61
  except (AssertionError, ValueError):
63
62
  continue
64
63
 
@@ -69,8 +68,7 @@ def get_owners():
69
68
  "secondary": row[2],
70
69
  "engineering reo": row[3],
71
70
  "release duty": _get_list_people(row[4]),
72
- "qa owner": row[5],
73
- "corresponding esr": row[6],
71
+ "corresponding esr": row[5],
74
72
  "release date": release_date,
75
73
  }
76
74
  )
@@ -63,6 +63,13 @@ class SuperSearch(Socorro):
63
63
  automatically support retrieving it by redirecting the request to the
64
64
  unredacted endpoint (i.e., SuperSearchUnredacted).
65
65
  """
66
+ if not isinstance(params, dict):
67
+ # This is a workaround to avoid crashing when the params values is a
68
+ # list of params. We could instead of this, check each item in the
69
+ # list, but it's not worth it since this method is just for backward
70
+ # compatibility.
71
+ return False
72
+
66
73
  unredacted = False
67
74
  if "_facets" in params:
68
75
  facets = params["_facets"]
@@ -8,6 +8,7 @@ import operator
8
8
  import os.path
9
9
  import random
10
10
  from datetime import date, datetime, timedelta
11
+ from itertools import count
11
12
 
12
13
  import dateutil.parser
13
14
  import pytz
@@ -381,3 +382,39 @@ def get_language(path):
381
382
  for lang, names in langs.items():
382
383
  if name in names or extension in names:
383
384
  return lang
385
+
386
+
387
+ # This is roughly equivalent to the itertools.islice which was added in
388
+ # Python 3.10.
389
+ # Copied from https://docs.python.org/3/library/itertools.html#itertools.islice
390
+ def islice(iterable, *args):
391
+ # islice('ABCDEFG', 2) → A B
392
+ # islice('ABCDEFG', 2, 4) → C D
393
+ # islice('ABCDEFG', 2, None) → C D E F G
394
+ # islice('ABCDEFG', 0, None, 2) → A C E G
395
+
396
+ s = slice(*args)
397
+ start = 0 if s.start is None else s.start
398
+ stop = s.stop
399
+ step = 1 if s.step is None else s.step
400
+ if start < 0 or (stop is not None and stop < 0) or step <= 0:
401
+ raise ValueError
402
+
403
+ indices = count() if stop is None else range(max(start, stop))
404
+ next_i = start
405
+ for i, element in zip(indices, iterable):
406
+ if i == next_i:
407
+ yield element
408
+ next_i += step
409
+
410
+
411
+ # This is roughly equivalent to the itertools.batched which was added in
412
+ # Python 3.12.
413
+ # Copied from https://docs.python.org/3/library/itertools.html#itertools.batched
414
+ def batched(iterable, n):
415
+ # batched('ABCDEFG', 3) → ABC DEF G
416
+ if n < 1:
417
+ raise ValueError("n must be at least one")
418
+ iterator = iter(iterable)
419
+ while batch := tuple(islice(iterator, n)):
420
+ yield batch
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: libmozdata
3
- Version: 0.2.4
3
+ Version: 0.2.7
4
4
  Summary: Library to access and aggregate several Mozilla data sources.
5
5
  Home-page: https://github.com/mozilla/libmozdata
6
6
  Author: Mozilla Release Management
libmozdata-0.2.4/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.4
File without changes
File without changes
@@ -6,9 +6,9 @@ import json
6
6
  import os
7
7
  import re
8
8
  from collections import defaultdict
9
+ from distutils.version import LooseVersion
9
10
 
10
11
  import requests
11
- from distutils.version import LooseVersion
12
12
 
13
13
  SEARCH_URL = os.getenv("BUILDHUB_SEARCH_URL", "https://buildhub.moz.tools/api/search")
14
14
 
File without changes
File without changes
File without changes