Skip to content

feat(ci sync): post a run summary on the pull request - #10581

Draft
luvkapur wants to merge 1 commit into
masterfrom
feat/ci-sync-run-summary-comment
Draft

feat(ci sync): post a run summary on the pull request#10581
luvkapur wants to merge 1 commit into
masterfrom
feat/ci-sync-run-summary-comment

Conversation

@luvkapur

@luvkapur luvkapur commented Aug 7, 2026

Copy link
Copy Markdown
Member

Problem

A sync run can change what a lane component records — a snapped version, a dependency range, a drift fix — with no file in the branch's own commit ever changing. The pull request shows only the git diff. A reviewer looking at the PR has no way to see what the run actually did to the scope.

Fix

After a successful export, upsert one maintained comment on the branch's pull request: the components the run snapped (name and new version), and the synced pair's anchors (branch name and tip, lane id and head). "Upsert" — one comment, updated in place on every run, marked by a hidden marker, never a growing pile of one-off posts.

This needs a git host capability bit ci sync did not have: reading a PR's existing comments (paginated — GitHub returns 30 per page by default) and updating one by its marker instead of only ever posting new ones. GitHostProvider.upsertComment is optional: a provider that doesn't implement it is skipped, not faked with a plain comment call that would leave a new copy on every push.

No configured git host, no open PR yet, or a comment API failure are all normal states, not failures. The first two skip silently; the third only warns. None of them can undo an export or a git push that already succeeded.

Design notes — open for discussion

This PR is deliberately narrow: components snapped, plus the synced pair's anchors. Left open:

  • What else belongs in the summary? New (never-exported) components, environment changes, and config synced down from main all change the scope without a source diff, same as a snapped version does.
  • Comment vs. check-run. A PR comment is simple and needs no extra permissions, but a GitHub check-run would show the summary inline in the PR's checks tab instead of as a bot comment.
  • Opt-out. Some teams may not want a standing bot comment on every PR. Should sync.runSummary (or similar) turn it off?
  • merge-diverged. This PR wires the comment into export-branch only. The diverged-branch path runs the same snap-and-export and arguably deserves the same summary — held back here to keep the diff reviewable.

Tests

  • github-client.spec.ts: upsertComment — posts when no marked comment exists, patches the marked one in place without a second post, honors createIfAbsent: false, and follows Link-header pagination to find a comment past page 1.
  • lane-sync-executor.spec.ts: changedLaneComponents and runSummaryCommentBody as pure functions; postRunSummaryComment against a fake git host — present, absent, missing the optional method, no open PR, and a throwing upsertComment.
  • e2e/harmony/ci-sync.e2e.ts, the lane <-> branch reconcile cycle (scenarios A–D, including the export-branch scenario this PR touches) — unaffected with no git host configured, matching this PR's silent-skip path.

A sync run can move a component's recorded version with no file in the
branch's own git diff ever changing (dependency ranges, drift). The
pull request shows only the diff, so reviewers never see what the run
did to the scope.

After a successful export, upsert one maintained comment on the
branch's PR: the components the run snapped (name + new version), and
the synced branch/lane anchors. Ports GitHubClient's comment plumbing
(paginated listIssueComments, marker-based upsertComment) and adds
GitHostProvider.upsertComment as an optional capability - a provider
that lacks it is skipped, never faked with a plain, ever-duplicating
comment. No configured git host, no open PR, or a comment API failure
all degrade silently or to a warning; none can fail the run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant