Skip to content

feat(gastown+web): slingExistingPr + BeadPanel babysit badge (chunks 0+4)#3539

Closed
jrf0110 wants to merge 6 commits into
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/headfrom
convoy/babysit-existing-pr-feature/60d71828/gt/toast/bc85648a
Closed

feat(gastown+web): slingExistingPr + BeadPanel babysit badge (chunks 0+4)#3539
jrf0110 wants to merge 6 commits into
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/headfrom
convoy/babysit-existing-pr-feature/60d71828/gt/toast/bc85648a

Conversation

@jrf0110

@jrf0110 jrf0110 commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements chunks 0 and 4 of the "Babysit existing PR" feature:

Chunk 0 — Town DO slingExistingPr method + review-queue refactor:

  • Refactored submitToReviewQueue to extract createMergeRequestBeadCore private helper (public signature unchanged, no caller changes)
  • Added submitExternalPrToReviewQueue function that creates merge_request + review_metadata rows with gt:babysit label, no tracks edge, and babysit_started activity event
  • Added Town.do.ts::slingExistingPr method with repo validation, open-state check, PR metadata fetch, and title/body defaults
  • Extended checkPRStatus return shape with head_branch, base_branch, head_sha, title (existing callers unchanged)
  • Added parsePrUrlForRepoMatch utility for repo-match validation

Chunk 4 — BeadPanel babysit badge + metadata surfacing:

  • "Babysat external PR" badge in BeadPanel header when gt:babysit label present
  • Head SHA (abbreviated) and force-push status in metadata panel
  • Extracted eventDescription to separate module for testability
  • Added event formatters for babysit event types: babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, pr_status_changed
  • Added babysit_started event type to bead-events table

Verification

  • pnpm --filter cloudflare-gastown test — all 19 new unit tests pass
  • babysit-ui.test.ts — 9 event description tests pass (imports from extracted event-description.ts, no runtime component import)
  • Manual: verified BeadPanel renders babysit badge and metadata for gt:babysit labeled beads

Visual Changes

BeadPanel now shows "Babysat external PR" badge, head SHA, and force-push status for babysat beads. Event timeline renders babysit-specific event types with appropriate icons and descriptions.

Reviewer Notes

  • The createMergeRequestBeadCore refactor is intentionally minimal — single private helper, public API unchanged
  • checkPRStatus extension is backward-compatible: new fields are optional
  • Chunk 4 was included because it's tightly coupled to the chunk 0 metadata/label schema and could run in parallel with chunks 2-3

John Fawcett added 5 commits May 27, 2026 17:13
…ePushAllowed tests

- Extract eventDescription from ActivityFeed.tsx to pure event-description.ts
  to avoid motion/react transitive import in Jest test
- Re-export from ActivityFeed.tsx for backwards compatibility
- Update babysit-ui.test.ts to import from event-description.ts
- Replace trivial forcePushAllowed inline tests with tests exercising
  submitExternalPrToReviewQueue through MiniSql mock
- Enhance MiniSql mock to capture INSERT statements and params
Comment thread apps/web/src/components/gastown/ActivityFeed.tsx Outdated
Comment thread services/gastown/src/util/platform-pr.util.ts Outdated
Comment thread services/gastown/src/dos/Town.do.ts Outdated
Comment thread apps/web/src/components/gastown/event-description.ts Outdated
Comment thread services/gastown/src/dos/town/review-queue.ts
@kilo-code-bot

kilo-code-bot Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

All 5 issues from the previous review have been addressed in commit d1d866b34; no new issues were found in the incremental diff.

Previously Reported Issues — All Resolved

File Issue Status
services/gastown/src/util/platform-pr.util.ts lastSlash > 0 silently dropped root-level GitLab projects ✅ Fixed (>= 0 + fallback return)
apps/web/src/components/gastown/ActivityFeed.tsx Redundant export { eventDescription } barrel re-export ✅ Removed
services/gastown/src/dos/Town.do.ts Planning artifact "wired in chunk 1" in user-facing warning string ✅ Removed
apps/web/src/components/gastown/event-description.ts as string | undefined casts on metadata fields bypassed runtime type safety ✅ Replaced with typeof guards
services/gastown/src/dos/town/review-queue.ts No deduplication guard in submitExternalPrToReviewQueue ✅ Added dedup query + warning return
Files Reviewed (6 files, incremental)
  • apps/web/src/components/gastown/ActivityFeed.tsx — previously flagged issue resolved
  • apps/web/src/components/gastown/event-description.ts — previously flagged issue resolved
  • services/gastown/src/dos/Town.do.ts — previously flagged issue resolved
  • services/gastown/src/dos/town/review-queue.ts — previously flagged issue resolved
  • services/gastown/src/util/platform-pr.util.ts — previously flagged issue resolved
  • services/gastown/test/unit/sling-existing-pr.test.ts — new dedup test and root-level GitLab test added

Reviewed by claude-4.6-sonnet-20260217 · 1,006,657 tokens

Review guidance: REVIEW.md from base branch convoy/babysit-existing-pr-feature-re-staged/254a4b7e/head

@jrf0110 jrf0110 closed this May 28, 2026
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