Skip to content

Conversation

@adityashirsatrao007
Copy link
Contributor

Description

This PR implements the automatic mentor assignment feature for new contributors, as proposed in #1063.

What's Added

  1. New Workflow: .github/workflows/bot-mentor-assignment.yml\

    • Triggers when any user is assigned to an issue
    • Uses the standard harden-runner step for security
  2. New Script: .github/scripts/mentor_assignment.sh\

    • Checks 'good first issue' label: Only proceeds if the issue has this label
    • Verifies new contributor: Skips if assignee is a maintainer/committer or has previously merged PRs
    • Assigns mentor: Attempts to fetch random mentor from @hiero-ledger/hiero-sdk-python-triage\ team
    • Posts welcome message: Includes helpful resources, mentor mention, and star repository prompt
    • Prevents duplicates: Won't post if welcome message already exists

Welcome Message Features

The bot posts a friendly welcome message that includes:

  • 👋 Personal greeting to the contributor
  • 📚 Links to contributing guide and DCO signing docs
  • 🧑‍🏫 Assigned mentor from the triage team
  • 💡 Links to changelog, testing, Discord, and community calls
  • ⭐ Encouragement to star the repository

Testing

This workflow follows the same patterns as existing bot workflows (\�ot-assignment-check.yml, \�ot-workflows.yml) and can be tested using the fork testing workflow as documented in \docs/sdk_developers/training/testing_forks.md.

Closes

Closes #1063

Checklist

  • Added changelog entry
  • DCO signed commit
  • Follows existing workflow patterns
  • Script is well-documented with comments

- Added bot-mentor-assignment.yml workflow that triggers on issue assignment
- Added mentor_assignment.sh script that:
  - Checks if issue has 'good first issue' label
  - Verifies assignee is a new contributor (no merged PRs)
  - Assigns random mentor from @hiero-ledger/hiero-sdk-python-triage team
  - Posts welcoming message with helpful resources

Closes hiero-ledger#1063

Signed-off-by: Aditya Shirsatrao <adityashirsatrao007@gmail.com>
Signed-off-by: adityashirsatrao007 <adityashirsatrao007@gmail.com>
Copilot AI review requested due to automatic review settings December 13, 2025 08:05
Copy link
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 implements an automatic mentor assignment bot that welcomes new contributors working on "good first issue" labeled issues and assigns them a mentor from the triage team.

Key Changes:

  • Added GitHub Actions workflow that triggers on issue assignment events
  • Implemented bash script to verify new contributors, fetch mentors, and post welcome messages
  • Updated CHANGELOG to document the new feature

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
CHANGELOG.md Added entry documenting the new mentor assignment bot feature
.github/workflows/bot-mentor-assignment.yml New workflow that triggers on issue assignments and executes the mentor assignment script
.github/scripts/mentor_assignment.sh New script that checks for "good first issue" label, verifies new contributor status, assigns a mentor, and posts a welcome message

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

Signed-off-by: Aditya Shirsatrao <adityashirsatrao007@gmail.com>
Signed-off-by: adityashirsatrao007 <adityashirsatrao007@gmail.com>
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

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

Hi @adityashirsatrao007
I will not accept this PR until its tested on your fork and assignments are done on your fork please (not posted here)

@exploreriii exploreriii marked this pull request as draft December 13, 2025 08:26
- Added workflow_dispatch trigger with dry_run input for testing
- Added DRY_RUN mode that logs without posting comments
- Added concurrency group to prevent duplicate messages
- Added members:read permission for team API access
- Added set -euo pipefail for safer script execution
- Fixed jq command (removed @JSON to avoid double-encoding)
- Consolidated TRIAGE_TEAM variables for maintainability
- Improved duplicate detection using regex pattern
- Removed threads.json file

Signed-off-by: Aditya Shirsatrao <adityashirsatrao007@gmail.com>
Signed-off-by: adityashirsatrao007 <adityashirsatrao007@gmail.com>
@adityashirsatrao007
Copy link
Contributor Author

Hi, I've addressed all the review feedback:

Changes made:

  1. ✅ Added \workflow_dispatch\ trigger with \dry_run\ input for testing
  2. ✅ Added \DRY_RUN\ environment variable that logs without posting comments
  3. ✅ Added \concurrency\ group to prevent duplicate messages from rapid assign/unassign
  4. ✅ Added \members: read\ permission for team API access
  5. ✅ Added \set -euo pipefail\ for safer script execution
  6. ✅ Fixed jq command (removed @JSON\ to avoid double-encoding issue)
  7. ✅ Consolidated \TRIAGE_TEAM\ variables for maintainability
  8. ✅ Improved duplicate detection using regex pattern
  9. ✅ Removed the \ hreads.json\ file

Testing:
I tried to test on my fork but issues are disabled on forked repositories. The \workflow_dispatch\ trigger is now available for testing. Could you please help test this by:

  1. Running the workflow manually via Actions tab with \dry_run=true\
  2. Or assigning someone to a 'good first issue' on a test repo

The dry_run mode will show what would be posted without actually commenting.

@exploreriii
Copy link
Contributor

exploreriii commented Dec 13, 2025

This is not correct
I tried to test on my fork but issues are disabled on forked repositories

enable them in your repository settings

@exploreriii
Copy link
Contributor

@adityashirsatrao007 adityashirsatrao007 marked this pull request as ready for review December 13, 2025 08:42
@exploreriii
Copy link
Contributor

This is untested thus not ready for review

@exploreriii exploreriii marked this pull request as draft December 13, 2025 08:44
@MonaaEid
Copy link
Contributor

MonaaEid commented Dec 13, 2025

I tested it with dry run and make an issue and assign myself and none of them triggered the workflow. Also have this error...please make sure it has the minimum output to review
image

@exploreriii
Copy link
Contributor

Hi @adityashirsatrao007
Thanks for going the extra mile here
I'm closing the pull request because you are not assigned to this issue, and you are already assigned to two other issues. We've also not approved the issue.
Working on this means not working on the others and leaving the pipeline full, preventing others from taking part.

Complete your two other PRs, please,or, request to be removed from them

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.

Bot Idea: Automatic Mentor Assignment for New Starters

3 participants