Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -228,25 +228,49 @@ def extract_info_from_url(url: str) -> Dict[str, Any]:
|
|
228 |
# Initialize GitHubBot globally
|
229 |
bot = GitHubBot()
|
230 |
|
231 |
-
# Define missing functions
|
232 |
def fetch_issues(token, repo_url):
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
|
237 |
def resolve_issue(token, repo_url, issue_number, resolution, forked_repo_url):
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
|
242 |
def extract_info(url):
|
243 |
-
|
244 |
-
|
|
|
|
|
|
|
245 |
|
246 |
def submit_issue(token, repo_url, issue_number, resolution, forked_repo_url):
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
|
251 |
# HTML and CSS integration
|
252 |
custom_html = """
|
|
|
228 |
# Initialize GitHubBot globally
|
229 |
bot = GitHubBot()
|
230 |
|
231 |
+
# Define missing functions with validation
|
232 |
def fetch_issues(token, repo_url):
|
233 |
+
try:
|
234 |
+
parts = repo_url.split('/')
|
235 |
+
if len(parts) < 2:
|
236 |
+
raise ValueError("Repository URL is not in the correct format. Expected format: 'owner/repo'.")
|
237 |
+
|
238 |
+
owner, repo = parts[-2], parts[-1]
|
239 |
+
issues = bot.fetch_issues(token, owner, repo)
|
240 |
+
return issues
|
241 |
+
except Exception as e:
|
242 |
+
return str(e)
|
243 |
|
244 |
def resolve_issue(token, repo_url, issue_number, resolution, forked_repo_url):
|
245 |
+
try:
|
246 |
+
parts = repo_url.split('/')
|
247 |
+
if len(parts) < 2:
|
248 |
+
raise ValueError("Repository URL is not in the correct format. Expected format: 'owner/repo'.")
|
249 |
+
|
250 |
+
owner, repo = parts[-2], parts[-1]
|
251 |
+
result = bot.resolve_issue(token, owner, repo, issue_number, resolution, forked_repo_url)
|
252 |
+
return result
|
253 |
+
except Exception as e:
|
254 |
+
return str(e)
|
255 |
|
256 |
def extract_info(url):
|
257 |
+
try:
|
258 |
+
info = extract_info_from_url(url)
|
259 |
+
return info
|
260 |
+
except Exception as e:
|
261 |
+
return str(e)
|
262 |
|
263 |
def submit_issue(token, repo_url, issue_number, resolution, forked_repo_url):
|
264 |
+
try:
|
265 |
+
parts = repo_url.split('/')
|
266 |
+
if len(parts) < 2:
|
267 |
+
raise ValueError("Repository URL is not in the correct format. Expected format: 'owner/repo'.")
|
268 |
+
|
269 |
+
owner, repo = parts[-2], parts[-1]
|
270 |
+
result = bot.resolve_issue(token, owner, repo, issue_number, resolution, forked_repo_url)
|
271 |
+
return result
|
272 |
+
except Exception as e:
|
273 |
+
return str(e)
|
274 |
|
275 |
# HTML and CSS integration
|
276 |
custom_html = """
|