Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -180,45 +180,39 @@ class GitHubBot:
|
|
180 |
|
181 |
def _create_resolution_document(self, issue_number: int, severity: IssueSeverity,
|
182 |
resolution: str, ai_solution: str) -> str:
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
## Severity: {severity.name}
|
187 |
-
|
188 |
## Original Resolution
|
189 |
{resolution}
|
190 |
-
|
191 |
## AI-Generated Solution
|
192 |
{ai_solution}
|
193 |
-
|
194 |
## Implementation Details
|
195 |
- Implementation Date: {datetime.now(timezone.utc).isoformat()}
|
196 |
- Severity Level: {severity.name}
|
197 |
- Resolution Type: {'AI-ASSISTED' if ai_solution else 'MANUAL'}
|
198 |
-
|
199 |
## Testing Notes
|
200 |
- [ ] Code changes have been tested locally
|
201 |
- [ ] All tests pass
|
202 |
- [ ] No new issues introduced
|
203 |
-
|
204 |
## Review Checklist
|
205 |
- [ ] Code follows project style guidelines
|
206 |
- [ ] Documentation has been updated
|
207 |
- [ ] Changes are properly tested
|
208 |
- [ ] No security vulnerabilities introduced
|
209 |
-
|
210 |
## Additional Notes
|
211 |
Please review the changes carefully before merging.
|
212 |
"""
|
213 |
|
214 |
-
|
215 |
-
|
216 |
-
|
|
|
217 |
|
218 |
-
|
219 |
-
|
220 |
|
221 |
-
|
222 |
|
223 |
except Exception as e:
|
224 |
error_msg = f"Error resolving issue #{issue_number} in repository {owner}/{repo}: {str(e)}"
|
|
|
180 |
|
181 |
def _create_resolution_document(self, issue_number: int, severity: IssueSeverity,
|
182 |
resolution: str, ai_solution: str) -> str:
|
183 |
+
"""Create a comprehensive resolution document"""
|
184 |
+
return f"""# Resolution for Issue #{issue_number}
|
|
|
185 |
## Severity: {severity.name}
|
|
|
186 |
## Original Resolution
|
187 |
{resolution}
|
|
|
188 |
## AI-Generated Solution
|
189 |
{ai_solution}
|
|
|
190 |
## Implementation Details
|
191 |
- Implementation Date: {datetime.now(timezone.utc).isoformat()}
|
192 |
- Severity Level: {severity.name}
|
193 |
- Resolution Type: {'AI-ASSISTED' if ai_solution else 'MANUAL'}
|
|
|
194 |
## Testing Notes
|
195 |
- [ ] Code changes have been tested locally
|
196 |
- [ ] All tests pass
|
197 |
- [ ] No new issues introduced
|
|
|
198 |
## Review Checklist
|
199 |
- [ ] Code follows project style guidelines
|
200 |
- [ ] Documentation has been updated
|
201 |
- [ ] Changes are properly tested
|
202 |
- [ ] No security vulnerabilities introduced
|
|
|
203 |
## Additional Notes
|
204 |
Please review the changes carefully before merging.
|
205 |
"""
|
206 |
|
207 |
+
# The following lines should not be part of the _create_resolution_document method
|
208 |
+
script_file = f"{RESOLUTIONS_DIRECTORY}/resolve_issue_{issue_number}.sh"
|
209 |
+
with open(script_file, "w") as f:
|
210 |
+
f.write(bash_script)
|
211 |
|
212 |
+
# Make the script executable
|
213 |
+
os.chmod(script_file, 0o755)
|
214 |
|
215 |
+
return f"Bash script generated: {script_file}"
|
216 |
|
217 |
except Exception as e:
|
218 |
error_msg = f"Error resolving issue #{issue_number} in repository {owner}/{repo}: {str(e)}"
|