Skip to content

feat(ingest): retry PR hydrates held by a budget pause (RIG-4826) - #1971

Merged
mattwilkinsonn merged 1 commit into
compass-obs/rig-4034-t5-ingestfrom
compass-obs/rig-4826-pr-retry-set
Oct 10, 2026
Merged

mattwilkinsonn merged 1 commit into
compass-obs/rig-4034-t5-ingestfrom
compass-obs/rig-4826-pr-retry-set

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 8, 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) #1917
  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)" (this PR)

Summary

The board webhook drain pauses when the forge budget runs out and abandons the rest of its batch. The sweep heals a dropped issue, because its updated_at moves. A CI-only change to a PR may not move updated_at, so the sweep never re-reads it and the board shows stale checks.

This change keeps the batch's un-hydrated PR keys in an in-memory set and re-drains them when the gate's reset hint passes (one minute when no hint is given). A fresh event for a held key is left to the timer, so a PR whose budget is still out never pauses a new batch of issue events. The set is capped at the queue size, and overflow counts as a drop. Issue keys stay with the sweep.

Verification

  • Unit tests: a pause holds PR keys and returns the hint; the retry hydrates them; a held key does not pause a fresh batch; Run waits the hint and then re-drains with no new event.
  • Mutation probes (no hold, no timer, no skip of held keys, a wrong hint) each turn a test red.
  • go test -race ./..., ingest and server pgtests, golangci-lint: all pass.

Risks

The set lives in memory and is lost on restart. A PR still in it waits for its next event.

Compatibility

No API, schema or config change.

Documentation

None: internal drain behaviour; comments updated in place.

Spec-impact: none. Refs RIG-4826

@linear-code

linear-code Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

RIG-4826

RIG-4034

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-obs-rig-4826-pr-retr.compass-eng-docs.pages.dev

Deployed from compass-obs/rig-4826-pr-retry-set at c498b9d.

@rigel-mintaka
rigel-mintaka force-pushed the compass-obs/rig-4826-pr-retry-set branch from 790b8eb to 4e6834a Compare October 9, 2026 17:29
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review October 9, 2026 19:07
@mattwilkinsonn
mattwilkinsonn added this pull request to stack #1947 October 10, 2026 00:56
@mattwilkinsonn

Copy link
Copy Markdown
Contributor

/trunk merge

@trunk-io

trunk-io Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

🚫 This stack was removed from the merge queue because a stacked pull request in this stack was merged. See more details here.

A budget pause now keeps the batch's un-hydrated PR keys in memory and re-drains them when the gate's reset hint passes, or with the next event. The sweep's updated_at gate cannot heal a CI-only change, so the drain must. Issue keys stay with the sweep.

Spec-impact: none. Refs RIG-4826, RIG-4034

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-obs/rig-4826-pr-retry-set branch from 4e6834a to c498b9d Compare October 10, 2026 03:33
@mattwilkinsonn
mattwilkinsonn merged commit 2442f58 into main Oct 10, 2026
29 of 40 checks passed
@mattwilkinsonn
mattwilkinsonn deleted the compass-obs/rig-4826-pr-retry-set branch October 10, 2026 04:27
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