GH-97: fix(github): SyncAdapter correctness — paginated idem comment scan, resolveRepo write-scope consistency (post-merge review of #95)#100
Merged
Conversation
…esolveRepo write-scope consistency (GH-97) Post-merge review of #95 found two correctness defects, both fixed in sdk/integrations/github/sync.go: - AddComment's idempotency scan now paginates exhaustively (per_page=100, no cap) instead of relying on Client.ListIssueComments' documented single default-sized page — a marker beyond the first page was previously invisible to a retry, causing a duplicate repost. - resolveRepo now errors on a malformed projectID instead of silently falling back to the bound repo, and IssueSnapshot.NativeID is repo-qualified ("owner/repo#N") whenever a listing resolves to a repo other than the bound one. GetIssue/UpdateFields/TransitionState/ AddComment decode that qualifier via parseNativeID, so a write-back after listing a non-bound projectID targets the correct repo instead of silently hitting the bound repo's same-numbered issue. Also: since is normalized to UTC before formatting (a non-UTC "+02:00" offset embeds a literal "+" that decodes as a space server-side), and issuesSyncPerPage documents that the exhaustive cursor loop has no page cap by design (host's responsibility), unlike the capped board-scale listings elsewhere in this package.
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.
Summary
Automated PR created by Pilot for task GH-97.
Closes #97
Changes
GitHub Issue GH-97: fix(github): SyncAdapter correctness — paginated idem comment scan, resolveRepo write-scope consistency (post-merge review of #95)
Context
PR #95 (GitHub SyncCapable, issue #91) merged with two correctness defects found in post-merge review (2026-07-13). Nothing consumes SyncCapable yet; fixes are non-breaking.
Implementation
All in
sdk/integrations/github/sync.go:Client.ListIssueComments, documented single-page (GitHub default 30) — a pilot-op marker beyond the first 30 comments is invisible → duplicate repost on retry. Paginate the scan (per_page=100+ page loop, or newest-first with an explicit cap + doc comment). Multi-page test required.since.UTC().Format(...)before embedding in the query string (non-UTC "+02:00" decodes as a space); doc-comment that the externalized Cursor loop deliberately has no maxPages cap (host's responsibility).Acceptance
Refs