Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

feat(application): multi-role support for manager and reviewer roles#256

Merged
karaktaka merged 8 commits into
mainfrom
feature/application-multi-role
Feb 26, 2026
Merged

feat(application): multi-role support for manager and reviewer roles#256
karaktaka merged 8 commits into
mainfrom
feature/application-multi-role

Conversation

@karaktaka
Copy link
Copy Markdown
Contributor

Summary

  • New junction table ApplicationGuildRole(GuildId, RoleId, RoleType) replaces the single ManagerRoleId/ReviewerRoleId columns on ApplicationGuildConfig, allowing guilds to assign multiple Discord roles to each type
  • Alembic migration 006 migrates existing single-role data and drops the old columns; dialect-aware (SQLite + PostgreSQL) with fresh-install guard
  • Permission checks (check_application_permission, check_override_permission) rewritten to query all configured roles and use any() intersection
  • Review channel mentions now ping all configured manager and reviewer roles instead of just one each
  • Command groups rewritten: managerole and reviewerrole now have add <role>, remove <role>, clear, and list subcommands (replacing the old single set/remove pair)
  • Locale strings updated in EN and DE for all four subcommands
  • Bug fix: review channel permission error message now correctly references the review channel (not the apply channel)

Test plan

  • /application managerole add @Role — adds role, idempotent on repeat
  • /application managerole remove @Role — removes specific role; shows error if not configured
  • /application managerole clear — removes all manager roles
  • /application managerole list — shows embed with all configured roles
  • Same for reviewerrole
  • Users holding any one of multiple manager/reviewer roles can vote and override as expected
  • Review channel mention on new application pings all configured roles
  • alembic upgrade head on an existing DB migrates single-role data correctly
  • Fresh install (create_all) produces correct schema without migration needed

🤖 Generated with Claude Code

karaktaka and others added 8 commits February 26, 2026 21:05
…le-role columns

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
… junction table

Co-Authored-By: Claude <noreply@anthropic.com>
…viewerrole commands

Co-Authored-By: Claude <noreply@anthropic.com>
…er/reviewer roles

Co-Authored-By: Claude <noreply@anthropic.com>
…er/reviewer roles

Replace the old single-role ApplicationGuildConfig lookup with a query against
ApplicationGuildRole so all configured manager and reviewer roles are pinged
when a new submission is posted to the review channel.

Also update TestHasManagePermission tests to use ApplicationGuildRole instead
of the removed ApplicationGuildConfig.ManagerRoleId/ReviewerRoleId columns.

Co-Authored-By: Claude <noreply@anthropic.com>
…-role support (add/remove/clear/list)

Co-Authored-By: Claude <noreply@anthropic.com>
When the bot lacks permissions in the review channel, the error
message was incorrectly referencing `channel` (the apply channel),
which can be None in settings commands and would raise AttributeError.

Co-Authored-By: Claude <noreply@anthropic.com>
@karaktaka karaktaka merged commit a64f10e into main Feb 26, 2026
6 checks passed
@karaktaka karaktaka deleted the feature/application-multi-role branch February 26, 2026 20:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant