feat(ci sync): post a run summary on the pull request - #10581
Draft
luvkapur wants to merge 1 commit into
Draft
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 syncdid 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.upsertCommentis optional: a provider that doesn't implement it is skipped, not faked with a plaincommentcall 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:
sync.runSummary(or similar) turn it off?merge-diverged. This PR wires the comment intoexport-branchonly. 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, honorscreateIfAbsent: false, and followsLink-header pagination to find a comment past page 1.lane-sync-executor.spec.ts:changedLaneComponentsandrunSummaryCommentBodyas pure functions;postRunSummaryCommentagainst a fake git host — present, absent, missing the optional method, no open PR, and a throwingupsertComment.e2e/harmony/ci-sync.e2e.ts, the lane<->branch reconcile cycle (scenarios A–D, including theexport-branchscenario this PR touches) — unaffected with no git host configured, matching this PR's silent-skip path.