Skip to content

fix(bitbucket): better handling of bot-initiated events#30

Merged
daabr merged 2 commits into
mainfrom
bots
Mar 8, 2026
Merged

fix(bitbucket): better handling of bot-initiated events#30
daabr merged 2 commits into
mainfrom
bots

Conversation

@daabr
Copy link
Copy Markdown
Member

@daabr daabr commented Mar 8, 2026

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 8, 2026

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

Improves Bitbucket event handling when the event actor is a bot (app_user), ensuring turn-tracking and Slack messaging behave sensibly when no real user email exists.

Changes:

  • Added users.BitbucketActorToEmail and updated workflows to use it, mapping app_user actors to "bot".
  • Propagated accountType through Bitbucket ID→email resolution to avoid unnecessary Jira lookups for bots.
  • Updated Slack turn/reminder logic and messaging to ignore empty/"bot" emails and render a “no one’s turn” message.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/users/bitbucket.go Adds actor→email wrapper and bot mapping behavior for app_user.
pkg/users/bitbucket_test.go Adds unit tests covering bot/app actors mapping to "bot".
pkg/bitbucket/workflows/pullrequest.go Switches workflows to actor-based email resolution.
pkg/bitbucket/workflows/comment.go Switches turn/activity updates to actor-based email resolution.
pkg/bitbucket/pull_requests.go Uses actor-based email resolution during PR init; clarifies account filtering comment.
pkg/bitbucket/pull_requests_test.go Updates test to use app_user type.
pkg/data/turns.go Adds account type awareness to email lookup; modifies reset behavior for corrupted/missing turns files.
pkg/data/users.go Treats "bot" email as non-user in SelectUserByEmail.
pkg/slack/pr_data.go Skips empty/"bot" emails during reminder scan.
pkg/slack/commands/turns.go Filters empty/"bot" emails and adds “no one’s turn” message path.
pkg/slack/commands/turns_test.go Adds coverage for “no one’s turn” output when only invalid/bot emails are present.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread pkg/data/turns.go
Comment thread pkg/users/bitbucket.go
@daabr daabr merged commit f40ebe6 into main Mar 8, 2026
5 checks passed
@daabr daabr deleted the bots branch March 8, 2026 08:44
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