github-haystack 1.2.0__tar.gz → 1.2.1__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 (47) hide show
  1. {github_haystack-1.2.0 → github_haystack-1.2.1}/CHANGELOG.md +18 -0
  2. {github_haystack-1.2.0 → github_haystack-1.2.1}/PKG-INFO +1 -1
  3. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/file_editor.py +3 -1
  4. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/issue_commenter.py +3 -1
  5. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/issue_viewer.py +3 -1
  6. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/pr_creator.py +3 -1
  7. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/repo_forker.py +3 -1
  8. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/repo_viewer.py +3 -1
  9. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_file_editor.py +11 -0
  10. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_commenter.py +11 -0
  11. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_viewer.py +34 -0
  12. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_pr_creator.py +11 -0
  13. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_repo_forker.py +11 -0
  14. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_repo_viewer.py +12 -0
  15. {github_haystack-1.2.0 → github_haystack-1.2.1}/.gitignore +0 -0
  16. {github_haystack-1.2.0 → github_haystack-1.2.1}/LICENSE.txt +0 -0
  17. {github_haystack-1.2.0 → github_haystack-1.2.1}/README.md +0 -0
  18. {github_haystack-1.2.0 → github_haystack-1.2.1}/pydoc/config.yml +0 -0
  19. {github_haystack-1.2.0 → github_haystack-1.2.1}/pyproject.toml +0 -0
  20. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/__init__.py +0 -0
  21. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/py.typed +0 -0
  22. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/__init__.py +0 -0
  23. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/context_prompt.py +0 -0
  24. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/file_editor_prompt.py +0 -0
  25. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/issue_commenter_prompt.py +0 -0
  26. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/issue_viewer_prompt.py +0 -0
  27. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/pr_creator_prompt.py +0 -0
  28. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/repo_forker_prompt.py +0 -0
  29. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/repo_viewer_prompt.py +0 -0
  30. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/system_prompt.py +0 -0
  31. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/py.typed +0 -0
  32. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/__init__.py +0 -0
  33. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/file_editor_tool.py +0 -0
  34. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/issue_commenter_tool.py +0 -0
  35. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/issue_viewer_tool.py +0 -0
  36. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/pr_creator_tool.py +0 -0
  37. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/repo_forker_tool.py +0 -0
  38. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/repo_viewer_tool.py +0 -0
  39. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/utils.py +0 -0
  40. {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/py.typed +0 -0
  41. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/__init__.py +0 -0
  42. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_file_editor_tool.py +0 -0
  43. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_commenter_tool.py +0 -0
  44. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_viewer_tool.py +0 -0
  45. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_pr_creator_tool.py +0 -0
  46. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_repo_forker_tool.py +0 -0
  47. {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_repo_viewer_tool.py +0 -0
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [integrations/github-v1.2.0] - 2025-10-13
4
+
5
+ ### 🚀 Features
6
+
7
+ - Add support for GitHubRepoForkerTool (#1968)
8
+
9
+ ### 🧪 Testing
10
+
11
+ - Fix GitHub test (#2119)
12
+
13
+ ### 🧹 Chores
14
+
15
+ - Standardize readmes - part 2 (#2205)
16
+
17
+ ### 🌀 Miscellaneous
18
+
19
+ - Chore: Fix linting github (#2255)
20
+
3
21
  ## [integrations/github-v1.1.0] - 2025-07-01
4
22
 
5
23
  ### 🐛 Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-haystack
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Haystack components for interacting with GitHub repositories
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations/github
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/github/README.md
@@ -115,7 +115,9 @@ class GitHubFileEditor:
115
115
  """
116
116
  headers = self.base_headers.copy()
117
117
  if self.github_token is not None:
118
- headers["Authorization"] = f"Bearer {self.github_token.resolve_value()}"
118
+ token_value = self.github_token.resolve_value()
119
+ if token_value:
120
+ headers["Authorization"] = f"Bearer {token_value}"
119
121
  return headers
120
122
 
121
123
  def _get_file_content(self, owner: str, repo: str, path: str, branch: str) -> tuple[str, str]:
@@ -67,7 +67,9 @@ class GitHubIssueCommenter:
67
67
  """
68
68
  headers = self.base_headers.copy()
69
69
  if self.github_token is not None:
70
- headers["Authorization"] = f"Bearer {self.github_token.resolve_value()}"
70
+ token_value = self.github_token.resolve_value()
71
+ if token_value:
72
+ headers["Authorization"] = f"Bearer {token_value}"
71
73
  return headers
72
74
 
73
75
  def _parse_github_url(self, url: str) -> tuple[str, str, int]:
@@ -66,7 +66,9 @@ class GitHubIssueViewer:
66
66
  """
67
67
  headers = self.base_headers.copy()
68
68
  if self.github_token:
69
- headers["Authorization"] = f"Bearer {self.github_token.resolve_value()}"
69
+ token_value = self.github_token.resolve_value()
70
+ if token_value:
71
+ headers["Authorization"] = f"Bearer {token_value}"
70
72
  return headers
71
73
 
72
74
  def _parse_github_url(self, url: str) -> tuple[str, str, int]:
@@ -65,7 +65,9 @@ class GitHubPRCreator:
65
65
  """
66
66
  headers = self.base_headers.copy()
67
67
  if self.github_token is not None:
68
- headers["Authorization"] = f"Bearer {self.github_token.resolve_value()}"
68
+ token_value = self.github_token.resolve_value()
69
+ if token_value:
70
+ headers["Authorization"] = f"Bearer {token_value}"
69
71
  return headers
70
72
 
71
73
  def _parse_issue_url(self, issue_url: str) -> tuple[str, str, str]:
@@ -85,7 +85,9 @@ class GitHubRepoForker:
85
85
  """
86
86
  headers = self.base_headers.copy()
87
87
  if self.github_token is not None:
88
- headers["Authorization"] = f"Bearer {self.github_token.resolve_value()}"
88
+ token_value = self.github_token.resolve_value()
89
+ if token_value:
90
+ headers["Authorization"] = f"Bearer {token_value}"
89
91
  return headers
90
92
 
91
93
  def _parse_github_url(self, url: str) -> tuple[str, str, str]:
@@ -109,7 +109,9 @@ class GitHubRepoViewer:
109
109
  """
110
110
  headers = self.base_headers.copy()
111
111
  if self.github_token is not None:
112
- headers["Authorization"] = f"Bearer {self.github_token.resolve_value()}"
112
+ token_value = self.github_token.resolve_value()
113
+ if token_value:
114
+ headers["Authorization"] = f"Bearer {token_value}"
113
115
  return headers
114
116
 
115
117
  def to_dict(self) -> Dict[str, Any]:
@@ -269,3 +269,14 @@ class TestGitHubFileEditor:
269
269
  repo="owner/repo",
270
270
  branch="main",
271
271
  )
272
+
273
+ def test_get_request_headers_with_empty_token(self, monkeypatch):
274
+ monkeypatch.setenv("GITHUB_TOKEN", "")
275
+
276
+ editor = GitHubFileEditor()
277
+
278
+ headers = editor._get_request_headers()
279
+
280
+ assert "Authorization" not in headers
281
+ assert headers["Accept"] == "application/vnd.github.v3+json"
282
+ assert headers["User-Agent"] == "Haystack/GitHubFileEditor"
@@ -114,3 +114,14 @@ class TestGitHubIssueCommenter:
114
114
 
115
115
  with pytest.raises(ValueError):
116
116
  commenter._parse_github_url("https://github.com/invalid/url")
117
+
118
+ def test_get_request_headers_with_empty_token(self, monkeypatch):
119
+ monkeypatch.setenv("GITHUB_TOKEN", "")
120
+
121
+ commenter = GitHubIssueCommenter()
122
+
123
+ headers = commenter._get_request_headers()
124
+
125
+ assert "Authorization" not in headers
126
+ assert headers["Accept"] == "application/vnd.github.v3+json"
127
+ assert headers["User-Agent"] == "Haystack/GitHubIssueCommenter"
@@ -150,3 +150,37 @@ class TestGitHubIssueViewer:
150
150
 
151
151
  with pytest.raises(ValueError):
152
152
  viewer._parse_github_url("https://github.com/invalid/url")
153
+
154
+ def test_get_request_headers_with_valid_token(self, monkeypatch):
155
+ monkeypatch.setenv("GITHUB_TOKEN", "test-token-value")
156
+
157
+ token = Secret.from_env_var("GITHUB_TOKEN")
158
+ viewer = GitHubIssueViewer(github_token=token)
159
+
160
+ headers = viewer._get_request_headers()
161
+
162
+ assert "Authorization" in headers
163
+ assert headers["Authorization"] == "Bearer test-token-value"
164
+ assert headers["Accept"] == "application/vnd.github.v3+json"
165
+ assert headers["User-Agent"] == "Haystack/GitHubIssueViewer"
166
+
167
+ def test_get_request_headers_without_token(self):
168
+ viewer = GitHubIssueViewer(github_token=None)
169
+
170
+ headers = viewer._get_request_headers()
171
+
172
+ assert "Authorization" not in headers
173
+ assert headers["Accept"] == "application/vnd.github.v3+json"
174
+ assert headers["User-Agent"] == "Haystack/GitHubIssueViewer"
175
+
176
+ def test_get_request_headers_with_empty_token(self, monkeypatch):
177
+ monkeypatch.setenv("GITHUB_TOKEN", "")
178
+
179
+ token = Secret.from_env_var("GITHUB_TOKEN")
180
+ viewer = GitHubIssueViewer(github_token=token)
181
+
182
+ headers = viewer._get_request_headers()
183
+
184
+ assert "Authorization" not in headers
185
+ assert headers["Accept"] == "application/vnd.github.v3+json"
186
+ assert headers["User-Agent"] == "Haystack/GitHubIssueViewer"
@@ -132,3 +132,14 @@ class TestGitHubPRCreator:
132
132
  branch="feature-branch",
133
133
  base="main",
134
134
  )
135
+
136
+ def test_get_request_headers_with_empty_token(self, monkeypatch):
137
+ monkeypatch.setenv("GITHUB_TOKEN", "")
138
+
139
+ pr_creator = GitHubPRCreator()
140
+
141
+ headers = pr_creator._get_request_headers()
142
+
143
+ assert "Authorization" not in headers
144
+ assert headers["Accept"] == "application/vnd.github.v3+json"
145
+ assert headers["User-Agent"] == "Haystack/GitHubPRCreator"
@@ -261,3 +261,14 @@ class TestGitHubRepoForker:
261
261
 
262
262
  with pytest.raises(ValueError):
263
263
  forker._parse_github_url("https://github.com/invalid/url")
264
+
265
+ def test_get_request_headers_with_empty_token(self, monkeypatch):
266
+ monkeypatch.setenv("GITHUB_TOKEN", "")
267
+
268
+ forker = GitHubRepoForker()
269
+
270
+ headers = forker._get_request_headers()
271
+
272
+ assert "Authorization" not in headers
273
+ assert headers["Accept"] == "application/vnd.github.v3+json"
274
+ assert headers["User-Agent"] == "Haystack/GitHubRepoForker"
@@ -174,3 +174,15 @@ class TestGitHubRepoViewer:
174
174
 
175
175
  with pytest.raises(ValueError):
176
176
  viewer._parse_repo("invalid_format")
177
+
178
+ def test_get_request_headers_with_empty_token(self, monkeypatch):
179
+ monkeypatch.setenv("GITHUB_TOKEN", "")
180
+
181
+ token = Secret.from_env_var("GITHUB_TOKEN")
182
+ viewer = GitHubRepoViewer(github_token=token)
183
+
184
+ headers = viewer._get_request_headers()
185
+
186
+ assert "Authorization" not in headers
187
+ assert headers["Accept"] == "application/vnd.github.v3+json"
188
+ assert headers["User-Agent"] == "Haystack/GitHubRepoViewer"