Skip to content

Feature/stacked prs - #825

Open
desireddymohithreddy0925 wants to merge 3 commits into
Coder-s-OG-s:mainfrom
desireddymohithreddy0925:feature/stacked-prs
Open

Feature/stacked prs#825
desireddymohithreddy0925 wants to merge 3 commits into
Coder-s-OG-s:mainfrom
desireddymohithreddy0925:feature/stacked-prs

Conversation

@desireddymohithreddy0925

Copy link
Copy Markdown

Closes #818

Description

This PR implements the core database schema additions required for the Stacked PRs / Dependent PR Chaining feature.

Changes Made

  • Added base_branch and head_branch columns to the pullRequests table in src/lib/db/schema.ts.

Next Steps

By tracking the base and head branches of all synchronized PRs, the backend webhook handlers can now automatically calculate parent-child relationships (e.g. if PR B has a base branch that matches PR A's head branch, it is a dependent PR).

Future PRs will use this data layer to render the Mermaid.js / React Flow dependency graph on the frontend PR view and implement the backend merge-block logic.

Screenshots / UI Thoughts

Schema changes only. The visual graph implementation will follow in a subsequent PR.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the codersogs-3057's projects Team on Vercel.

A member of the Team first needs to authorize it.

@jakharmonika364 jakharmonika364 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three spots, assuming the branch gets rebased onto clean main first (drop the carried-over mergeFreezeWindows commit):

1. Rebase (do this first, not a code edit)

git fetch origin main
git rebase origin/main feature/stacked-prs

This drops the duplicate feat: implement database schema merge freeze windows (#819) commit so the diff only shows the base_branch/head_branch change.


2. src/lib/db/schema.ts - pullRequests table, line ~446 (the (t) => ({...}) index block)

Add a repo-scoped index next to the existing ones:

(t) => ({
  uniqRepoNumber: uniqueIndex('pull_requests_repo_number_unique').on(t.repoFullName, t.number),
  repoStateIdx: index('pull_requests_repo_state_idx').on(
    t.repoFullName,
    t.state,
    t.githubUpdatedAt,
  ),
  authorIdx: index('pull_requests_author_idx').on(t.authorUserId, t.state),
  repoHeadBranchIdx: index('pull_requests_repo_head_branch_idx').on(
    t.repoFullName,
    t.headBranch,
  ),
}),

3. New file supabase/migrations/0044_pull_requests_branch_tracking.sql (next number after 0043_activity_log_read_at.sql - coordinate with #824 so they don't collide on the same number):

alter table pull_requests
add column base_branch text,
add column head_branch text;

create index pull_requests_repo_head_branch_idx on pull_requests(repo_full_name, head_branch);

That's it - pull_requests already has RLS/policies from prior migrations, so no new policy needed here, just the column + index.

@jakharmonika364 jakharmonika364 added the Needs author reply Author need to reply label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs author reply Author need to reply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] - Dependent PR Chaining (Stacked PR Visualization)

2 participants