Skip to content

Review sweeps read reviewer configs by key, so every repository is reached - #513

Merged
nambok merged 1 commit into
mainfrom
sweep-config-cursor
Nov 7, 2026
Merged

nambok merged 1 commit into
mainfrom
sweep-config-cursor

Conversation

@nambok

@nambok nambok commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The stuck-review and review-reminder sweeps never reached any repository. They looked for reviewer configs with a filtered scan of the whole settings table, capped at 50 pages. That table also holds analytics, rollups and markers, so on a busy install every tick stopped before reaching the configs. On a busy install, every sweep reported repos: 0 / "no repos with reminders configured", while repositories had the reviewer and reminders on. So stuck reviews were never sent again, and reminders were never posted.

Changes

  • common::settings_index (same module as the settings scan fix; whichever lands second keeps one copy): an index partition INDEX#<name> that writers append to, with a rebuild from one full scan when it was never built or is older than a day.
  • common::review_config_index: the REVIEW_CONFIG index. A member is the config's own partition key, so a team is found however it is recorded elsewhere, including teams with no teams-table record.
  • Gateway update_config: after saving a config, adds the team to the index. A failed index write is logged and doesn't fail the save; the daily rebuild catches it.
  • New worker passes/review_configs.rs: reads the index, then queries each team's REVIEW_CONFIG#REPO# items by key. Every page is read; a high page guard only stops a read that never ends, and logs it. A team whose read fails is skipped for that tick without hiding the others; a team with no configs left is dropped from the index. One log line per sweep gives teams read, failed and dropped, and configs read.
  • review_sweep.rs and review_reminder.rs use the shared reader and keep their own checks (enabled and not killed; reminders on, a channel saved and opening, the cooldown). The old filtered scans and their page cap warnings are gone.

Verification

  • On a large settings table, a table-wide count finds the reviewer configs only after scanning every item; a key query on the team returns the same configs in one page.
  • New tests:
    • every page is read across 120 pages (more than the old cap);
    • a failed read returns nothing rather than a partial list;
    • the guard only stops a read that never ends;
    • a team with no teams-table record is swept;
    • one failed team never hides the others, and empty teams are dropped;
    • a config stands for its own team in the index, and other records don't.
  • cargo fmt, cargo clippy -p common -p worker -p gateway --all-targets -D warnings, cargo test -p worker and the common index tests pass.

…ached

The stuck-review and review-reminder sweeps found their configs with a
filtered scan of the whole settings table, capped at 50 pages. That table
also holds analytics and rollups (about 137k items, 174 MB), so every tick
stopped long before reaching the handful of configs: both sweeps reported
no repositories on every run, stuck reviews were never sent again and
reminders were never posted.

The teams that have a per-repository config are now kept in an index
partition (INDEX#REVIEW_CONFIG). Saving a config adds the team; readers
rebuild the index from one full scan when it was never built or is a day
old, so configs saved before the index existed are found. A member is the
config's own partition key, so a team is swept however it is recorded
elsewhere, including teams with no teams-table record. Both sweeps share
one reader that queries each indexed team's configs by key, reads every
page, drops teams with no configs left from the index, and logs how many
teams and configs it read.
@nambok
nambok force-pushed the sweep-config-cursor branch from 36878b8 to 3a6ab7e Compare November 7, 2026 18:32
@nambok
nambok merged commit 579732b into main Nov 7, 2026
10 checks passed
@nambok
nambok deleted the sweep-config-cursor branch November 7, 2026 18:38
coderhelm Bot pushed a commit that referenced this pull request Dec 3, 2026
Moves dashboardRef from 6593784 to 1002bc7, carrying CoderHelm/coderhelm #502, #514, #513, #527, #530, #531, #533, #529, #536, #535, #499 and #537.
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