-
Notifications
You must be signed in to change notification settings - Fork 180
Adds Slack notifications on PR assignment #1359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… the requestor is not part of the code, one of the codeowners is assigned
bugbot run |
return; | ||
} | ||
|
||
assignees = pickRandom(candidates, needed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't use teams in CODEOWNERS, so ok
// Read and parse CODEOWNERS file | ||
let codeownersContent; | ||
try { | ||
codeownersContent = fs.readFileSync("CODEOWNERS", "utf8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: CODEOWNERS Parsing Ignores Non-Root Locations
The CODEOWNERS
parsing logic currently only checks the repository root for the file. GitHub supports CODEOWNERS
in three standard locations (root, .github/
, and docs/
), so the action fails to find files in .github/
or docs/
. This prevents the fallback assignment logic from working correctly when the PR author isn't in a configured team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is ok
} | ||
|
||
const email = await getGitHubUserEmail(githubUsername); | ||
if (!email || !email.endsWith("@e2b.dev")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't work if the primary email isn't e2b.dev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, i will take a look at this, seems like via GraphQL you can query all mails..
Adds Slack notifications on PR assignment
It uses emails as handler link between github and slack since usernames do not match, but mails do :).
Once the automation picks the assignee for PR review it sends a slack message:
Note
Sends Slack DMs to newly assigned PR reviewers and adds CODEOWNERS-based assignee fallback when the author isn’t in configured teams, updating the workflow to include Slack deps and token.
.github/actions/auto-request-same-site/script.js
):@e2b.dev
).SLACK_BOT_TOKEN
.CODEOWNERS
parsing and use as fallback when author isn’t ineng-sf
/eng-prg
..github/workflows/auto-request-same-site.yml
):@slack/web-api
and passSLACK_BOT_TOKEN
to the action.Written by Cursor Bugbot for commit bf0e020. This will update automatically on new commits. Configure here.