Repository navigation
feat: add a super-admin user directory and page people on Discord - #406
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Backs the super-admin user directory: SearchUsers pages the global user list with a case-insensitive, wildcard-escaped substring search on email/name, and ListMembersByUsers batches org-membership lookups for a page of users into one query instead of one query per row. Implemented in both the postgres and sqlite dialects. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Exposes a searchable, paged, read-only directory over the global user table with org memberships attached, gated behind RequireSuperAdmin. The response is an explicit allow-list DTO (never models.User), so passwordHash/totpSecret/totpRecoveryCodes can never leak onto the wire. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ler) 401/403/200 with a positive control, case-insensitive email/name search with literal-%% escaping, limit/offset paging and total, soft-delete exclusions (user, membership, org), the empty-slice ListMembersByUsers fast path, and a raw-JSON assertion that the response never carries passwordHash/totpSecret/totpRecoveryCodes. Also fixes an unqualified "deleted_at IS NULL" in the ListMembersByUsers relation apply-closure that SQLite flagged as an ambiguous column between organization_member and organization. Co-Authored-By: Claude Sonnet 5 <[email protected]>
bun.In is deprecated (staticcheck) -> bun.List, matching the codebase's existing IN-clause pattern; forcetypeassert/prealloc/varnamelen/lll cleanups in the new tests and handler. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
New Users tab under /orgs/:org/server, modelled on the entitlements admin page: debounced search, a paged table (email, name, org badges linking to the entitlements detail page, status flags, last active, created), and PermissionDenied on a 403 rather than a redirect. Adds useAdminUsersList + AdminUserRow/AdminOrgMembership to hooks.ts and locale keys to all four languages. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Tab visibility, the search/clear round trip against real seeded data, PermissionDenied on a 403, and the non-superadmin gate — mirrors server-entitlements.spec.ts's shape. Type-checks and lints clean (bun run typecheck:e2e / lint:e2e); not run end-to-end here because the local :4000 devloop isn't in SP_RUNMODE=test and this task must not stand up its own side-car server. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Fixes mockDBService (internal/notifications) to implement the two new db.Service methods (SearchUsers, ListMembersByUsers), which lint-back's typecheck caught. Full gate green: make build-backend lint-back test, make build-dash0, bun run lint (no new errors beyond the documented pre-existing debt), bun run test:unit (1753 passed, locale parity holds). Co-Authored-By: Claude Sonnet 5 <[email protected]>
The install-deps target installed @latest while go.mod pins v2.8.0, so a developer running it got whatever the newest release happened to be. That drift has broken codegen here before. Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…Client.CreateDM Co-Authored-By: Claude Opus 5 <[email protected]>
- opsnotify + escalation step page a discord contact through the instance bot - 50007 degrades to "unavailable" so paging falls through to the next route - CreateContact rejects a typed snowflake; connect (sign-in) and OAuth link mode are the only two sources - link mode mints no session and creates no organization, by construction - identitylink.DeclaredDiscordIdentity backs on-call mentions, the admin mapping table and the account page - support attributes a captured Discord DM to the member Co-Authored-By: Claude Opus 5 <[email protected]>
…e sender about it Co-Authored-By: Claude Opus 5 <[email protected]>
…d OAuth link-mode negatives Co-Authored-By: Claude Opus 5 <[email protected]>
… paging, support attribution and the DM sender Co-Authored-By: Claude Opus 5 <[email protected]>
… to dash0 Co-Authored-By: Claude Opus 5 <[email protected]>
…gestion, Gateway status, account page, DM tab) Co-Authored-By: Claude Opus 5 <[email protected]>
…ment the DM paths A DM interaction carries no guild_id, so the guild-keyed org lookup answered "this server is not connected" for a button that rendered perfectly. The org now comes from the presser's own verified discord contact, narrowed to the org owning that incident — presser first, so an incident UID is never enough on its own. Also clears every golangci-lint finding and documents the member DM contact, the DM destination tab and the 50007 remedy. Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
…ed first page Both failures shared one root cause: [email protected] is the oldest seeded user (created_at DESC ordering), so on a full-suite run with 88+ users created after it, it no longer lands on the unsearched first page of 50. Re-ground both tests on search reaching it instead — which is strictly stronger, since it also proves search actually finds it — keep the non-matching-query negative control, and tighten the org-badge assertion to the specific "test · admin" badge text ([email protected] belongs to test/test2/test3, so a bare "test" substring match would also pass on test2's badge). Co-Authored-By: Claude Sonnet 5 <[email protected]>
fclairamb
enabled auto-merge (squash)
September 20, 2026 10:56
Merged
fclairamb
added a commit
that referenced
this pull request
Sep 21, 2026
🤖 I have created a release *beep* *boop* --- ## [0.30.0](v0.29.2...v0.30.0) (2026-09-21) ### Features * add a super-admin user directory and page people on Discord ([#406](#406)) ([3506c8f](3506c8f)) * **discord:** finish the bot migration — retire the webhook transport and close the frontend gaps ([#409](#409)) ([e89710d](e89710d)) * group-based status page sections, ICMP burst sampling, and form exposure ([#411](#411)) ([e3c87e8](e3c87e8)) ### Bug Fixes * **deps:** update module github.com/urfave/cli/v3 to v3.13.0 ([#408](#408)) ([5c10ab5](5c10ab5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two specs from
specs/todos/, implemented on a batch branch and archived tospecs/done/2026/09/.What & why
A super admin can now list and search users (
specs/done/2026/09/2026-09-19-04)An operator had no way to answer "does [email protected] have an account, and which orgs is she in?". Membership was only visible from inside an org, so you had to guess the org first, and accounts belonging to no org or to several were invisible.
New
GET /api/v1/system/usersbehindRequireAuth+RequireSuperAdmin, and a Users tab in server settings.models.UsercarriesPasswordHash,TOTPSecretandTOTPRecoveryCodes, so a test asserts on the serialized JSON bytes that none of them appear, with a positive control thatemaildoes.ListMembersByUsersresolves a whole page's memberships in oneuser_uid IN (...)query, so a page costs two queries instead of 1+N.%and_in the query are escaped, so typing%matches a literal%.A person can be paged on Discord (
specs/done/2026/09/2026-09-19-05)The Discord bot could alert a channel but could not page a human.
user_contactsknew Slack, Telegram, WhatsApp, Pushover, ntfy and web push, and not Discord, so every per-person path skipped it: escalation steps targeting a person, operator notices, the account page's Test button, and support attribution for a DM the Gateway already captured.discordcontact type, delivered by the instance bot. The DM channel id is cached on the contact so paging does not re-open a DM on every notice, and a re-connect does not wipe the cache.50007(DMs closed, or no shared server) maps to unavailable, so paging coverage falls through to the member's next route instead of counting as delivered. A plain 5xx does not, and there is a test for that distinction.GUILD_MEMBERSintent).opsnotify,jobtypes,usernotifications,identitylink,discordandsupport.Two deviations worth reviewing
The migration is a SECTION in
022_v0_30_0, not the023the spec asked for. v0.30.0 has not shipped andwiki/conventions/database.mdsays not to open023. A dev database that already ran an earlier draft of022must be reset (SP_DB_RESET=true), never repaired.Acknowledge pressed inside a DM was broken and is fixed here, which the spec did not ask for. A DM interaction carries no
guild_id, so Acknowledge from the new DM action row would have answered "this server is not connected". The org is now resolved presser-first from their verifieddiscordcontact, which is also the authorization: an incident UID alone must never silence someone else's page.GetIncidentis org-scoped in both dialects, and a stranger, a revoked binding and a cross-org incident are each refused by a test.Unrelated, one line
server/pkg/client/Makefileinstalledoapi-codegen@latestwhilego.modpinsv2.8.0. Pinned it.How to test
Full dash0 Playwright suite, run against a side-car on a dedicated
solidping_e2edatabase: 840 passed, 12 skipped, 0 failed (23.9 min).The first run of that suite was red, and it was a real finding rather than a flake.
server-users.spec.tsasserted[email protected]was visible on the unsearched first page. That holds in isolation and fails at test 744 of 853, because by then the suite has created 88 users and the page shows 50 orderedcreated_at DESC, so the oldest seeded user is on page 2. Both tests are re-grounded on search, which also proves search finds the row, and the non-matching-query negative control is kept. The org badge assertion went from"test"to"test · admin", since the seeded user is intest,test2andtest3and the loose match passed on the wrong badge.One pre-existing flake showed up and is not from this branch:
login.spec.ts:470(passkey RP-ID mismatch) failed twice then passed. Nothing here touches WebAuthn, and the same test passed first try on identical code an hour earlier.go-webauthnwas bumped to v0.18.2 on main in cadacf7, which is the likelier trigger. Being tracked separately.Checklist
make fmt && make lint && make testpass locally (make build-dash0 && cd web/dash0 && bun run lint && bun run test:unitifweb/dash0changed)web/docs/) if user-visible; wiki (wiki/) if operationalSECTION:to the current unreleased migration file underserver/internal/db/postgres/migrations/andserver/internal/db/sqlite/migrations/(one consolidated migration per release, per engine — seewiki/conventions/database.md), not a new numbered file🤖 Generated with Claude Code