Skip to content

Roles & processes

How changes reach the cluster, who may do what, and how the cluster reports back. The roles below are generic: map each one to your own accounts and teams. A small team can hold several roles with one person, but keep the proposer and the approver of a change apart.

Roles

Role Does Cannot
Owner Accountable for the organisation: org settings, teams and members, issuing and revoking tokens, custody of the secrets vault – (not an operational role)
Maintainer Runs operations: approves and merges pull requests; repository and branch-protection settings; seals secrets; overrides protection in an incident Change org settings, teams or members
Contributor Pushes branches and opens pull requests Push to main; merge; approve its own change
Dependency bot (Renovate) Opens update PRs; merges the updates its allowlist permits once CI is green and the PR is approved Merge anything outside the allowlist; merge without approval
Reviewer (review account) Reviews every open PR and posts a formal review: approve, request changes, or comment Push, merge, or change any repository
Operator (assistant account) Answers operations questions in a chat room from read-only cluster, metrics and tracker data; opens and comments issues in the private tracker Change the cluster or any repository; read Secrets, ConfigMaps or logs

The reviewer, the operator and the scheduled report jobs are machine accounts. Each has its own token, so revoking one token disables exactly one role.

Teams and token scopes

Forgejo has one built-in team, Owners, which cannot be renamed or limited; every other team is your own. Forgejo scopes a token by category (repository, issue, …), never by repository, so the real limit is the account's team rights:

Team Members Rights Token scopes
Owners owner(s) everything, including org management –
Maintainers maintainers admin on all repositories (settings, protection override); no org management –
Contributors contributors write on all repositories repository, issue
Dependency-bots dependency bot write on code, issues and PRs of the repositories it updates; no access to the private ops repo repository, issue (private repositories included)
Reviewers reviewer read code, issues and PRs on the code repos write:repository (posting a review counts as a repository write), write:issue
Reviewers-ops reviewer read code and PRs, write issues on the private ops repo only as above
Operators operator read code and PRs, write issues on the private ops repo only write:issue

Write access does not include merging: merging main is limited by the merge whitelist below. The dependency bot is whitelisted by user.

Forgejo details that bite

  • Team invitations must be accepted. Adding an existing account to a team sends an invitation (the API still answers 204); the account is a member only after it accepts.
  • Whitelist the reviewer's team, not the user. On a public repository a read-only user is silently dropped from the approvals whitelist (the API answers 200). A team with read access stays.
  • "Official" is fixed when the review is submitted. Approvals posted before the account was whitelisted stay unofficial; submit them again.
  • Whitelists store team IDs. Renaming a team keeps it in every whitelist.

Branch protection on main

The same rule on every code repository (the GitOps repos, the Ansible repos, both docs sites, the status page):

Setting Value
Push disabled for everyone
Merge whitelist teams Owners and Maintainers + the dependency bot
Required approvals 1
Approvals whitelist the maintainer + the reviewer's team
Block merge on rejected reviews on
Dismiss stale approvals on
Block merge on outdated branch off (a rebase would void the approval)
Required status checks the repo's CI (render/validate, secret scan; Pages build on the docs sites)
Protected file patterns renovate.json;.forgejo/**, plus ci/** (GitOps and Ansible repos), validate.sh (Ansible repos), and in platform-argocd also applications/cluster-digest/**;applications/ops-agent/**
Apply to admins off

A PR that touches a protected file cannot be merged by anyone except through the admin override. These files are the gate itself (dependency policy, CI, the review and assistant code), so no automated role can change its own gate. A dependency-bot PR that bumps a CI file therefore waits for the maintainer.

The settings repository (below) has the same rule: required checks are its format/validate run and the secret scan, protected file patterns renovate.json;.forgejo/**. The dependency bot merges patch updates there; a merge changes no setting until a maintainer applies.

The private ops repository has main protected too: push disabled, merge whitelist teams Owners and Maintainers.

Settings as code

Teams and branch protection are not edited in the web UI. They are declared as OpenTofu code (provider svalabs/forgejo) in a separate settings repository and change through a PR there, like any other change.

Managed as code Stays manual
Teams except Owners: name, description, permission, unit rights Team repository assignments of the teams without all-repositories access (not supported by the provider yet)
Branch protection of main on every repository Team members (an invitation the account must accept)
Tokens, repository creation
  • Who applies: a maintainer, from main after the merge: tofu plan -out=…, check, then tofu apply of that plan. A follow-up tofu plan must show No changes.
  • Credentials per run: a Forgejo token with write:organization and write:repository, the object-storage key for the state bucket, and the state passphrase, all entered at the prompt and unset afterwards. Nothing is stored in the repository or the cluster.
  • State: in an S3 bucket, encrypted client-side (state and plan files). Keep the passphrase in the secrets vault; enable bucket versioning so an overwritten state can be recovered.
  • Drift: a change made in the UI shows up in the next plan, and that plan reverts it. Change the code instead, or adopt the UI change into the code before the next apply.

Change process

flowchart LR
  C[Contributor or<br/>dependency bot] -->|PR| CI[CI checks]
  CI --> R[Reviewer:<br/>formal review]
  R -->|approved| M{Merge}
  M -->|maintainer| A[ArgoCD sync]
  M -->|bot, allowlisted only| A
  A --> V[Verify]
  1. Propose. A contributor or the dependency bot opens a PR from a branch in the same repository. One load-bearing change per PR.
  2. CI renders and validates the charts and scans for secrets.
  3. Review. The review job (pr-review in the cluster-digest chart) runs every 10 minutes and reviews each open PR whose diff it has not seen yet. It posts:

    • approve for "merge",
    • request changes for "changes needed",
    • comment for "merge after …", "merge after kind test" or "hold".

    "Merge after kind test" means a dry run on a throwaway local cluster comes first, for upgrades whose risk such a cluster can show (CRD changes, operators of stateful data, migrations, rollbacks). The verdict names the scenario and the pass criteria.

    The review body on the PR is a neutral one-liner. The verdict text goes to the private ops tracker: one issue per week, with one comment per PR. A new push dismisses the approval (stale approvals), and the job reviews the new diff. A rejected review blocks the merge until the reviewer or the maintainer approves. 4. Merge. - Contributor PRs: the maintainer merges after the approval. - Dependency-bot PRs: the bot merges in its next run only what its renovate.json allowlist permits, and only once CI is green and the PR is approved. Everything else, and every Helm chart bump, is merged by the maintainer. See Renovate.

    The reviewer can only withhold or grant the second key. It never widens what the allowlist permits. 5. Sync and verify. ArgoCD syncs on push (or trigger it, see Operations). Check the Application is Synced/Healthy and the alert room is quiet. 6. Revert with a revert PR through the same process. In an incident the maintainer may use the admin override.

Reporting and monitoring

Source Schedule Goes to
Critical alerts on firing / resolve email + encrypted Matrix alert room (alertbot)
Warning alerts on firing / resolve email
Dead-man switch (always-firing Watchdog) continuous external check that notifies when pings stop
Daily digest 05:30 UTC email: health summary and security-relevant PRs; files actionable issues in the private tracker, deduplicated, closed when the alert clears
Weekly digest Sunday 07:00 UTC email: all open PRs and release notes in depth
Issue watch 06:00 UTC comments on tracker issues that became actionable (an upstream release or fix, a due date)
PR review every 10 min formal review on the PR; verdict in the weekly tracker issue

The schedules, the reviewed repositories and PR authors, and the cost caps are set in applications/cluster-digest/values.yaml.

Operations assistant

The ops-agent chart runs the operator role in its own encrypted Matrix room. It answers only when all of these hold: the sender is the configured person (ownerMxid), the message is in the configured room, it is encrypted, and the sending device is cross-signed by that person. It ignores everything else, direct messages included.

  • Reads: a fixed list of Kubernetes kinds (with credential-bearing fields stripped), metrics queries and firing alerts, open PRs, and the private tracker's issues and docs/.
  • Writes: tracker issues and comments only, a few per question.
  • Commands: !stop / !start (kill switch), !cost (this month's spend), !reset, !deep <question>.
  • Limits: a monthly budget and a per-question cap in values.yaml. Above the budget it stops until the next month.

Setup, permissions check and recovery are in the chart's README.

What is never delegated to a machine account

Maintainers:

  • Merging contributor PRs and anything that touches a protected file.
  • Sealing real secrets and anything derived from the master password (see Secrets).
  • Stateful and cluster-critical upgrades: storage, databases and their operators, the CNI, Talos and Kubernetes, cert-manager, ArgoCD, the openDesk upstream. The reviewer advises; the maintainer merges.
  • Branch-protection and repository settings, and applying the settings code.
  • Decisions with data-loss or user-impact risk during an incident.

Owners:

  • Org settings, teams and members; issuing and revoking tokens.
  • Custody of the secrets vault.

Switching a role off

Role Off switch
Reviewer prReview.enabled: false, or revoke its token. Removing its team from the approvals whitelist makes its reviews advisory. Required approvals then come from the maintainer.
Operator !stop in the room, scale the Deployment to 0, or global.components.opsAgent.enabled: false
Report jobs issueWatch.enabled / prReview.enabled in applications/cluster-digest/values.yaml; the digests stop with the cluster-digest Application
Dependency bot remove it from the merge whitelist; its PRs then wait for the maintainer

See also: Operations · Renovate · Secrets.