feat(adapter): migrate pr_comment to platform adapter pattern (#245)#271
Merged
Conversation
Lifts GitHub + GitLab branches from handlers/pr_comment.ts into
lib/adapters/pr-comment-{github,gitlab}.ts. Handler shrinks to ~50-line
dispatcher. Refines PrCommentArgs / PrCommentResponse from unknown to
concrete shapes. Wires prComment into both assemblers, adds to
MIGRATED_METHODS, removes pr_comment.ts from migration-allowlist.
Closes #245
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
Story 1.8 of the platform adapter retrofit: migrates
handlers/pr_comment.tsfrom inline platform branching + directexecSynccalls to the GitHub/GitLab adapter pattern. Handler shrinks from 182 lines to 51 lines (51% under the 80-line ceiling) andpr_comment.tsis removed from the migration allowlist (27 → 26 entries). Gate-greps now enforce the no-platform-branching invariant on this handler.Changes
lib/adapters/pr-comment-github.ts—gh pr comment <num> --body <body> [--repo <slug>], parses#issuecomment-<id>from stdoutlib/adapters/pr-comment-gitlab.ts—glab mr note <num> --message <body> [-R <slug>], parses#note_<id>lib/adapters/pr-comment-{github,gitlab}.test.ts— 6 subprocess-boundary tests each (12 total)handlers/pr_comment.ts— pure adapter dispatcher, noexecSync, nodetectPlatformbranching; spreadsresult.datainto envelope to preserve top-leveldata.number/data.comment_id/data.urlintegration-test assertionslib/adapters/types.ts— concretePrCommentArgs/PrCommentResponseinterfaces (replacedunknown)lib/adapters/{github,gitlab}.ts— wiredprCommentadapter, dropped stublib/adapters/types.test.ts— added'prComment'toMIGRATED_METHODS(now 6 entries)scripts/ci/migration-allowlist.txt— removedpr_comment.ts(27 → 26)tests/pr_comment.test.ts— single assertion update inexecSync invocation matches gh CLI shapetest (gitCallsfilter matches unquotedgit remote get-url, mirroring PR feat(adapter): migrate pr_status to platform adapter pattern (#244) #270 / pr_status precedent)Linked Issues
Closes #245
Test Plan
./scripts/ci/validate.sh— GREEN, 1573/0 across 96 filesbun test tests/pr_comment.test.ts lib/adapters/pr-comment-github.test.ts lib/adapters/pr-comment-gitlab.test.ts— 30/30 pass (124 expect() calls)