fix: per-account write failures, degraded gauges on abort, groups by id #94

Sammanfogat
supernaut sammanfogade 6 incheckningar från fix/reconciler-hardening in i main 2026-10-13 10:26:52 +00:00
Ägare

What

Four reconciler hardening fixes, one commit each. Version 2.2.0 (new gauges, changed failure behaviour).

  • Refused user writes (#83): a refused quota-group add, quota-group removal or org-create write warns, counts and raises bitborg_reconciler_user_writes_degraded (plus bitborg_reconciler_user_write_failures), then the run continues. A 404 skips the account without counting. Status 0 still aborts. A refused add skips that account's removals, so it never ends up in no group. Orgs follow the same rule.
  • Aborted runs (#85): an abort rewrites only status and timestamp. Every other gauge keeps the last completed run's value, so an outage does not clear firing alerts.
  • Role-mapped groups (#80): groups are read by id from /roles/{role}/groups, then /groups/{id}/members and /groups/{id}/children recursively. Subgroups, renamed groups and duplicate names resolve. An unknown id aborts with no writes. Tier groups still resolve by exact name.
  • Keycloak permission surface (#82): a test records every path each HttpKeycloakClient method requests and checks it against an allowlist. The README lists the required grants and the forbidden per-user endpoints. A warning fires when listed users carry no e-mail.

Notes

  • The infra PR that pins 2.2.0 must add an alert on bitborg_reconciler_user_writes_degraded == 1 (for: 1h). It must also drop the last_run_status == 0 clause from IdentityProjectionDegraded, because an aborted run now keeps the previous gauges.
  • Staging dry-run for #82 (a known drift is proposed) is an operator step after deploy.

Closes #83
Closes #85
Closes #80
Closes #82

## What Four reconciler hardening fixes, one commit each. Version 2.2.0 (new gauges, changed failure behaviour). - Refused user writes (#83): a refused quota-group add, quota-group removal or org-create write warns, counts and raises `bitborg_reconciler_user_writes_degraded` (plus `bitborg_reconciler_user_write_failures`), then the run continues. A 404 skips the account without counting. Status 0 still aborts. A refused add skips that account's removals, so it never ends up in no group. Orgs follow the same rule. - Aborted runs (#85): an abort rewrites only status and timestamp. Every other gauge keeps the last completed run's value, so an outage does not clear firing alerts. - Role-mapped groups (#80): groups are read by id from `/roles/{role}/groups`, then `/groups/{id}/members` and `/groups/{id}/children` recursively. Subgroups, renamed groups and duplicate names resolve. An unknown id aborts with no writes. Tier groups still resolve by exact name. - Keycloak permission surface (#82): a test records every path each `HttpKeycloakClient` method requests and checks it against an allowlist. The README lists the required grants and the forbidden per-user endpoints. A warning fires when listed users carry no e-mail. ## Notes - The infra PR that pins 2.2.0 must add an alert on `bitborg_reconciler_user_writes_degraded == 1` (for: 1h). It must also drop the `last_run_status == 0` clause from IdentityProjectionDegraded, because an aborted run now keeps the previous gauges. - Staging dry-run for #82 (a known drift is proposed) is an operator step after deploy. Closes #83 Closes #85 Closes #80 Closes #82
supernaut lade till 6 incheckningar 2026-10-13 10:18:43 +00:00
A refused quota-group add or org-create write now warns, counts and
raises user_writes_degraded, then the run continues. A 404 skips the
account. Status 0 still aborts. Closes #83
An aborted run now rewrites only status and timestamp and carries the
other gauges forward from the last completed run. Closes #85
Read /groups/{id}/members and /groups/{id}/children for every group a
role is mapped onto. Subgroups, renamed groups and duplicate names now
resolve. An unknown id aborts the run with no writes. Closes #80
Record every path HttpKeycloakClient requests and check it against an
allowlist. List the required grants and the forbidden per-user endpoints
in the README. Warn when listed users carry no e-mail. Closes #82
Quota merges most-permissively, so a refused removal leaves a downgraded
account on its old quota. Route removals through the same settle step as
adds. A 404 is fine, status 0 still aborts.
chore: bump to 2.2.0
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m8s
54e37eb6b4
supernaut sammanfogade incheckning 24cf0453bd till main 2026-10-13 10:26:52 +00:00
supernaut tog bort grenen fix/reconciler-hardening 2026-10-13 10:26:53 +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!94
Ingen beskrivning angiven.