Skip to content

(janitor/comments): remove noise comments from platform integrations - #6884

Merged
pandemicsyn merged 1 commit into
mainfrom
kilo/turbo-edge-6x7
Sep 29, 2026
Merged

pandemicsyn merged 1 commit into
mainfrom
kilo/turbo-edge-6x7

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Package or topic area cleaned

apps/web/src/lib/integrations/platforms/ — the third-party platform adapters and webhook handlers (GitHub, GitLab, Bitbucket, Slack). This area had the highest concentration of pre-hygiene comment styles in the repo: function-name-restating JSDoc, section banners, numbered step narration, and @param boilerplate repeated verbatim across ~40 call sites.

Files touched (16)

  • github/adapter.ts, github/app-selector.ts, github/webhook-handler.ts, github/webhook-helpers.ts, github/webhook-schemas.ts
  • github/webhook-handlers/{index,installation-repositories-handler,issue-handler,pull-request-handler}.ts
  • github/webhook-handlers/{pull-request-handler.test,upsert-cli-session-pull-requests.test}.ts
  • gitlab/adapter.ts, gitlab/webhook-sync.ts, gitlab/webhook-schemas.ts
  • gitlab/webhook-handlers/{index,merge-request-handler}.ts

Comment lines removed

587 comment lines (1,637 → 1,050 in the area); 16 files, 645 deleted diff lines, 38 retained/trimmed comment lines. Diff contains only comment and blank-line changes.

Categories of noise removed

  • Function-name-restating JSDoc headers (Verifies GitHub webhook signature above verifyGitHubWebhookSignature, GitLab Project Webhook type above type GitLabWebhook)
  • Repeated @param/@returns boilerplate restating parameter names and defaults (@param appType - The type of GitHub App to use (defaults to 'standard') ×15, @param accessToken - OAuth access token ×20+)
  • Section banners (// ==== Webhook Verification ====, // Commit Inspection, // Project Access Token (PrAT) Management, …)
  • Numbered implementation-step narration (// 1. Verify signature, // 5. Route based on event type, // 7. Create review record)
  • Narration of the next line (// Filter out archived repositories, // Sort by updated_at descending and pick the latest, // Handle timeout, // Debug: Log integration fields)
  • Malformed duplicate file header (unterminated JSDoc at the top of pull-request-handler.ts)
  • Stale step-number references left dangling by the numbering removal

Important comments intentionally retained

  • External platform/API behavior: GitLab's plain-token webhook comparison (not HMAC), GitHub returning HTTP 200 with an error body for OAuth failures, 409 = "Git Repository is empty", PrAT token only present on creation, GitLab 14.0+ requirement for personal_access_tokens/self, 1-year PrAT expiry cap
  • Failure semantics: fail-open merge-commit checks, non-blocking check-run/reaction failures, orphaned-check-run cancellation, fail-closed fork-PR classification
  • Retry/ledger/security rationale in installation-handler.ts, webhook-handler.ts (delivery-envelope-only capture, suspend/unsuspend tenant resolution, dedup ordering)
  • All @see doc links, @throws contracts, eslint directives, and the integration-lock/serialisation invariants
  • Test comments carrying scenario semantics, CI-flakiness links, and invariants

Follow-up refactor candidates

None. Every deleted comment's information was either restated by the code or duplicated by a retained comment; nothing required restructuring to stay understandable.

Validation performed

  • oxlint on apps/web/src/lib/integrations/platforms: 0 warnings, 0 errors
  • oxfmt --list-different on the area: clean
  • tsgo --noEmit for apps/web: exit 0
  • Platform test suites cannot run in this sandbox: they fail identically on the unmodified tree (AggregateError from network/DNS-restricted test setup — e.g. the SSRF-guard DNS resolution in instance-url); verified via git stash that the failures pre-exist. Comment-only changes cannot alter test behavior.

Delete restating JSDoc, section banners, numbered step narration, and
duplicated @PARAM boilerplate from the GitHub/GitLab platform adapters
and webhook handlers. Comments carrying real constraints - external API
behavior, fail-open choices, ledger/authorization invariants, @see
references, lint directives - are kept.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 29, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 29, 2026 08:11
@kilo-code-bot

kilo-code-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

This PR contains only comment and blank-line deletions across the GitHub/GitLab platform integration area; I verified the diff removes no executable code, no JSDoc that tooling or the type-checker depends on, and no constraint-bearing rationale, so there is no behavioral or security impact.

Files Reviewed (16 files)
  • apps/web/src/lib/integrations/platforms/github/adapter.ts
  • apps/web/src/lib/integrations/platforms/github/app-selector.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handler.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/index.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/installation-repositories-handler.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/issue-handler.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/pull-request-handler.test.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/pull-request-handler.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-handlers/upsert-cli-session-pull-requests.test.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-helpers.ts
  • apps/web/src/lib/integrations/platforms/github/webhook-schemas.ts
  • apps/web/src/lib/integrations/platforms/gitlab/adapter.ts
  • apps/web/src/lib/integrations/platforms/gitlab/webhook-handlers/index.ts
  • apps/web/src/lib/integrations/platforms/gitlab/webhook-handlers/merge-request-handler.ts
  • apps/web/src/lib/integrations/platforms/gitlab/webhook-schemas.ts
  • apps/web/src/lib/integrations/platforms/gitlab/webhook-sync.ts
Verification performed
  • Confirmed every deleted line in the diff is a comment or blank line (only the --- a/... diff headers begin with a non-comment token).
  • Confirmed the malformed, unterminated duplicate file header at the top of pull-request-handler.ts is now a single valid JSDoc block for handlePullRequestCodeReview.
  • Confirmed no dangling step N references remain in the touched handlers after numbered-step narration was dropped.
  • Confirmed the intentionally retained comments (GitLab plain-token webhook comparison, /api/v4/personal_access_tokens/self GitLab 14.0+ requirement, 1-year PrAT cap, fail-open/skip semantics, @see links) are still present.

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant