Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/scripts/bot-gfi-assign-on-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ function commentRequestsAssignment(body) {
*/
function issueIsGoodFirstIssue(issue) {
const labels = issue?.labels?.map(label => label.name) ?? [];
const isGfi = labels.includes(GOOD_FIRST_ISSUE_LABEL);
const isGfi = labels.some(label =>
typeof label === 'string' && label.toLowerCase() === GOOD_FIRST_ISSUE_LABEL.toLowerCase()
);

console.log('[gfi-assign] issueIsGoodFirstIssue:', {
labels,
Expand Down Expand Up @@ -201,6 +203,25 @@ module.exports = async ({ github, context }) => {
});

console.log('[gfi-assign] Assignment completed successfully');

// Chain mentor assignment after successful GFI assignment
try {
const assignMentor = require('./bot-mentor-assignment.js');
await assignMentor({
github,
context,
assignee: { login: requesterUsername, type: 'User' } // Pass freshly-assigned username
});
console.log('[gfi-assign] Mentor assignment chained successfully');
} catch (error) {
console.error('[gfi-assign] Mentor assignment failed but user assignment succeeded:', {
message: error.message,
status: error.status,
issueNumber: context.payload.issue?.number,
assignee: requesterUsername,
});
// Don't throw error - user assignment was successful
}
} catch (error) {
console.error('[gfi-assign] Error:', {
message: error.message,
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/bot-mentor-assignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ Happy building!
— Python SDK Team`;
}

module.exports = async ({ github, context }) => {
module.exports = async ({ github, context, assignee: passedAssignee }) => {
try {
const issue = context.payload.issue;
const assignee = context.payload.assignee;
const assignee = passedAssignee || context.payload.assignee;

if (!issue?.number || !assignee?.login) {
return console.log('No issue or assignee found in payload. Skipping.');
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
- Added workflow to prevent assigning intermediate issues to contributors without prior Good First Issue completion (#1143).
- Added `Client.from_env()` and network-specific factory methods (e.g., `Client.for_testnet()`) to simplify client initialization and reduce boilerplate. [[#1251](https://github.com/hiero-ledger/hiero-sdk-python/issues/1251)]
- Improved unit test coverage for `TransactionId` class, covering parsing logic, hashing, and scheduled transactions.
- Chained Good First Issue assignment with mentor assignment to bypass GitHub's anti-recursion protection - mentor assignment now occurs immediately after successful user assignment in the same workflow execution. (#1369)

### Changed
- Added global review instructions to CodeRabbit configuration to limit reviews to issue/PR scope and prevent scope creep [#1373]
Expand Down