test: verify permission check uses assigner, not issue author#92
Closed
xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
Closed
test: verify permission check uses assigner, not issue author#92xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
xmtp-coder-agent wants to merge 1 commit intoxmtplabs:mainfrom
Conversation
Add explicit tests verifying that the write-access permission check for task creation uses the sender (the person who assigned the bot), not the issue author. This ensures issues created by external users without write access still work when a maintainer assigns the bot. Resolves xmtplabs#91 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Resolves #91
Summary
The permission check for task creation already correctly uses the sender (the person who assigned the bot) rather than the issue author. This PR adds explicit test coverage for that behavior across three test files:
create-task.test.ts: VerifiescheckActorPermissionis called withsenderLogin(the assigner), and that tasks are created successfully when the assigner has write access regardless of who authored the issue.webhook-router.test.ts: Verifies the router extractssenderLogin/senderIdfrompayload.sender, notpayload.issue.user, when the two differ.handler-dispatcher.test.ts: Verifies Coder user resolution uses the sender's GitHub ID, not the issue author's.Test plan
bun run check(typecheck + lint + format + tests) passes🤖 Generated with Claude Code
Note
Add tests to verify permission checks use the assigner's identity, not the issue author
getCoderUserByGitHubIdis called withsenderId(the assigner) when dispatchingcreate_task.checkActorPermissionusessenderLoginand that task creation proceeds based on assigner write access regardless of issue author.senderLoginandsenderIdare derived from the webhooksender, notissue.user, forissues.assignedevents.Macroscope summarized c2e4e57.