logdetective 2.0.1__tar.gz → 2.0.2__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. {logdetective-2.0.1 → logdetective-2.0.2}/PKG-INFO +12 -5
  2. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/models.py +0 -2
  3. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/server.py +10 -8
  4. {logdetective-2.0.1 → logdetective-2.0.2}/pyproject.toml +37 -18
  5. {logdetective-2.0.1 → logdetective-2.0.2}/LICENSE +0 -0
  6. {logdetective-2.0.1 → logdetective-2.0.2}/README.md +0 -0
  7. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/__init__.py +0 -0
  8. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/constants.py +0 -0
  9. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/drain3.ini +0 -0
  10. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/extractors.py +0 -0
  11. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/logdetective.py +0 -0
  12. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/models.py +0 -0
  13. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/prompts-summary-first.yml +0 -0
  14. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/prompts-summary-only.yml +0 -0
  15. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/prompts.yml +0 -0
  16. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/remote_log.py +0 -0
  17. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/__init__.py +0 -0
  18. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/compressors.py +0 -0
  19. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/config.py +0 -0
  20. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/database/__init__.py +0 -0
  21. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/database/base.py +0 -0
  22. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/database/models/__init__.py +0 -0
  23. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/database/models/exceptions.py +0 -0
  24. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/database/models/koji.py +0 -0
  25. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/database/models/merge_request_jobs.py +0 -0
  26. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/database/models/metrics.py +0 -0
  27. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/emoji.py +0 -0
  28. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/exceptions.py +0 -0
  29. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/gitlab.py +0 -0
  30. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/koji.py +0 -0
  31. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/llm.py +0 -0
  32. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/metric.py +0 -0
  33. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/plot.py +0 -0
  34. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/templates/gitlab_full_comment.md.j2 +0 -0
  35. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/templates/gitlab_short_comment.md.j2 +0 -0
  36. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/server/utils.py +0 -0
  37. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/skip_snippets.yml +0 -0
  38. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective/utils.py +0 -0
  39. {logdetective-2.0.1 → logdetective-2.0.2}/logdetective.1.asciidoc +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: logdetective
3
- Version: 2.0.1
3
+ Version: 2.0.2
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
@@ -20,23 +20,30 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
20
  Classifier: Topic :: Software Development :: Debuggers
21
21
  Provides-Extra: server
22
22
  Provides-Extra: server-testing
23
- Requires-Dist: aiohttp (>=3.7.4)
23
+ Provides-Extra: testing
24
+ Requires-Dist: aiohttp (>=3.7.4,<4.0.0)
24
25
  Requires-Dist: aiolimiter (>=1.0.0,<2.0.0) ; extra == "server"
26
+ Requires-Dist: aioresponses (>=0.7.8,<0.8.0) ; extra == "testing"
25
27
  Requires-Dist: alembic (>=1.13.3,<2.0.0) ; extra == "server" or extra == "server-testing"
26
28
  Requires-Dist: backoff (==2.2.1) ; extra == "server" or extra == "server-testing"
27
29
  Requires-Dist: drain3 (>=0.9.11,<0.10.0)
28
- Requires-Dist: fastapi (>=0.111.1) ; extra == "server" or extra == "server-testing"
29
- Requires-Dist: huggingface-hub (>0.23.2)
30
+ Requires-Dist: fastapi (>=0.111.1,<1.0.0) ; extra == "server" or extra == "server-testing"
31
+ Requires-Dist: flexmock (>=0.12.2,<0.13.0) ; extra == "testing"
32
+ Requires-Dist: huggingface-hub (>0.23.2,<0.35.0)
30
33
  Requires-Dist: koji (>=1.35.0,<2.0.0) ; extra == "server" or extra == "server-testing"
31
- Requires-Dist: llama-cpp-python (>0.2.56,!=0.2.86)
34
+ Requires-Dist: llama-cpp-python (>0.2.56,!=0.2.86,<1.0.0)
32
35
  Requires-Dist: matplotlib (>=3.8.4,<4.0.0) ; extra == "server" or extra == "server-testing"
33
36
  Requires-Dist: numpy (>=1.26.0)
34
37
  Requires-Dist: openai (>=1.82.1,<2.0.0) ; extra == "server" or extra == "server-testing"
35
38
  Requires-Dist: psycopg2 (>=2.9.9,<3.0.0) ; extra == "server"
36
39
  Requires-Dist: psycopg2-binary (>=2.9.9,<3.0.0) ; extra == "server-testing"
37
40
  Requires-Dist: pydantic (>=2.8.2,<3.0.0)
41
+ Requires-Dist: pytest (>=8.4.1,<9.0.0) ; extra == "testing"
42
+ Requires-Dist: pytest-asyncio (>=1.1.0,<2.0.0) ; extra == "testing"
43
+ Requires-Dist: pytest-mock (>=3.14.1,<4.0.0) ; extra == "server-testing"
38
44
  Requires-Dist: python-gitlab (>=4.4.0)
39
45
  Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
46
+ Requires-Dist: responses (>=0.25.7,<0.26.0) ; extra == "server-testing"
40
47
  Requires-Dist: sentry-sdk[fastapi] (>=2.17.0,<3.0.0) ; extra == "server" or extra == "server-testing"
41
48
  Requires-Dist: sqlalchemy (>=2.0.36,<3.0.0) ; extra == "server" or extra == "server-testing"
42
49
  Project-URL: homepage, https://github.com/fedora-copr/logdetective
@@ -244,7 +244,6 @@ class InferenceConfig(BaseModel): # pylint: disable=too-many-instance-attribute
244
244
  class ExtractorConfig(BaseModel):
245
245
  """Model for extractor configuration of logdetective server."""
246
246
 
247
- context: bool = True
248
247
  max_clusters: int = 8
249
248
  verbose: bool = False
250
249
  max_snippet_len: int = 2000
@@ -254,7 +253,6 @@ class ExtractorConfig(BaseModel):
254
253
  if data is None:
255
254
  return
256
255
 
257
- self.context = data.get("context", True)
258
256
  self.max_clusters = data.get("max_clusters", 8)
259
257
  self.verbose = data.get("verbose", False)
260
258
  self.max_snippet_len = data.get("max_snippet_len", 2000)
@@ -117,23 +117,25 @@ def requires_token_when_set(authentication: Annotated[str | None, Header()] = No
117
117
  LOG.info("LOGDETECTIVE_TOKEN env var not set, authentication disabled")
118
118
  # no token required, means local dev environment
119
119
  return
120
- token = None
121
120
  if authentication:
122
121
  try:
123
122
  token = authentication.split(" ", 1)[1]
124
- except (ValueError, IndexError):
123
+ except (ValueError, IndexError) as ex:
125
124
  LOG.warning(
126
- "Authentication header has invalid structure (%s), it should be 'Bearer TOKEN'",
125
+ "Authentication header has invalid structure '%s', it should be 'Bearer TOKEN'",
127
126
  authentication,
128
127
  )
129
128
  # eat the exception and raise 401 below
130
- token = None
129
+ raise HTTPException(
130
+ status_code=401,
131
+ detail=f"Invalid authentication, HEADER '{authentication}' not valid.",
132
+ ) from ex
131
133
  if token == API_TOKEN:
132
134
  return
133
- LOG.info(
134
- "LOGDETECTIVE_TOKEN env var is set (%s), clien token = %s", API_TOKEN, token
135
- )
136
- raise HTTPException(status_code=401, detail=f"Token {token} not valid.")
135
+ LOG.info("Provided token '%s' does not match expected value.", token)
136
+ raise HTTPException(status_code=401, detail=f"Token '{token}' not valid.")
137
+ LOG.error("No authentication header provided but LOGDETECTIVE_TOKEN env var is set")
138
+ raise HTTPException(status_code=401, detail="No token provided.")
137
139
 
138
140
 
139
141
  app = FastAPI(dependencies=[Depends(requires_token_when_set)], lifespan=lifespan)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "logdetective"
3
- version = "2.0.1"
3
+ version = "2.0.2"
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"
@@ -32,32 +32,51 @@ issues = "https://github.com/fedora-copr/logdetective/issues"
32
32
 
33
33
  [tool.poetry.dependencies]
34
34
  python = "^3.11"
35
- llama-cpp-python = ">0.2.56,!=0.2.86"
36
- drain3 = "^0.9.11"
37
- huggingface-hub = ">0.23.2"
35
+ llama-cpp-python = ">0.2.56,!=0.2.86,<1.0.0"
36
+ drain3 = ">=0.9.11,<0.10.0"
37
+ huggingface-hub = ">0.23.2,<0.35.0"
38
38
  # rawhide has numpy 2, F40 and F41 are still on 1.26
39
39
  # we need to support both versions
40
40
  numpy = ">=1.26.0"
41
41
  python-gitlab = ">=4.4.0"
42
- pydantic = "^2.8.2"
43
- pyyaml = "^6.0.1"
44
- aiohttp = ">=3.7.4" # latest version in el8
45
- aiolimiter = "^1.0.0"
42
+ pydantic = ">=2.8.2,<3.0.0"
43
+ pyyaml = ">=6.0.1,<7.0.0"
44
+ aiohttp = ">=3.7.4,<4.0.0" # latest version in el8
45
+ aiolimiter = ">=1.0.0,<2.0.0"
46
46
 
47
- fastapi = {version = ">=0.111.1", optional = true }
48
- sqlalchemy = {version = "^2.0.36", optional = true }
49
- psycopg2-binary = {version = "^2.9.9", optional = true }
50
- psycopg2 = {version = "^2.9.9", optional = true }
51
- alembic = {version = "^1.13.3", optional = true }
52
- matplotlib = {version = "^3.8.4", optional = true }
47
+ fastapi = {version = ">=0.111.1,<1.0.0", optional = true }
48
+ sqlalchemy = {version = ">=2.0.36,<3.0.0", optional = true }
49
+ psycopg2-binary = {version = ">=2.9.9,<3.0.0", optional = true }
50
+ psycopg2 = {version = ">=2.9.9,<3.0.0", optional = true }
51
+ alembic = {version = ">=1.13.3,<2.0.0", optional = true }
52
+ matplotlib = {version = ">=3.8.4,<4.0.0", optional = true }
53
53
  backoff = {version = "2.2.1", optional = true }
54
- sentry-sdk = {version = "^2.17.0", optional = true, extras = ["fastapi"]}
55
- openai = {version = "^1.82.1", optional = true}
56
- koji = {version = "^1.35.0", optional = true}
54
+ sentry-sdk = {version = ">=2.17.0,<3.0.0", optional = true, extras = ["fastapi"]}
55
+ openai = {version = ">=1.82.1,<2.0.0", optional = true}
56
+ koji = {version = ">=1.35.0,<2.0.0", optional = true}
57
+ responses = {version = ">=0.25.7,<0.26.0", optional = true}
58
+ aioresponses = {version = ">=0.7.8,<0.8.0", optional = true}
59
+ pytest-asyncio = {version = ">=1.1.0,<2.0.0", optional = true}
60
+ pytest-mock = {version = ">=3.14.1,<4.0.0", optional = true}
61
+ flexmock = {version = ">=0.12.2,<0.13.0", optional = true}
62
+ pytest = {version = ">=8.4.1,<9.0.0", optional = true}
57
63
 
58
64
  [tool.poetry.extras]
59
65
  server = ["fastapi", "sqlalchemy", "psycopg2", "alembic", "matplotlib", "backoff", "aiolimiter", "sentry-sdk", "openai", "koji"]
60
- server-testing = ["fastapi", "sqlalchemy", "psycopg2-binary", "alembic", "matplotlib", "backoff", "pytest-asyncio", "sentry-sdk", "openai", "koji"]
66
+ server-testing = [
67
+ "fastapi",
68
+ "sqlalchemy",
69
+ "psycopg2-binary",
70
+ "alembic",
71
+ "matplotlib",
72
+ "backoff",
73
+ "sentry-sdk",
74
+ "openai",
75
+ "koji",
76
+ "pytest-mock",
77
+ "responses",
78
+ ]
79
+ testing = ["pytest", "pytest-asyncio", "aioresponses", "flexmock"]
61
80
 
62
81
  [build-system]
63
82
  requires = ["poetry-core"]
File without changes
File without changes