feat: write only the differences each reconcile pass #96

Sammanfogat
supernaut sammanfogade 1 incheckning från feat/write-only-differences in i main 2026-10-18 17:53:20 +00:00
Ägare

Each run read nothing from Forgejo before writing. It re-sent quota membership and has_actions for every account and repo, so requests grew with users times repos.

Now the run reads the members of each quota group and each repo's has_actions first, and sends only the writes that differ.

  • Skip the quota-group add when the account is already a member.
  • Skip removal from the other quota groups when it is not a member.
  • Skip the has_actions toggle when the repo already matches.
  • Match names case-insensitively, as Forgejo does.
  • A failed member read aborts before any per-account write.
  • Fail-closed behaviour, the empty-tier refusal, exempt handling, env vars, metrics and dry-run output are unchanged.

Not covered: allow_create_organization is not exposed by the admin API, so it is still written once per account. The per-run quota rule and group setup is also unchanged (a constant number of calls).

Checked on prod, read-only: /admin/quota/groups/{g}/users answers for every group, and orgs appear in their group's member list.

Version 2.4.0 (minor: new admin read, changed request pattern).

Closes #84

Each run read nothing from Forgejo before writing. It re-sent quota membership and `has_actions` for every account and repo, so requests grew with users times repos. Now the run reads the members of each quota group and each repo's `has_actions` first, and sends only the writes that differ. - Skip the quota-group add when the account is already a member. - Skip removal from the other quota groups when it is not a member. - Skip the `has_actions` toggle when the repo already matches. - Match names case-insensitively, as Forgejo does. - A failed member read aborts before any per-account write. - Fail-closed behaviour, the empty-tier refusal, exempt handling, env vars, metrics and dry-run output are unchanged. Not covered: `allow_create_organization` is not exposed by the admin API, so it is still written once per account. The per-run quota rule and group setup is also unchanged (a constant number of calls). Checked on prod, read-only: `/admin/quota/groups/{g}/users` answers for every group, and orgs appear in their group's member list. Version 2.4.0 (minor: new admin read, changed request pattern). Closes #84
supernaut lade till 1 incheckning 2026-10-18 16:54:29 +00:00
feat: write only the differences each reconcile pass
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m8s
4bad1f22fb
Read the members of each quota group and each repo's has_actions before
writing. Skip the quota-group add, the removals from other groups and the
has_actions toggle when Forgejo already matches the plan. A failed member
read aborts the run before any per-account write.

allow_create_organization is not exposed by the admin API, so it is still
written once per account.

Closes #84
supernaut sammanfogade incheckning 8a0f134bc2 till main 2026-10-18 17:53:20 +00:00
supernaut tog bort grenen feat/write-only-differences 2026-10-18 17:53:21 +00:00
supernaut refererade denna ändringsförfrågan från en incheckning 2026-10-18 17:53:22 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-auth-reconciler!96
Ingen beskrivning angiven.