Is your feature request related to a problem? Please describe.
Right now, getDiff stores the diff as content in a step via step.setContent, making the diff harder to fetch from plugins (as of the plugin revamp #1683) and subsequent actions like scanDiff:
...
step.log(`Executing "git diff ${commitFrom} ${action.commitTo}" in ${path}`);
const revisionRange = `${commitFrom}..${action.commitTo}`;
const diff = await git.diff([revisionRange]);
step.log(diff);
step.setContent(diff);
} catch (error: unknown) {
const msg = getErrorMessage(error);
step.setError(msg);
} finally {
action.addStep(step);
}
return action;
Describe the solution you'd like
Refactor getDiff so that adding the diff as content isn't necessary. We might need to look into why it was done this way in the first place. If we need to keep it as step content, we can just store the diff regardless via action.diff = diff, and then refactor any usages to use that instead.
Additional context
Related plugin revamp: #1683
Is your feature request related to a problem? Please describe.
Right now,
getDiffstores the diff as content in a step viastep.setContent, making the diff harder to fetch from plugins (as of the plugin revamp #1683) and subsequent actions likescanDiff:... step.log(`Executing "git diff ${commitFrom} ${action.commitTo}" in ${path}`); const revisionRange = `${commitFrom}..${action.commitTo}`; const diff = await git.diff([revisionRange]); step.log(diff); step.setContent(diff); } catch (error: unknown) { const msg = getErrorMessage(error); step.setError(msg); } finally { action.addStep(step); } return action;Describe the solution you'd like
Refactor
getDiffso that adding the diff as content isn't necessary. We might need to look into why it was done this way in the first place. If we need to keep it as step content, we can just store the diff regardless viaaction.diff = diff, and then refactor any usages to use that instead.Additional context
Related plugin revamp: #1683