Files
zitadel/.golangci.yaml
T
SilvanandMarco Ardizzone f138082b64 feat: add administrator repository (#11803)
Introduces the `administrators` relational table and repository layer
for the v3 backend, unifying instance, organization, project, and
project-grant membership into a single scoped model.

Closes #10220

## Changes

- **Domain**: `Administrator` struct, `AdministratorScope` enum,
`AdministratorRepository` interface with typed CRUD, column, condition,
and change helpers. Generated enumer and GoMock.
- **Migration** (`016`): `zitadel.administrators` table with a generated
`id`, scope-alignment check constraint, cascading foreign keys, and a
child `administrator_roles` table.
- **Repository**: CTE-based role mutations (`AddRole`, `RemoveRole`,
`SetRoles`) for atomicity. Roles aggregated via `ARRAY_AGG`.
- **Projection**: Event reducers for
`member.added/changed/removed/cascade_removed` across all four admin
scopes.
- **Fixes**: `Rows.Close()` error wrapping; `TextArray` nil-safe scan +
full `pgtype` array interface; `authorization` and `projectGrant` scan
helpers fixed for `ARRAY_AGG` under `database/sql`; removed unused `ctx`
parameter from `callReduce`.

---------

Co-authored-by: Marco Ardizzone <marco@zitadel.com>
2026-03-18 10:24:09 +01:00

169 lines
2.9 KiB
YAML

version: "2"
run:
concurrency: 4
go: "1.25"
linters:
enable:
- asciicheck
- bodyclose
- contextcheck
- errname
- errorlint
- exhaustive
- gocognit
- gocritic
- misspell
- nakedret
- nolintlint
- nosprintfhostport
- rowserrcheck
- sqlclosecheck
- unconvert
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- nilnil
disable:
- bidichk
- containedctx
- cyclop
- decorder
- depguard
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errchkjson
- exhaustruct
- forbidigo
- forcetypeassert
- funlen
- gochecknoglobals
- gochecknoinits
- goconst
- gocyclo
- godot
- godox
- goheader
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- grouper
- importas
- interfacebloat
- ireturn
- lll
- loggercheck
- maintidx
- makezero
- mnd
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nonamedreturns
- paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- revive
- tagliatelle
- testableexamples
- testpackage
- thelper
- tparallel
- unparam
- usestdlibvars
- varnamelen
- wastedassign
- whitespace
- wrapcheck
- wsl
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- path: apps/docs/.*
linters:
- typecheck
# contextcheck requires a context to be passed to the function, but in tests we use `testing.T.Context()` which is not recognized as a context by the linter, so we disable it for the function.
- path: internal/query/projection/.*_relational_test\.go
linters:
- contextcheck
source: callReduce\(
paths:
- .artifacts
- .backups
- .codecov
- .github
- .keys
- .vscode
- .devcontainer
- build
- deploy
- guides
- internal/api/ui/login/static
- openapi
- proto
- tools
- third_party$
- builtin$
- examples$
- apps
- packages
- console
- docs
- benchmark
- tests
issues:
max-issues-per-linter: 0
max-same-issues: 0
new-from-rev: origin/main
formatters:
enable:
- gci
settings:
gci:
sections:
- standard
- default
- prefix(github.com/zitadel/zitadel)
custom-order: true
exclusions:
generated: lax
paths:
- .artifacts
- .backups
- .codecov
- .github
- .keys
- .vscode
- .devcontainer
- build
- deploy
- guides
- internal/api/ui/login/static
- openapi
- proto
- tools
- third_party$
- builtin$
- examples$
- apps
- packages
- console
- docs
- benchmark
- tests