Skip to content

Conversation

@Mounil2005
Copy link
Contributor

@Mounil2005 Mounil2005 commented Jan 7, 2026

Description:
Chain Good First Issue assignment with mentor assignment to bypass GitHub's anti-recursion protection. Previously, mentor assignment relied on a separate workflow trigger that was blocked by GitHub's workflow-loop protection when the GFI assignment bot assigned users using GITHUB_TOKEN.

  • Update bot-gfi-assign-on-comment.js to call mentor assignment function after successful user assignment
  • Add error handling to ensure user assignment succeeds even if mentor assignment fails
  • Archive bot-mentor-assignment.yml workflow since it's now handled by the GFI assignment script
  • Add changelog entry documenting the chaining functionality

Related issue(s):

Fixes #1369

Notes for reviewer:
The implementation chains both actions within a single workflow execution, bypassing GitHub's anti-recursion protection. User assignment will always succeed, while mentor assignment failures are logged but don't affect the primary assignment flow.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@Mounil2005
Copy link
Contributor Author

TESTING IN PROGRESS

@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

Chains Good First Issue assignment with mentor assignment by invoking the mentor-assignment script immediately after a successful user assignment; adds invocation, error-tolerant logging, and changelog entry documenting the change.

Changes

Cohort / File(s) Summary
Bot GFI Assignment Chaining
.github/scripts/bot-gfi-assign-on-comment.js
Replaced strict label includes check with case-insensitive detection; after successful GFI assignment, dynamically requires and invokes bot-mentor-assignment.js, wrapped in try/catch; logs mentor chaining success or detailed error without rethrowing.
Bot Mentor Assignment API
.github/scripts/bot-mentor-assignment.js
Function signature changed to accept an optional assignee override: async ({ github, context, assignee: passedAssignee }); effective assignee resolved from passedAssignee or context.payload.assignee.
Release Documentation
CHANGELOG.md
Added Unreleased → Added bullet describing chained GFI → mentor assignment; entry appears duplicated in the diff.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHub
    participant Bot as GFI Bot
    participant Mentor as Mentor Module

    rect rgba(200,200,200,0.12)
    Note over User,GitHub: Previous flow (blocked by anti-recursion)
    User->>GitHub: Comment "/assign"
    GitHub->>Bot: Trigger GFI workflow
    Bot->>GitHub: Assign user to issue
    GitHub-xBot: ✗ further workflow triggers blocked
    Bot-xMentor: (mentor not invoked)
    end

    rect rgba(100,180,100,0.12)
    Note over Bot,Mentor: New flow (direct chaining)
    User->>GitHub: Comment "/assign"
    GitHub->>Bot: Trigger GFI workflow
    Bot->>GitHub: Assign user to issue (success)
    Bot->>Mentor: require() & invoke mentor-assignment with assigned username
    Mentor->>GitHub: Post mentor comment / assign mentor (within same process)
    Mentor-->>Bot: Return (success or error logged)
    Bot-->>GitHub: Workflow complete
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: chaining GFI assignment with mentor assignment, directly aligned with the changeset.
Linked Issues check ✅ Passed The pull request implements all core requirements from issue #1369: chaining GFI and mentor assignment in one execution, error handling to preserve user assignment, case-insensitive GFI label detection, and changelog updates.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implement chaining between GFI and mentor assignment workflows. No unrelated modifications detected beyond the stated objectives.
Description check ✅ Passed The PR description clearly explains the changes: chaining GFI assignment with mentor assignment to bypass GitHub's anti-recursion protection, including specific implementation details and error handling strategy.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89afede and 0cef440.

📒 Files selected for processing (3)
  • .github/scripts/bot-gfi-assign-on-comment.js
  • .github/workflows/archive/bot-mentor-assignment.yml
  • CHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (1)
.github/scripts/**/*.js

⚙️ CodeRabbit configuration file

.github/scripts/**/*.js: Review JavaScript scripts as long-lived automation code.

Scripts must remain:

  • Focused

  • Readable

  • Purpose-built

  • All context.payload fields MUST be validated

  • Free-form text MUST NOT be trusted

  • Dynamic code execution is prohibited

  • Avoid child_process.exec; prefer execFile if needed

  • All async operations MUST be wrapped in try/catch

  • Errors MUST include contextual metadata

  • Duplicate API calls MUST be avoided

  • Marker-based deduplication is required

  • Scripts MUST NOT assume write access

  • Permission failures MUST be handled gracefully

Files:

  • .github/scripts/bot-gfi-assign-on-comment.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
CHANGELOG.md (1)

90-90: LGTM! Changelog entry clearly documents the chaining feature.

The entry accurately describes the new functionality and correctly references issue #1369.

.github/scripts/bot-gfi-assign-on-comment.js (1)

207-221: Approve chaining approach; require() placement is correct as-is.

The error-tolerant chaining successfully achieves the PR objective of bypassing GitHub's anti-recursion protection. The require() statement is intentionally placed inside the function body to ensure the module is only loaded when needed, avoiding the recursion check at initialization—moving it to the top would reintroduce the anti-recursion issue.

Error handling is compliant with guidelines: all async operations are wrapped in try/catch, errors include contextual metadata (message, status, issueNumber, assignee), context.payload fields are properly validated with optional chaining, and the non-blocking approach preserves the user assignment success.

No changes needed.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cef440 and 02de1a5.

📒 Files selected for processing (1)
  • .github/scripts/bot-gfi-assign-on-comment.js
🧰 Additional context used
📓 Path-based instructions (1)
.github/scripts/**/*.js

⚙️ CodeRabbit configuration file

.github/scripts/**/*.js: Review JavaScript scripts as long-lived automation code.

Scripts must remain:

  • Focused

  • Readable

  • Purpose-built

  • All context.payload fields MUST be validated

  • Free-form text MUST NOT be trusted

  • Dynamic code execution is prohibited

  • Avoid child_process.exec; prefer execFile if needed

  • All async operations MUST be wrapped in try/catch

  • Errors MUST include contextual metadata

  • Duplicate API calls MUST be avoided

  • Marker-based deduplication is required

  • Scripts MUST NOT assume write access

  • Permission failures MUST be handled gracefully

Files:

  • .github/scripts/bot-gfi-assign-on-comment.js
🧬 Code graph analysis (1)
.github/scripts/bot-gfi-assign-on-comment.js (1)
.github/scripts/archive/gfi_notify_team.js (2)
  • context (42-42)
  • context (43-43)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02de1a5 and 2b2e93c.

📒 Files selected for processing (2)
  • .github/scripts/bot-gfi-assign-on-comment.js
  • .github/scripts/bot-mentor-assignment.js
🧰 Additional context used
📓 Path-based instructions (1)
.github/scripts/**/*.js

⚙️ CodeRabbit configuration file

.github/scripts/**/*.js: Review JavaScript scripts as long-lived automation code.

Scripts must remain:

  • Focused

  • Readable

  • Purpose-built

  • All context.payload fields MUST be validated

  • Free-form text MUST NOT be trusted

  • Dynamic code execution is prohibited

  • Avoid child_process.exec; prefer execFile if needed

  • All async operations MUST be wrapped in try/catch

  • Errors MUST include contextual metadata

  • Duplicate API calls MUST be avoided

  • Marker-based deduplication is required

  • Scripts MUST NOT assume write access

  • Permission failures MUST be handled gracefully

Files:

  • .github/scripts/bot-mentor-assignment.js
  • .github/scripts/bot-gfi-assign-on-comment.js
🧬 Code graph analysis (2)
.github/scripts/bot-mentor-assignment.js (1)
.github/scripts/bot-gfi-assign-on-comment.js (2)
  • context (88-88)
  • context (89-89)
.github/scripts/bot-gfi-assign-on-comment.js (2)
.github/scripts/bot-mentor-assignment.js (1)
  • context (148-148)
.github/scripts/archive/gfi_notify_team.js (2)
  • context (42-42)
  • context (43-43)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
.github/scripts/bot-mentor-assignment.js (1)

131-134: LGTM! Parameter override correctly implemented.

The function signature update and fallback logic correctly support the chaining use case:

  • Line 131: Accepts optional passedAssignee parameter via destructuring with rename
  • Line 134: Falls back to context.payload.assignee when no override is provided
  • The structure { login: string, type: string } matches what the calling code provides and what downstream validation expects (lines 136, 140, 149)

This implementation properly resolves the context staleness issue by allowing the caller to explicitly provide the freshly assigned user.

@exploreriii
Copy link
Contributor

Hi @Mounil2005
Notice your i testing comment
Note you marked this ready for review, is it please ?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b2e93c and e6af0fc.

📒 Files selected for processing (1)
  • .github/scripts/bot-gfi-assign-on-comment.js
🧰 Additional context used
📓 Path-based instructions (1)
.github/scripts/**/*.js

⚙️ CodeRabbit configuration file

.github/scripts/**/*.js: Review JavaScript scripts as long-lived automation code.

Scripts must remain:

  • Focused

  • Readable

  • Purpose-built

  • All context.payload fields MUST be validated

  • Free-form text MUST NOT be trusted

  • Dynamic code execution is prohibited

  • Avoid child_process.exec; prefer execFile if needed

  • All async operations MUST be wrapped in try/catch

  • Errors MUST include contextual metadata

  • Duplicate API calls MUST be avoided

  • Marker-based deduplication is required

  • Scripts MUST NOT assume write access

  • Permission failures MUST be handled gracefully

Files:

  • .github/scripts/bot-gfi-assign-on-comment.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
.github/scripts/bot-gfi-assign-on-comment.js (2)

34-36: LGTM: Case-insensitive label check is robust.

The implementation correctly handles case variations in label names with appropriate type checking. The some method with type guards prevents errors if label data is malformed.


207-224: The interface is correctly compatible. The bot-mentor-assignment.js script is properly designed to accept the assignee parameter (destructured as passedAssignee on line 131) and falls back to context.payload.assignee when not provided. The chaining code on lines 207-224 correctly:

  • Passes { github, context, assignee: { login: requesterUsername, type: 'User' } } matching the expected interface
  • Wraps the async operation in try/catch per coding guidelines
  • Includes contextual metadata in error logs (message, status, issueNumber, assignee)
  • Gracefully handles mentor assignment failures without breaking the GFI assignment

@Mounil2005
Copy link
Contributor Author

Hi @Mounil2005 Notice your i testing comment Note you marked this ready for review, is it please ?

Hey, I am sorry about that.
Here are the test issues, everything works fine. If you feel any test case is missed pls do let me know.
https://github.com/Mounil2005/hiero-sdk-python/issues

@exploreriii
Copy link
Contributor

Thank you for solving this !

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1386   +/-   ##
=======================================
  Coverage   92.44%   92.44%           
=======================================
  Files         139      139           
  Lines        8528     8528           
=======================================
  Hits         7884     7884           
  Misses        644      644           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@exploreriii exploreriii merged commit fa4c3ff into hiero-ledger:main Jan 7, 2026
21 checks passed
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.

[Intermediate]: Chain automatic good first issue assignment with mentor assignment

2 participants