feat(forge): ListUpdatedIssues updated-order conditional walk (RIG-2883 T2) - #709
Open
rigel-mintaka wants to merge 2 commits into
Open
feat(forge): ListUpdatedIssues updated-order conditional walk (RIG-2883 T2)#709rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
…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>
|
Compass engineering docs preview: https://compass-forge-rig-2883-t2-li.compass-eng-docs.pages.dev Deployed from |
…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
marked this pull request as ready for review
August 28, 2026 05:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reconcile/backfill read primitive the board webhook lane needs.
ListNewArtifactsis created-order and number-keyed, so it can't see updates to existing issues;ListUpdatedIssueswalks/repos/{repo}/issues?state=all&sort=updated&direction=descnewest-updated-first.NotModified), reusinggetJSONCondfor the conditional page-1 + Link-chain walk.updated_atis strictly< since, or norel="next"remains. A row withupdated_at == sinceis RE-included: GitHub'supdated_atis 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 zerosincewalks all pages (cold start)./issuesare dropped by thepull_requestmarker, mirroringListNewArtifacts. That marker check now reads a sharedjsonNullpackage constant (the third occurrence of the"null"literal, extracted to satisfygoconst); the two pre-existing guards ingithub.go/notify_reader.goadopt it too.Spec-impact: none. Refs RIG-2883
Co-authored-by: Matt Wilkinson matt@rigel.build