logdetective 0.11.2__tar.gz → 1.0.0__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 (31) hide show
  1. {logdetective-0.11.2 → logdetective-1.0.0}/PKG-INFO +1 -1
  2. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/gitlab.py +35 -9
  3. {logdetective-0.11.2 → logdetective-1.0.0}/pyproject.toml +1 -1
  4. {logdetective-0.11.2 → logdetective-1.0.0}/LICENSE +0 -0
  5. {logdetective-0.11.2 → logdetective-1.0.0}/README.md +0 -0
  6. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/__init__.py +0 -0
  7. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/constants.py +0 -0
  8. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/drain3.ini +0 -0
  9. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/extractors.py +0 -0
  10. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/logdetective.py +0 -0
  11. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/models.py +0 -0
  12. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/prompts.yml +0 -0
  13. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/remote_log.py +0 -0
  14. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/__init__.py +0 -0
  15. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/compressors.py +0 -0
  16. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/config.py +0 -0
  17. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/database/__init__.py +0 -0
  18. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/database/base.py +0 -0
  19. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/database/models/__init__.py +0 -0
  20. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/database/models/merge_request_jobs.py +0 -0
  21. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/database/models/metrics.py +0 -0
  22. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/emoji.py +0 -0
  23. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/llm.py +0 -0
  24. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/metric.py +0 -0
  25. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/models.py +0 -0
  26. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/plot.py +0 -0
  27. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/server.py +0 -0
  28. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/templates/gitlab_full_comment.md.j2 +0 -0
  29. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/server/templates/gitlab_short_comment.md.j2 +0 -0
  30. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective/utils.py +0 -0
  31. {logdetective-0.11.2 → logdetective-1.0.0}/logdetective.1.asciidoc +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: logdetective
3
- Version: 0.11.2
3
+ Version: 1.0.0
4
4
  Summary: Log using LLM AI to search for build/test failures and provide ideas for fixing these.
5
5
  License: Apache-2.0
6
6
  Author: Jiri Podivin
@@ -93,7 +93,7 @@ async def process_gitlab_job_event(
93
93
  preprocessed_log.close()
94
94
 
95
95
  # check if this project is on the opt-in list for posting comments.
96
- if project.name not in SERVER_CONFIG.general.packages:
96
+ if not is_eligible_package(project.name):
97
97
  LOG.info("Not publishing comment for unrecognized package %s", project.name)
98
98
  return
99
99
 
@@ -111,6 +111,31 @@ async def process_gitlab_job_event(
111
111
  return staged_response
112
112
 
113
113
 
114
+ def is_eligible_package(project_name: str):
115
+ """Check whether the provided package name is eligible for posting
116
+ comments to the merge request"""
117
+
118
+ # First check the allow-list. If it's not allowed, we deny.
119
+ allowed = False
120
+ for pattern in SERVER_CONFIG.general.packages:
121
+ print(f"include {pattern}")
122
+ if re.search(pattern, project_name):
123
+ allowed = True
124
+ break
125
+ if not allowed:
126
+ # The project did not match any of the permitted regular expressions
127
+ return False
128
+
129
+ # Next, check the deny-list. If it was allowed before, but denied here, we deny.
130
+ for pattern in SERVER_CONFIG.general.excluded_packages:
131
+ print(f"Exclude {pattern}")
132
+ if re.search(pattern, project_name):
133
+ return False
134
+
135
+ # It was allowed and not denied, so return True to indicate it is eligible
136
+ return True
137
+
138
+
114
139
  class LogsTooLargeError(RuntimeError):
115
140
  """The log archive exceeds the configured maximum size"""
116
141
 
@@ -174,16 +199,17 @@ async def retrieve_and_preprocess_koji_logs(
174
199
  with artifacts_zip.open(zipinfo.filename) as task_failed_log:
175
200
  contents = task_failed_log.read().decode("utf-8")
176
201
  match = FAILURE_LOG_REGEX.search(contents)
177
- if not match:
178
- LOG.error(
179
- "task_failed.log does not indicate which log contains the failure."
180
- )
181
- raise SyntaxError(
202
+ if match:
203
+ failure_log_name = match.group(1)
204
+ failed_arches[architecture] = PurePath(path.parent, failure_log_name)
205
+ else:
206
+ LOG.info(
182
207
  "task_failed.log does not indicate which log contains the failure."
183
208
  )
184
- failure_log_name = match.group(1)
185
-
186
- failed_arches[architecture] = PurePath(path.parent, failure_log_name)
209
+ # The best thing we can do at this point is return the
210
+ # task_failed.log, since it will probably contain the most
211
+ # relevant information
212
+ failed_arches[architecture] = path
187
213
 
188
214
  if not failed_arches:
189
215
  # No failed task found in the sub-tasks.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "logdetective"
3
- version = "0.11.2"
3
+ version = "1.0.0"
4
4
  description = "Log using LLM AI to search for build/test failures and provide ideas for fixing these."
5
5
  authors = ["Jiri Podivin <jpodivin@gmail.com>"]
6
6
  license = "Apache-2.0"
File without changes
File without changes