[Resolver]: Rename success_explanation to result_explanation for better clarity (#5724)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
This commit is contained in:
Rohit Malhotra
2024-12-20 20:31:05 -05:00
committed by GitHub
parent 5ea096e95b
commit 252c70984c
7 changed files with 25 additions and 25 deletions

View File

@@ -321,7 +321,7 @@ jobs:
let prNumber = '';
let branchName = '';
let successExplanation = '';
let resultExplanation = '';
try {
if (success) {
@@ -336,16 +336,16 @@ jobs:
try {
if (!success){
// Read success_explanation from JSON file for failed resolution
// Read result_explanation from JSON file for failed resolution
const outputFilePath = path.resolve('/tmp/output/output.jsonl');
if (fs.existsSync(outputFilePath)) {
const outputContent = fs.readFileSync(outputFilePath, 'utf8');
const jsonLines = outputContent.split('\n').filter(line => line.trim() !== '');
if (jsonLines.length > 0) {
// First entry in JSON lines has the key 'success_explanation'
// First entry in JSON lines has the key 'result_explanation'
const firstEntry = JSON.parse(jsonLines[0]);
successExplanation = firstEntry.success_explanation || '';
resultExplanation = firstEntry.result_explanation || '';
}
}
} catch (error){
@@ -364,8 +364,8 @@ jobs:
} else if (!success && branchName) {
let commentBody = `An attempt was made to automatically fix this issue, but it was unsuccessful. A branch named '${branchName}' has been created with the attempted changes. You can view the branch [here](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/${branchName}). Manual intervention may be required.`;
if (successExplanation) {
commentBody += `\n\nAdditional details about the failure:\n${successExplanation}`;
if (resultExplanation) {
commentBody += `\n\nAdditional details about the failure:\n${resultExplanation}`;
}
github.rest.issues.createComment({