Skip to content

feat(forge): ListUpdatedIssues updated-order conditional walk (RIG-2883 T2) - #709

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-forge/rig-2883-t2-listupdated
Open

feat(forge): ListUpdatedIssues updated-order conditional walk (RIG-2883 T2)#709
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-forge/rig-2883-t2-listupdated

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

The reconcile/backfill read primitive the board webhook lane needs. ListNewArtifacts is created-order and number-keyed, so it can't see updates to existing issues; ListUpdatedIssues walks /repos/{repo}/issues?state=all&sort=updated&direction=desc newest-updated-first.

  • Page 1 is conditioned on the caller's ETag (a 304 short-circuits to NotModified), reusing getJSONCond for the conditional page-1 + Link-chain walk.
  • The walk stops when a page's oldest updated_at is strictly < since, or no rel="next" remains. A row with updated_at == since is RE-included: GitHub's updated_at is second-granularity, so a <= stop would permanently drop an issue updated in the same second as the stored watermark; the duplicates are free by coordinate idempotency. A zero since walks all pages (cold start).
  • PR rows GitHub interleaves into /issues are dropped by the pull_request marker, mirroring ListNewArtifacts. That marker check now reads a shared jsonNull package constant (the third occurrence of the "null" literal, extracted to satisfy goconst); the two pre-existing guards in github.go/notify_reader.go adopt it too.

Spec-impact: none. Refs RIG-2883
Co-authored-by: Matt Wilkinson matt@rigel.build

…83 T2)

The reconcile/backfill read primitive the board webhook lane needs. `ListNewArtifacts` is created-order and number-keyed, so it can't see updates to existing issues; `ListUpdatedIssues` walks `/repos/{repo}/issues?state=all&sort=updated&direction=desc` newest-updated-first.

- Page 1 is conditioned on the caller's ETag (a 304 short-circuits to `NotModified`), reusing `getJSONCond` for the conditional page-1 + Link-chain walk.
- The walk stops when a page's oldest `updated_at` is strictly `< since`, or no `rel="next"` remains. A row with `updated_at == since` is RE-included: GitHub's `updated_at` is second-granularity, so a `<=` stop would permanently drop an issue updated in the same second as the stored watermark; the duplicates are free by coordinate idempotency. A zero `since` walks all pages (cold start).
- PR rows GitHub interleaves into `/issues` are dropped by the `pull_request` marker, mirroring `ListNewArtifacts`. That marker check now reads a shared `jsonNull` package constant (the third occurrence of the `"null"` literal, extracted to satisfy `goconst`); the two pre-existing guards in `github.go`/`notify_reader.go` adopt it too.

Spec-impact: none. Refs RIG-2883
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

RIG-2883

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-forge-rig-2883-t2-li.compass-eng-docs.pages.dev

Deployed from compass-forge/rig-2883-t2-listupdated at 98f1322.

…der walk (RIG-2883 T2)

A row whose updated_at fails to parse yields a zero UpdatedAt, and
zeroTime.Before(since) is true for any non-zero watermark — so the walk
treated it as the strictly-below-since stop signal and truncated the
sweep at that row, persistently every sweep. Guard the stop on
!UpdatedAt.IsZero(), and skip a zero-time row without stopping so a
single unparseable row cannot drop the fresh rows behind it.

Refs RIG-2883
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review August 28, 2026 05:41
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