feat(auth): add refresh-token BulkUpsert with per-record results
InternalOAuthDoorkeeperRefreshTokensService.BulkUpsert now upserts up to 1,000 Doorkeeper refresh tokens in one call, each with the semantics of the single-record Upsert (gitlab-org/gitlab#635782 (closed)).
The handler refuses records that fail the proto rules one by one, then hands the rest to TokenRepository.BulkUpsert from !1030 (merged), which refuses the rest per record, including a plaintext signature, and applies the others in one transaction. A record is CLIENT_NOT_FOUND when its client is not replicated, which is retryable, CLIENT_MISMATCH when its token id belongs to another client, and INVALID when its signature is stored under another token id. A failed transaction writes nothing and returns ABORTED or INTERNAL.
Read the handler and its reason mapping first; its integration test covers every outcome against the database, and a second one fails the update after an insert ran and checks both are rolled back. The through-server test that drives this RPC with a missing token, 1,001 records and a repeated batch arrives with !994 (merged), which adds the shared metrics it asserts on.
How verified: unit and integration suites on Postgres and YugabyteDB, lint and the agent-docs check locally; CI runs the same. The stack's end-to-end test in system-test-suite drove BulkUpsert with 3,000 tokens against iam serve all on both backends.
Part 8 of 11. The full change is in !959 (closed), the integration MR, kept open for the big picture.
- !988 (merged) feat(proto): add BulkUpsertClients and UpsertResult (merged)
- !989 (merged) feat(auth): add BulkUpsertClients with per-record results (merged)
- !990 (merged) refactor(auth): move the bulk record helpers to internal/batch (merged)
- !1010 (merged) fix(auth): decide refresh-token upserts in Go (merged)
- !1029 (merged) fix(auth): gate stored rows in one upsert helper and wait on the lock (merged)
- !1030 (merged) feat(auth): add a batch path to the refresh-token repository (merged)
- !1031 (merged) feat(proto): add BulkUpsert to the refresh-token service
- !991 (merged) feat(auth): add refresh-token BulkUpsert with per-record results <- this MR
- !992 (merged) feat(auth): add refresh-token BulkDelete
- !993 (merged) feat(auth): add refresh-token GetState
- !994 (merged) feat(auth): count bulk RPC records by outcome
Previous: !1031 (merged) · Next: !992 (merged)