feat: Actions for every user with a quota and orgs with a qualifying member #101

Sammanfogat
supernaut sammanfogade 4 incheckningar från feat/actions-for-quota-users in i main 2026-11-05 10:48:07 +00:00
Ägare

Actions now follows the hosting quota instead of the ent_runners_shared role alone.

Rules

  • Users: Actions is on when the quota group is not the participant group (paid tier_basic/tier_pro, or exempt first-party), or the user holds ent_runners_shared. Participants and users with no tier signal stay off.
  • Tenant orgs: Actions is on when at least one Forgejo org member (any team) is paid or exempt. Exempt orgs stay on.
  • If an org's member list cannot be read (non-200), its Actions are left as they are in both directions, a warning is logged and bitborg_reconciler_actions_enforcement_degraded is set. Quota writes still happen. Forgejo unreachable (status 0) aborts the run, as for the repo listing.
flowchart LR
  K[Keycloak tiers] --> P[classifyUser: quota group]
  P -->|not participant| S[paid or exempt set]
  P --> UA[user repos has_actions]
  S --> O{tenant org: any member in set?}
  M[GET /orgs/org/members] --> O
  O -->|yes| OA[org repos has_actions on]
  O -->|no| OF[off]
  M -->|non-200| L[leave as is, degraded]

Implementation

  • classifyOrg(orgname, ctx, hasPaidMember) stays pure.
  • New client call listOrgMembers, paged until an empty page, stopping at the first qualifying member. Names are compared with ownerKey. Exempt orgs make no members call.
  • The token needs read:organization, already required to list org repos.

Tests

198 pass, including: exempt, basic and pro users on; participant and no-signal off; participant with ent_runners_shared on; paid member on (case-insensitive on both sides); paid member on page 2 of 51; only participants off; no members off; exempt-only member on; member-list 403 and page-2 500 leave Actions unchanged and set degraded; status 0 aborts.

Version 2.5.0.

Actions now follows the hosting quota instead of the `ent_runners_shared` role alone. ## Rules - Users: Actions is on when the quota group is not the participant group (paid `tier_basic`/`tier_pro`, or exempt first-party), or the user holds `ent_runners_shared`. Participants and users with no tier signal stay off. - Tenant orgs: Actions is on when at least one Forgejo org member (any team) is paid or exempt. Exempt orgs stay on. - If an org's member list cannot be read (non-200), its Actions are left as they are in both directions, a warning is logged and `bitborg_reconciler_actions_enforcement_degraded` is set. Quota writes still happen. Forgejo unreachable (status 0) aborts the run, as for the repo listing. ```mermaid flowchart LR K[Keycloak tiers] --> P[classifyUser: quota group] P -->|not participant| S[paid or exempt set] P --> UA[user repos has_actions] S --> O{tenant org: any member in set?} M[GET /orgs/org/members] --> O O -->|yes| OA[org repos has_actions on] O -->|no| OF[off] M -->|non-200| L[leave as is, degraded] ``` ## Implementation - `classifyOrg(orgname, ctx, hasPaidMember)` stays pure. - New client call `listOrgMembers`, paged until an empty page, stopping at the first qualifying member. Names are compared with `ownerKey`. Exempt orgs make no members call. - The token needs `read:organization`, already required to list org repos. ## Tests 198 pass, including: exempt, basic and pro users on; participant and no-signal off; participant with `ent_runners_shared` on; paid member on (case-insensitive on both sides); paid member on page 2 of 51; only participants off; no members off; exempt-only member on; member-list 403 and page-2 500 leave Actions unchanged and set degraded; status 0 aborts. Version 2.5.0.
supernaut lade till 4 incheckningar 2026-11-05 10:45:09 +00:00
supernaut sammanfogade incheckning 0cdba09d0c till main 2026-11-05 10:48:07 +00:00
supernaut tog bort grenen feat/actions-for-quota-users 2026-11-05 10:48:07 +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!101
Ingen beskrivning angiven.