Skip to content

Backend: Add ListAdminActions and ListModerationStates RPCs#8469

Merged
aapeliv merged 2 commits into
developfrom
backend/feature/list-admin-actions-and-moderation-states
May 7, 2026
Merged

Backend: Add ListAdminActions and ListModerationStates RPCs#8469
aapeliv merged 2 commits into
developfrom
backend/feature/list-admin-actions-and-moderation-states

Conversation

@aapeliv

@aapeliv aapeliv commented May 7, 2026

Copy link
Copy Markdown
Member

Adds two new admin/moderation review RPCs to support browsing historical activity from the admin UI:

  • Admin.ListAdminActions — paginated list of admin action log entries, optionally filtered by admin_user_id and/or target_user_id. Returns newest first. The AdminActionLog message gains target_user_id and target_username fields so callers can render rows without an extra lookup.
  • Moderation.ListModerationStates — paginated list of ModerationState rows, ordered chronologically (with optional newest_first). Supports filtering to states whose underlying content was authored by a specific user, by EXISTS-checking each registered moderation object type's author column.

Testing

  • Added unit tests covering empty results, ordering, filtering by admin/target/author, and pagination for both RPCs.
  • make format and make mypy pass.
  • uv run pytest src/tests/test_admin.py src/tests/test_moderation.py (run locally before pushing).

Backend checklist

  • Added tests for any new code or added a regression test if fixing a bug
  • Run the backend locally and it works
  • Added migrations if there are any database changes, rebased onto `develop` if necessary for linear migration history

For maintainers

  • Maintainers can push commits to my branch
  • Maintainers can merge this PR for me

This PR was created with the Couchers PR skill.

Adds paginated, filterable list endpoints so admins can browse the full
admin action log (with admin and target usernames) and moderation state
history (filterable by content author).
@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
couchers Ready Ready Preview May 7, 2026 2:54am

Request Review

@aapeliv
aapeliv merged commit 0ecb01a into develop May 7, 2026
5 checks passed
@aapeliv
aapeliv deleted the backend/feature/list-admin-actions-and-moderation-states branch May 7, 2026 03:34
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

📝 Release Notes

This PR does not need to be included in release notes.

Reason: This PR adds backend RPCs to support admin and moderation teams browsing historical admin actions and moderation states in internal admin UI. It is not a user-facing feature for end users, and while moderation-related, it appears to be internal tooling rather than a safety feature users directly notice. It also does not rise to the level of major technical infrastructure work for release notes.

🤖 Bot Debug Information

Model: couchers.openai.gpt-5.4
Decision: exclude
Reasoning: This PR adds backend RPCs to support admin and moderation teams browsing historical admin actions and moderation states in internal admin UI. It is not a user-facing feature for end users, and while moderation-related, it appears to be internal tooling rather than a safety feature users directly notice. It also does not rise to the level of major technical infrastructure work for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant