Skip to content

Changes to open PRs no longer update materials in v1.4.0-RC5Β #184

@sandro-h

Description

@sandro-h

We tried using plugin version v1.4.0-RC5 and noticed that while freshly opened PRs are built, updating a PR (i.e. pushing new commits) did not trigger a material update anymore.

Digging into it, I believe the reason is the upgrade of git-cmd to 2.0 in #179. With git-cmd 2.0, the semantics of getRevisionsSince changed (ashwanthkumar/git-cmd@418d353):

    @Override
    public List<Revision> getRevisionsSince(String revision, List<String> subPaths) {
-        return gitLog(logSubPathArgs(String.format("%s..", revision), subPaths));
+        return gitLog(logArgs(subPaths, String.format("%s..%s", revision, gitConfig.getRemoteBranch())));
    }

When a PR is updated, the plugin does the following in my understanding:

  1. Clones the repo
  2. Does a hard reset to the newest commit of the PR
  3. Runs getRevisionsSince to get the commits between last known commit and newest commit

Previously, this last step essentially ran git log LAST_KNOWN_SHA.. which returns the list of commits from LAST_KNOWN_SHA to HEAD (which is newest PR commit because of step 2 above). Now it does git log LAST_KNOWN_SHA..origin/defaultBranch which will not return any commits given that they are not on the default branch yet.

I know this repo is not very active anymore and we have no urgent need of a fix, given said version is experimental. Just wanted to report in case a full release of the plugin is done at some point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions