Skip to content

Allow users to re-open their own tickets#200

Merged
MMK21Hub merged 7 commits into
hackclub:mainfrom
MMK21Hub:feedback
May 6, 2026
Merged

Allow users to re-open their own tickets#200
MMK21Hub merged 7 commits into
hackclub:mainfrom
MMK21Hub:feedback

Conversation

@MMK21Hub
Copy link
Copy Markdown
Collaborator

@MMK21Hub MMK21Hub commented May 5, 2026

Question askers can now re-open their own tickets, should they wish!

image

This PR also adds error messages for trying to resolve or re-open tickets you don't have permission to.

Finally, it changes the can_resolve() permission check to check if you're in the BTS channel - previously, the tickets channel was used, which didn't make as much sense.

This PR also lays the groundwork for ticket feedback, but that is not implemented in this PR.

Copilot AI review requested due to automatic review settings May 5, 2026 22:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Nephthys’ ticket lifecycle so that resolved tickets can be re-opened (including by the original question asker), with clearer user-facing error messages when a user attempts an action they don’t have permission to perform. It also adjusts the helper permission check used for resolving/reopening to be based on BTS channel membership instead of the tickets channel.

Changes:

  • Add a “Re-open thread” button to the resolved-ticket message and wire it to a new reopen action.
  • Add ephemeral error messages for unauthorized resolve/reopen attempts and for attempting to resolve/reopen tickets in invalid states.
  • Update can_resolve() to use SLACK_BTS_CHANNEL membership for helper permissions, and introduce ENABLE_FEEDBACK env gating for an optional feedback button.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
nephthys/utils/ticket_methods.py Extends reply_to_ticket to support Block Kit blocks for richer resolved/reopened messages.
nephthys/utils/slack.py Adds a Slack action handler for the new “reopen” button on resolved messages.
nephthys/utils/permissions.py Changes resolve permission check to use BTS channel membership.
nephthys/utils/env.py Adds a robust boolean env var parser and introduces ENABLE_FEEDBACK.
nephthys/macros/types.py Fixes macro ephemeral reply to use snake_case Piccolo model attributes.
nephthys/macros/reopen.py Refactors reopen macro to call the centralized actions.reopen logic.
nephthys/errors/errors.py Introduces typed exceptions for “ticket not closed” and permission errors.
nephthys/actions/resolve.py Adds user-facing ephemeral errors and posts a resolved message with action buttons.
nephthys/actions/reopen.py Adds the core reopen action implementation (DB updates + Slack messaging).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nephthys/actions/reopen.py
Comment thread nephthys/actions/reopen.py
Comment thread nephthys/actions/reopen.py
Comment thread nephthys/actions/resolve.py
Comment thread nephthys/actions/resolve.py
Comment thread nephthys/utils/slack.py Outdated
Comment thread nephthys/utils/slack.py
@MMK21Hub MMK21Hub enabled auto-merge May 5, 2026 23:07
@MMK21Hub MMK21Hub added this pull request to the merge queue May 6, 2026
Merged via the queue into hackclub:main with commit 16d9879 May 6, 2026
4 checks passed
@MMK21Hub MMK21Hub deleted the feedback branch May 6, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants