MCPcopy Create free account
hub / github.com/alibaba/open-code-review / appendCheckpoint

Function appendCheckpoint

scripts/github-actions/post-review-comments.js:249–260  ·  view source on GitHub ↗
(body, manifest)

Source from the content-addressed store, hash-verified

247 // carry (a body must carry at most one marker); with neither, the body is
248 // exactly what it is today.
249 const appendCheckpoint = (body, manifest) => {
250 const marker = buildAdvanceMarker(manifest);
251 if (marker) return `${body}\n\n${marker}`;
252 // The carry is gated on the same two conditions as the advance. Without
253 // checkpointing there is nothing to carry; without a sticky summary each run
254 // posts a FRESH comment, so re-emitting a marker read from a previous run's
255 // comment would stamp a checkpoint onto a body that never carried one — and
256 // the resolver, which reads the newest summary, would then trust a head this
257 // run did not review.
258 if (!checkpointEnabled || !stickySummary) return body;
259 return checkpointCarry ? `${body}\n\n${checkpointCarry}` : body;
260 };
261 // Second line of defence behind the carry: when the carry is empty for a
262 // reason unrelated to the marker's usefulness, keep whatever marker the body
263 // being replaced already had (preserveCheckpointMarker).

Callers 1

runPostReviewCommentsFunction · 0.85

Calls 1

buildAdvanceMarkerFunction · 0.85

Tested by

no test coverage detected