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.
- {github_haystack-1.2.0 → github_haystack-1.2.1}/CHANGELOG.md +18 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/PKG-INFO +1 -1
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/file_editor.py +3 -1
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/issue_commenter.py +3 -1
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/issue_viewer.py +3 -1
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/pr_creator.py +3 -1
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/repo_forker.py +3 -1
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/repo_viewer.py +3 -1
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_file_editor.py +11 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_commenter.py +11 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_viewer.py +34 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_pr_creator.py +11 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_repo_forker.py +11 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_repo_viewer.py +12 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/.gitignore +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/LICENSE.txt +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/README.md +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/pydoc/config.yml +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/pyproject.toml +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/github/__init__.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/components/connectors/py.typed +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/__init__.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/context_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/file_editor_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/issue_commenter_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/issue_viewer_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/pr_creator_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/repo_forker_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/repo_viewer_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/system_prompt.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/py.typed +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/__init__.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/file_editor_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/issue_commenter_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/issue_viewer_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/pr_creator_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/repo_forker_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/repo_viewer_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/utils.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/py.typed +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/__init__.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_file_editor_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_commenter_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_issue_viewer_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_pr_creator_tool.py +0 -0
- {github_haystack-1.2.0 → github_haystack-1.2.1}/tests/test_repo_forker_tool.py +0 -0
- {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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/prompts/github/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_haystack-1.2.0 → github_haystack-1.2.1}/src/haystack_integrations/tools/github/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|