Skip to content
Permalink
Browse files

pr: always re-fetch PR for returned work items

Reviewed-by: rwestberg
  • Loading branch information
Erik Helin
Erik Helin committed Sep 23, 2020
1 parent 72b87eb commit 5135120921f445250208a75c90f430f6b13ad222
@@ -188,6 +188,9 @@ public String toString() {
throw new UncheckedIOException(e);
}
}
return List.of(new CommandWorkItem(bot, pr, errorHandler));

// Must re-fetch PR after executing CheckRun
var updatedPR = pr.repository().pullRequest(pr.id());
return List.of(new CommandWorkItem(bot, updatedPR, errorHandler));
}
}
@@ -216,7 +216,10 @@ private void processCommand(PullRequest pr, CensusInstance censusInstance, Path
if (nextCommand.isEmpty()) {
log.info("No new non-external PR commands found, stopping further processing");
// When all commands are processed, it's time to check labels
return List.of(new LabelerWorkItem(bot, pr, errorHandler));
// Must re-fetch PR after running the command, the command might have updated the PR
var updatedPR = pr.repository().pullRequest(pr.id());

return List.of(new LabelerWorkItem(bot, updatedPR, errorHandler));
}

var census = CensusInstance.create(bot.censusRepo(), bot.censusRef(), scratchPath.resolve("census"), pr,

1 comment on commit 5135120

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on 5135120 Sep 23, 2020

Please sign in to comment.
You can’t perform that action at this time.