BLT icon indicating copy to clipboard operation
BLT copied to clipboard

feat: send Slack message to #project-blt-bacon on new bacon claim (#3754)

Open mahii-17 opened this issue 9 months ago • 3 comments

What this PR does

Adds Slack integration to notify the #project-blt-bacon channel whenever a new Bacon claim is submitted via the claim portal.

💬 Message format:

New bacon claim submitted by 🔗 <GitHub PR link> 💸 Bacon Requested:

✅ Implementation details

  • Uses slack_sdk.WebClient to send messages
  • Token loaded securely from .env via os.getenv("SLACK_BOT_TOKEN")
  • .env ignored by Git; .env.local used locally for secrets
  • Slack message sent in BaconSubmissionView after a successful submission
  • Error handling added to avoid Slack errors breaking the flow
  • Implements org-based Slack routing for bacon claims. Closes #3754

📄 Environment setup

Add this to your .env or .env.local file:

SLACK_BOT_TOKEN=xoxb-your-real-slack-token
Slack bot must be added to the #project-blt-bacon channel
Required scope: chat:write
Additional cleanup
Ran black and isort for code formatting
Confirmed .env tracking is safe and clean

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Launched a dedicated Style Guide page accessible via the sidebar.
  - Revamped the Social page with a dynamic feed and pagination.
  - Added a “Benefits for Mentors” section on the GSoC page.
  - Updated organization analytics to include a summary of security incidents.

- **Improvements**
  - Enhanced lecture display with secure URL handling.
  - Implemented profanity filtering for bug report submissions.
  - Strengthened validation for organization submissions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

mahii-17 avatar Mar 21 '25 18:03 mahii-17