sirmordred 1.1.0__tar.gz → 1.1.4rc1__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 (99) hide show
  1. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/PKG-INFO +4 -5
  2. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/pyproject.toml +6 -6
  3. sirmordred-1.1.4rc1/sirmordred/_version.py +2 -0
  4. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task.py +2 -2
  5. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task_collection.py +2 -2
  6. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task_identities.py +2 -2
  7. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task_panels.py +4 -4
  8. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/micro.py +42 -6
  9. sirmordred-1.1.0/sirmordred/_version.py +0 -2
  10. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/LICENSE +0 -0
  11. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/README.md +0 -0
  12. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/menu.yaml +0 -0
  13. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/__init__.py +0 -0
  14. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/bin/sirmordred.py +0 -0
  15. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/config.py +0 -0
  16. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/error.py +0 -0
  17. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/github.py +0 -0
  18. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/sirmordred.py +0 -0
  19. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task_autorefresh.py +0 -0
  20. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task_enrich.py +0 -0
  21. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task_manager.py +0 -0
  22. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/task_projects.py +0 -0
  23. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/find_affiliation_conflicts.py +0 -0
  24. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/grimoirelab_valid.yml +0 -0
  25. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/healthcheck.py +0 -0
  26. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/logs/all.log +0 -0
  27. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/panels_config.py +0 -0
  28. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/projects.json +0 -0
  29. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/projects_json2yml.py +0 -0
  30. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/sirmordred/utils/setup.cfg +0 -0
  31. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/aliases.json +0 -0
  32. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/askbot.archive +0 -0
  33. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/bugzilla.archive +0 -0
  34. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/bugzillarest.archive +0 -0
  35. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/confluence.archive +0 -0
  36. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/crates.archive +0 -0
  37. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/discourse.archive +0 -0
  38. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/dockerhub.archive +0 -0
  39. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/functest.archive +0 -0
  40. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/gerrit.archive +0 -0
  41. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/github-issue.archive +0 -0
  42. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/github-pull.archive +0 -0
  43. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/gitlab-issue.archive +0 -0
  44. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/gitlab-merge.archive +0 -0
  45. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/googlehits.archive +0 -0
  46. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/jenkins.archive +0 -0
  47. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/jira.archive +0 -0
  48. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/launchpad.archive +0 -0
  49. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/mediawiki-1.23.archive +0 -0
  50. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/mediawiki-1.28.archive +0 -0
  51. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/meetup.archive +0 -0
  52. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/mozillaclub.archive +0 -0
  53. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/nntp.archive +0 -0
  54. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/phabricator.archive +0 -0
  55. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/redmine.archive +0 -0
  56. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/remo.archive +0 -0
  57. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/rss.archive +0 -0
  58. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/slack.archive +0 -0
  59. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/stackexchange.archive +0 -0
  60. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/telegram.archive +0 -0
  61. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives/twitter.archive +0 -0
  62. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives-test-projects.json +0 -0
  63. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/archives-test.cfg +0 -0
  64. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/eclipse-projects.json +0 -0
  65. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/healthcheck_cache_invalid.json +0 -0
  66. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/healthcheck_cache_valid.json +0 -0
  67. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/healthcheck_cache_wrong_key.json +0 -0
  68. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/mordred.log +0 -0
  69. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/orgs_sortinghat.json +0 -0
  70. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/perceval_identities_sortinghat.json +0 -0
  71. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/remote_identities_sortinghat.json +0 -0
  72. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/task-identities-data.json +0 -0
  73. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/task-params-expected +0 -0
  74. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/task-params-test-projects.json +0 -0
  75. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/task-params-test.cfg +0 -0
  76. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/data/url-projects.json +0 -0
  77. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/run_tests.py +0 -0
  78. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/sortinghat_settings.py +0 -0
  79. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test-no-collection.cfg +0 -0
  80. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test-no-sh.cfg +0 -0
  81. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test-projects-no-collection.json +0 -0
  82. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test-projects.json +0 -0
  83. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test-repos-projects.json +0 -0
  84. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test-repos.cfg +0 -0
  85. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test.cfg +0 -0
  86. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_config.py +0 -0
  87. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_github.py +0 -0
  88. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_healthcheck.py +0 -0
  89. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_sirmordred.py +0 -0
  90. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_studies.cfg +0 -0
  91. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task.py +0 -0
  92. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task_autorefresh.py +0 -0
  93. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task_collection.py +0 -0
  94. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task_enrich.py +0 -0
  95. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task_identities.py +0 -0
  96. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task_manager.py +0 -0
  97. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task_panels.py +0 -0
  98. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_task_projects.py +0 -0
  99. {sirmordred-1.1.0 → sirmordred-1.1.4rc1}/tests/test_wrong.cfg +0 -0
@@ -1,27 +1,26 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sirmordred
3
- Version: 1.1.0
3
+ Version: 1.1.4rc1
4
4
  Summary: Drive GrimoireLab tools to produce a dashboard
5
5
  Home-page: https://chaoss.github.io/grimoirelab/
6
6
  License: GPL-3.0+
7
7
  Keywords: development,grimoirelab
8
8
  Author: GrimoireLab Developers
9
- Requires-Python: >=3.8,<4.0
9
+ Requires-Python: >=3.9,<4.0
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Intended Audience :: Developers
12
12
  Classifier: Intended Audience :: Science/Research
13
13
  Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Topic :: Software Development
20
19
  Requires-Dist: cereslib (>=0.3)
21
- Requires-Dist: colorlog (==4.1.0)
20
+ Requires-Dist: colorlog (>=6.4.1,<7.0.0)
22
21
  Requires-Dist: elasticsearch (==6.3.1)
23
22
  Requires-Dist: elasticsearch-dsl (==6.3.1)
24
- Requires-Dist: file-read-backwards (==2.0.0)
23
+ Requires-Dist: file-read-backwards (>=3.1.0,<4.0.0)
25
24
  Requires-Dist: graal (>=0.3)
26
25
  Requires-Dist: grimoire-elk (>=0.102)
27
26
  Requires-Dist: grimoirelab-panels (>=0.1)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "sirmordred"
3
- version = "1.1.0"
3
+ version = "1.1.4-rc.1"
4
4
  description = "Drive GrimoireLab tools to produce a dashboard"
5
5
  authors = [
6
6
  "GrimoireLab Developers"
@@ -41,12 +41,12 @@ classifiers = [
41
41
  'panels_config.py' = 'sirmordred.utils.panels_config:main'
42
42
 
43
43
  [tool.poetry.dependencies]
44
- python = "^3.8"
44
+ python = "^3.9"
45
45
 
46
- colorlog = "4.1.0"
46
+ colorlog = "^6.4.1"
47
47
  elasticsearch = "6.3.1"
48
48
  elasticsearch-dsl = "6.3.1"
49
- file-read-backwards = "2.0.0"
49
+ file-read-backwards = "^3.1.0"
50
50
  grimoirelab-toolkit = { version = ">=0.3", allow-prereleases = true}
51
51
  sortinghat = { version = ">=0.7.20", allow-prereleases = true}
52
52
  kidash = { version = ">=0.5", allow-prereleases = true}
@@ -62,8 +62,8 @@ graal = { version = ">=0.3", allow-prereleases = true}
62
62
 
63
63
  [tool.poetry.dev-dependencies]
64
64
  httpretty = "^1.1.4"
65
- flake8 = "^4.0.1"
66
- coverage = "^6.3.2"
65
+ flake8 = "^7.1.1"
66
+ coverage = "^7.2.3"
67
67
 
68
68
  [build-system]
69
69
  requires = ["poetry-core>=1.0.0"]
@@ -0,0 +1,2 @@
1
+ # File auto-generated by semverup on 2024-12-11 09:49:14.439484
2
+ __version__ = "1.1.4-rc.1"
@@ -147,9 +147,9 @@ class Task():
147
147
  continue
148
148
 
149
149
  # If param is boolean, no values must be added
150
- if type(section_param) == bool:
150
+ if isinstance(section_param, bool):
151
151
  params.append("--" + p) if section_param else None
152
- elif type(section_param) == list:
152
+ elif isinstance(section_param, list):
153
153
  # '--blacklist-jobs', 'a', 'b', 'c'
154
154
  # 'a', 'b', 'c' must be added as items in the list
155
155
  params.append("--" + p)
@@ -41,8 +41,8 @@ logger = logging.getLogger(__name__)
41
41
  class TaskRawDataCollection(Task):
42
42
  """ Basic class shared by all collection tasks """
43
43
 
44
- def __init__(self, config, backend_section=None, allowed_repos=None):
45
- super().__init__(config)
44
+ def __init__(self, config, sortinghat_client=None, backend_section=None, allowed_repos=None):
45
+ super().__init__(config, sortinghat_client)
46
46
 
47
47
  self.backend_section = backend_section
48
48
  self.allowed_repos = set(allowed_repos) if allowed_repos else None
@@ -38,8 +38,8 @@ logger = logging.getLogger(__name__)
38
38
  class TaskIdentitiesMerge(Task):
39
39
  """ Task for processing identities in SortingHat """
40
40
 
41
- def __init__(self, conf, soringhat_client):
42
- super().__init__(conf, soringhat_client)
41
+ def __init__(self, conf, sortinghat_client):
42
+ super().__init__(conf, sortinghat_client)
43
43
  self.last_autorefresh = datetime.utcnow() # Last autorefresh date
44
44
 
45
45
  def is_backend_task(self):
@@ -264,8 +264,8 @@ class TaskPanels(Task):
264
264
  # Panels to be uploaded always, no matter the data sources configured
265
265
  panels_common = panels_multi_ds + ["panels/json/about.json"]
266
266
 
267
- def __init__(self, conf):
268
- super().__init__(conf)
267
+ def __init__(self, conf, sortinghat_client=None):
268
+ super().__init__(conf, sortinghat_client)
269
269
  # Read panels and menu description from yaml file
270
270
  with open(self.conf['general']['menu_file'], 'r') as f:
271
271
  try:
@@ -473,8 +473,8 @@ class TaskPanelsMenu(Task):
473
473
  }
474
474
  }
475
475
 
476
- def __init__(self, conf):
477
- super().__init__(conf)
476
+ def __init__(self, conf, sortinghat_client=None):
477
+ super().__init__(conf, sortinghat_client)
478
478
  # Read panels and menu description from yaml file """
479
479
  with open(self.conf['general']['menu_file'], 'r') as f:
480
480
  try:
@@ -33,6 +33,7 @@ from sirmordred.task_identities import TaskIdentitiesMerge
33
33
  from sirmordred.task_enrich import TaskEnrich
34
34
  from sirmordred.task_panels import TaskPanels, TaskPanelsMenu
35
35
  from sirmordred.task_projects import TaskProjects
36
+ from sortinghat.cli.client import SortingHatClient
36
37
 
37
38
  COLOR_LOG_FORMAT_SUFFIX = "\033[1m %(log_color)s "
38
39
  LOG_COLORS = {'DEBUG': 'white', 'INFO': 'cyan', 'WARNING': 'yellow', 'ERROR': 'red', 'CRITICAL': 'red,bg_white'}
@@ -50,6 +51,34 @@ def main():
50
51
  args.panels)
51
52
 
52
53
 
54
+ def create_sortinghat_client(config):
55
+ """Create a SortingHat client"""
56
+
57
+ conf = config.get_conf()
58
+
59
+ sortinghat = conf.get('sortinghat', None)
60
+ if not sortinghat:
61
+ return None
62
+
63
+ db_user = sortinghat['user'] if sortinghat else None
64
+ db_password = sortinghat['password'] if sortinghat else None
65
+ db_host = sortinghat['host'] if sortinghat else '127.0.0.1'
66
+ db_path = sortinghat.get('path', None) if sortinghat else None
67
+ db_port = sortinghat.get('port', None) if sortinghat else None
68
+ db_ssl = sortinghat.get('ssl', False) if sortinghat else False
69
+ db_verify_ssl = sortinghat.get('verify_ssl', True) if sortinghat else True
70
+ db_tenant = sortinghat.get('tenant', True) if sortinghat else None
71
+
72
+ client = SortingHatClient(host=db_host, port=db_port,
73
+ path=db_path, ssl=db_ssl,
74
+ user=db_user, password=db_password,
75
+ verify_ssl=db_verify_ssl,
76
+ tenant=db_tenant)
77
+ client.connect()
78
+
79
+ return client
80
+
81
+
53
82
  def micro_mordred(config, backend_sections, repos_to_check, raw, identities_merge, enrich, panels):
54
83
  """Execute the Mordred tasks using the configuration file.
55
84
 
@@ -66,12 +95,17 @@ def micro_mordred(config, backend_sections, repos_to_check, raw, identities_merg
66
95
  for backend in backend_sections:
67
96
  get_raw(config, backend, repos_to_check)
68
97
 
98
+ if identities_merge or enrich:
99
+ sortinghat_client = create_sortinghat_client(config)
100
+ else:
101
+ sortinghat_client = None
102
+
69
103
  if identities_merge:
70
- get_identities_merge(config)
104
+ get_identities_merge(config, sortinghat_client)
71
105
 
72
106
  if enrich:
73
107
  for backend in backend_sections:
74
- get_enrich(config, backend, repos_to_check)
108
+ get_enrich(config, sortinghat_client, backend, repos_to_check)
75
109
 
76
110
  if panels:
77
111
  get_panels(config)
@@ -97,29 +131,31 @@ def get_raw(config, backend_section, repos_to_check=None):
97
131
  sys.exit(-1)
98
132
 
99
133
 
100
- def get_identities_merge(config):
134
+ def get_identities_merge(config, sortinghat_client):
101
135
  """Execute the merge identities phase
102
136
 
137
+ :param sortinghat_client: a SortingHat client
103
138
  :param config: a Mordred config object
104
139
  """
105
140
  TaskProjects(config).execute()
106
- task = TaskIdentitiesMerge(config)
141
+ task = TaskIdentitiesMerge(config, sortinghat_client)
107
142
  task.execute()
108
143
  logging.info("Merging identities finished!")
109
144
 
110
145
 
111
- def get_enrich(config, backend_section, repos_to_check=None):
146
+ def get_enrich(config, sortinghat_client, backend_section, repos_to_check=None):
112
147
  """Execute the enrich phase for a given backend section
113
148
 
114
149
  Repos are only checked if they are in BOTH `repos_to_check` and the `projects.json`
115
150
 
116
151
  :param config: a Mordred config object
152
+ :param sortinghat_client: a SortingHat client
117
153
  :param backend_section: the backend section where the enrich phase is executed
118
154
  :param repos_to_check: A list of repo URLs to check, or None to check all repos
119
155
  """
120
156
 
121
157
  TaskProjects(config).execute()
122
- task = TaskEnrich(config, backend_section=backend_section, allowed_repos=repos_to_check)
158
+ task = TaskEnrich(config, sortinghat_client, backend_section=backend_section, allowed_repos=repos_to_check)
123
159
  try:
124
160
  task.execute()
125
161
  logging.info("Loading enriched data finished!")
@@ -1,2 +0,0 @@
1
- # File auto-generated by semverup on 2024-08-30 16:33:44.883554
2
- __version__ = "1.1.0"
File without changes
File without changes
File without changes
File without changes