Skip to content

feat(board): show linked pull requests on board issues (RIG-4034) - #1917

Open
rigel-mintaka wants to merge 4 commits into
compass-obs/rig-4034-t2-forge-readsfrom
compass-obs/rig-4034-t3-projection
Open

rigel-mintaka wants to merge 4 commits into
compass-obs/rig-4034-t2-forge-readsfrom
compass-obs/rig-4034-t3-projection

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 6 PRs:

  1. main
  2. feat(store): store pull requests and their issue links (RIG-4034) #1900
  3. feat(forge): read PR timestamps, closing refs and PR list rows (RIG-4034) #1914
  4. "feat(board): show linked pull requests on board issues (RIG-4034)" (this PR)
  5. feat(forge): link a created pull request to its issue (RIG-4034) #1926
  6. feat(ingest): hydrate pull requests onto the board (RIG-4034) #1927
  7. feat(ingest): retry PR hydrates held by a budget pause (RIG-4826) #1971

Summary

This is T3 of the PR-to-issue linkage design (docs/designs/server/compass-issue-model-pr-linkage-amendment/design.md, §5). It stacks on #1914.

  • IssueProjection.PublishPullRequestUpdate(ctx, ingest.IngestedPullRequest):
    • stores the PR and its closing refs;
    • loads the ordered prs for every issue that gained or lost the PR;
    • republishes each one on the board, replacing only Prs on a clone of the cached issue.
  • Every wire build keeps prs:
    • PublishIssueUpdate and Rehydrate load from the store, in bulk for Rehydrate.
    • RecordAndPublish carries the cached prs across a state change.
    • SetIssueState returns the cached issue's prs.
    • SearchIssues loads them in one query.
  • When an issue arrives that is the explicit target of PRs that were falling back, the issues those PRs were attached to through closing refs are republished without them.
  • ingest.IngestedPullRequest is the seam type. T5 adds the sink that feeds it.
  • Also in this stack: a store fix commit. Board issues keep the ingested repo casing, so the fallback rule now compares lower(issues.repo) for GitHub. It comes with a regression pgtest.

Verification

  • 5 new board pgtests:
    • a state change keeps prs;
    • an issue that lost a ref is republished;
    • a PR that arrives before its issue attaches later;
    • a fallback moves when the explicit target arrives;
    • order survives Rehydrate.
  • go test ./..., plus pgtest for board, store, server and ingest, pass. golangci-lint reports no new findings.

Risks

PublishIssueUpdate now runs one extra query for prs and one fallback query per issue upsert.

Compatibility

Wire Issue.prs is now populated. The field already existed.

Documentation

None. The design record already describes the change.

Refs RIG-4034

@rigel-mintaka rigel-mintaka changed the title fix(store): match board issues case-insensitively in the fallback rule (RIG-4034) feat(board): show linked pull requests on board issues (RIG-4034) Oct 7, 2026
@linear-code

linear-code Bot commented Oct 7, 2026

Copy link
Copy Markdown

RIG-4034

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-obs-rig-4034-t3-proj.compass-eng-docs.pages.dev

Deployed from compass-obs/rig-4034-t3-projection at 2a9e11c.

rigel-mintaka and others added 3 commits October 7, 2026 02:07
…e (RIG-4034)

Board issues keep the ingested repo casing, while links store GitHub
repos lowercased, so the explicit-target check now lowercases issues.repo.

Spec-impact: none. Refs RIG-4034

Co-authored-by: Matt Wilkinson <matt@rigel.build>
IssueProjection gains PublishPullRequestUpdate, which stores a hydrated
PR and republishes every issue it gained or lost. PublishIssueUpdate,
Rehydrate, SearchIssues and SetIssueState load prs from the store;
RecordAndPublish keeps the cached prs. An issue that becomes an explicit
target republishes the closing-ref issues it takes PRs from.

Spec-impact: none. Refs RIG-4034

Co-authored-by: Matt Wilkinson <matt@rigel.build>
A projection-wide write lock now spans each store read and the cache write
it feeds, so a slower PR or issue publish cannot cache an older list or row.
A transition re-reads the issue under that lock and loads prs on a cache
miss. Stored PRs decode with unknown fields discarded, number-0 rows skip
the PR lookup, and the board join gets an expression index.

Spec-impact: none. Refs RIG-4034

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…4034)

Migrations are append-only per PR base, so the index the T3 review fix added to the link migration moves to a new numbered migration.

Spec-impact: none. Refs RIG-4034

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 7, 2026 11:09
@mattwilkinsonn
mattwilkinsonn added this pull request to stack #1947 October 8, 2026 03:17

This branch has not been deployed

No deployments
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.

2 participants