Skip to content

Refactor getDiff to store the diff into the action #1693

Closed

Description

@jescalada

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

Activity

  1. amnkarn commented on Aug 24, 2026

    @amnkarn
    Contributor

    I'd like to work on this issue. Can you assign it to me?

  2. jescalada commented on Aug 24, 2026

    @jescalada
    ContributorAuthor

    @amnkarn Sure! Keep in mind we don't want to break the DB/diff display for current users. You might need to do some extra digging to find out how the diff is being used and what's safe to refactor.

  3. added a commit that references this issue on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions