From b27f48ac4343bb25e4cf8bb3f281059b22e2b282 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 19:04:36 +0000 Subject: [PATCH 01/13] feat: auto assign for GFIs Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/scripts/bot-gfi-assign-on-comment.js | 98 +++++++++++++++++++ .../workflows/bot-gfi-assign-on-comment.yml | 38 +++++++ 2 files changed, 136 insertions(+) create mode 100644 .github/scripts/bot-gfi-assign-on-comment.js create mode 100644 .github/workflows/bot-gfi-assign-on-comment.yml diff --git a/.github/scripts/bot-gfi-assign-on-comment.js b/.github/scripts/bot-gfi-assign-on-comment.js new file mode 100644 index 000000000..14d0bbf07 --- /dev/null +++ b/.github/scripts/bot-gfi-assign-on-comment.js @@ -0,0 +1,98 @@ +// .github/scripts/gfi_assign_on_comment.js +// +// Assigns human user to Good First Issue when they comment "/assign". +// Posts a comment if the issue is already assigned. +// All other validation and additional GFI comments are handled by other existing bots which can be refactored with time. + +const GOOD_FIRST_ISSUE_LABEL = 'Good First Issue'; +const UNASSIGNED_GFI_SEARCH_URL = + 'https://github.com/hiero-ledger/hiero-sdk-python/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Good%20First%20Issue%22%20no%3Aassignee'; + +/// HELPERS FOR ASSIGNING /// + +/** + * Returns true if /assign appears at the start of a line or comment + * Optionally preceded or followed by whitespace + */ +function commentRequestsAssignment(body) { + return typeof body === 'string' && + /(^|\n)\s*\/assign(\s|$)/i.test(body); +} + +/** + * Returns true if the issue has the good first issue label. + */ +function issueIsGoodFirstIssue(issue) { + return issue?.labels?.some(label => label.name === GOOD_FIRST_ISSUE_LABEL); +} + +/// HELPERS FOR COMMENTING /// + +/** + * Returns a formatted @username for the current assignee of the issue. + */ +function getCurrentAssigneeMention(issue) { + const login = issue?.assignees?.[0]?.login; + return login ? `@${login}` : 'someone'; +} + +/** + * Builds a comment explaining that the issue is already assigned. + * Requester username is passed from main + */ +function commentAlreadyAssigned(requesterUsername, issue) { + return ( + `Hi @${requesterUsername} — this issue is already assigned to ${getCurrentAssigneeMention(issue)}, so I can’t assign it again. + +👉 **Choose a different Good First Issue to work on next:** +[Browse unassigned Good First Issues](${UNASSIGNED_GFI_SEARCH_URL}) + +Once you find one you like, comment \`/assign\` to get started.` + ); +} + + +/// START OF SCRIPT /// +module.exports = async ({ github, context }) => { + const { issue, comment } = context.payload; + const { owner, repo } = context.repo; + + // Reject if issue, comment or comment user is missing, reject bots, or if no /assign message + if ( + !issue?.number || + !comment?.body || + !comment?.user?.login || + comment.user.type === 'Bot' || + !commentRequestsAssignment(comment.body) + ) { + return; + } + // Reject if issue is not a Good First Issue + if (!issueIsGoodFirstIssue(issue)) return; + + // Get requester username and issue number to enable comments and assignments + const requesterUsername = comment.user.login; + const issueNumber = issue.number; + + // Reject if issue is already assigned + // Comment failure to the requester + if (issue.assignees?.length > 0) { + await github.rest.issues.createComment({ + owner, + repo, + issue_number: issueNumber, + body: commentAlreadyAssigned(requesterUsername, issue), + }); + return; + } + + // All validations passed and user has requested assignment on a GFI + // Assign the issue to the requester + // Do not comment on success + await github.rest.issues.addAssignees({ + owner, + repo, + issue_number: issueNumber, + assignees: [requesterUsername], + }); +}; diff --git a/.github/workflows/bot-gfi-assign-on-comment.yml b/.github/workflows/bot-gfi-assign-on-comment.yml new file mode 100644 index 000000000..3bd35dbb6 --- /dev/null +++ b/.github/workflows/bot-gfi-assign-on-comment.yml @@ -0,0 +1,38 @@ +name: GFI Assign on /assign + +on: + issue_comment: + types: + - created + +permissions: + issues: write + contents: read + +jobs: + gfi-assign: + # Only run on issue comments (not PR comments) + if: github.event.issue.pull_request == null + + runs-on: ubuntu-latest + + # Prevent race conditions: always wait for the first assignment request to finish processing + concurrency: + group: gfi-assign-${{ github.event.issue.number }} + cancel-in-progress: false + + steps: + - name: Harden runner + uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 + with: + egress-policy: audit + + - name: Checkout repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + + - name: Run GFI /assign handler + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd #v8.0.0 + with: + script: | + const script = require('./.github/scripts/bot-gfi-assign-on-comment.js'); + await script({ github, context }); From 84baa9244dcf022594734b37b925f4416dc1d68a Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 19:05:14 +0000 Subject: [PATCH 02/13] chore: changelog entry Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e6dc52a8..7b658bfff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1. ## [Unreleased] ### Added +- Enable auto assignment to good first issues (#1312) - Added unit test for 'endpoint.py' to increase coverage. - Automated assignment guard for `advanced` issues; requires completion of at least one `good first issue` and one `intermediate` issue before assignment (exempts maintainers, committers, and triage members). (#1142) - Added Hbar object support for TransferTransaction HBAR transfers: From 4d3c0468c7b6dbccb863d616e315549f0901a220 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 19:26:28 +0000 Subject: [PATCH 03/13] chore: add logs for debugging Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/scripts/bot-gfi-assign-on-comment.js | 82 +++++++++++++++++--- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/.github/scripts/bot-gfi-assign-on-comment.js b/.github/scripts/bot-gfi-assign-on-comment.js index 14d0bbf07..1242e598f 100644 --- a/.github/scripts/bot-gfi-assign-on-comment.js +++ b/.github/scripts/bot-gfi-assign-on-comment.js @@ -15,17 +15,33 @@ const UNASSIGNED_GFI_SEARCH_URL = * Optionally preceded or followed by whitespace */ function commentRequestsAssignment(body) { - return typeof body === 'string' && + const matches = + typeof body === 'string' && /(^|\n)\s*\/assign(\s|$)/i.test(body); + + console.log('[gfi-assign] commentRequestsAssignment:', { + body, + matches, + }); + + return matches; } /** * Returns true if the issue has the good first issue label. */ function issueIsGoodFirstIssue(issue) { - return issue?.labels?.some(label => label.name === GOOD_FIRST_ISSUE_LABEL); -} + const labels = issue?.labels?.map(label => label.name) ?? []; + const isGfi = labels.includes(GOOD_FIRST_ISSUE_LABEL); + console.log('[gfi-assign] issueIsGoodFirstIssue:', { + labels, + expected: GOOD_FIRST_ISSUE_LABEL, + isGfi, + }); + + return isGfi; +} /// HELPERS FOR COMMENTING /// /** @@ -54,38 +70,78 @@ Once you find one you like, comment \`/assign\` to get started.` /// START OF SCRIPT /// module.exports = async ({ github, context }) => { + const { issue, comment } = context.payload; const { owner, repo } = context.repo; + console.log('[gfi-assign] Payload snapshot:', { + issueNumber: issue?.number, + commenter: comment?.user?.login, + commenterType: comment?.user?.type, + commentBody: comment?.body, + }); + // Reject if issue, comment or comment user is missing, reject bots, or if no /assign message - if ( - !issue?.number || - !comment?.body || - !comment?.user?.login || - comment.user.type === 'Bot' || - !commentRequestsAssignment(comment.body) - ) { + if (!issue?.number) { + console.log('[gfi-assign] Exit: missing issue number'); + return; + } + + if (!comment?.body) { + console.log('[gfi-assign] Exit: missing comment body'); + return; + } + + if (!comment?.user?.login) { + console.log('[gfi-assign] Exit: missing comment user login'); return; } + + if (comment.user.type === 'Bot') { + console.log('[gfi-assign] Exit: comment authored by bot'); + return; + } + + if (!commentRequestsAssignment(comment.body)) { + console.log('[gfi-assign] Exit: comment does not request assignment'); + return; + } + + console.log('[gfi-assign] Assignment command detected'); + // Reject if issue is not a Good First Issue - if (!issueIsGoodFirstIssue(issue)) return; + if (!issueIsGoodFirstIssue(issue)) { + console.log('[gfi-assign] Exit: issue is not a Good First Issue'); + return; + } + + console.log('[gfi-assign] Issue is labeled Good First Issue'); // Get requester username and issue number to enable comments and assignments const requesterUsername = comment.user.login; const issueNumber = issue.number; + console.log('[gfi-assign] Requester:', requesterUsername); + console.log('[gfi-assign] Current assignees:', issue.assignees?.map(a => a.login)); + // Reject if issue is already assigned // Comment failure to the requester if (issue.assignees?.length > 0) { + console.log('[gfi-assign] Exit: issue already assigned'); + await github.rest.issues.createComment({ owner, repo, issue_number: issueNumber, body: commentAlreadyAssigned(requesterUsername, issue), }); + + console.log('[gfi-assign] Posted already-assigned comment'); return; } + console.log('[gfi-assign] Assigning issue to requester'); + // All validations passed and user has requested assignment on a GFI // Assign the issue to the requester // Do not comment on success @@ -95,4 +151,6 @@ module.exports = async ({ github, context }) => { issue_number: issueNumber, assignees: [requesterUsername], }); -}; + + console.log('[gfi-assign] Assignment completed successfully'); +}; \ No newline at end of file From 9ea2c4b64dd573f9028097333382535658c69a26 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 19:31:25 +0000 Subject: [PATCH 04/13] fix: loosening the regex Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/scripts/bot-gfi-assign-on-comment.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/scripts/bot-gfi-assign-on-comment.js b/.github/scripts/bot-gfi-assign-on-comment.js index 1242e598f..f96cac042 100644 --- a/.github/scripts/bot-gfi-assign-on-comment.js +++ b/.github/scripts/bot-gfi-assign-on-comment.js @@ -11,13 +11,12 @@ const UNASSIGNED_GFI_SEARCH_URL = /// HELPERS FOR ASSIGNING /// /** - * Returns true if /assign appears at the start of a line or comment - * Optionally preceded or followed by whitespace + * Returns true if /assign appears in comment */ function commentRequestsAssignment(body) { const matches = typeof body === 'string' && - /(^|\n)\s*\/assign(\s|$)/i.test(body); + /\b\/assign\b/i.test(body); console.log('[gfi-assign] commentRequestsAssignment:', { body, From 849383195d2204c7937588042f735a9d6736c941 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 19:44:12 +0000 Subject: [PATCH 05/13] fix: the regex Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/scripts/bot-gfi-assign-on-comment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/bot-gfi-assign-on-comment.js b/.github/scripts/bot-gfi-assign-on-comment.js index f96cac042..d5cfb4962 100644 --- a/.github/scripts/bot-gfi-assign-on-comment.js +++ b/.github/scripts/bot-gfi-assign-on-comment.js @@ -11,12 +11,12 @@ const UNASSIGNED_GFI_SEARCH_URL = /// HELPERS FOR ASSIGNING /// /** - * Returns true if /assign appears in comment + * Returns true if /assign appears as a standalone command in the comment */ function commentRequestsAssignment(body) { const matches = typeof body === 'string' && - /\b\/assign\b/i.test(body); + /(^|\s)\/assign(\s|$)/i.test(body); console.log('[gfi-assign] commentRequestsAssignment:', { body, From faf4567d743d6f7330d4d996851bf559a8a789c5 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:11:35 +0000 Subject: [PATCH 06/13] chore: assignment to templates Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .../01_good_first_issue_candidate.yml | 5 +++-- .github/ISSUE_TEMPLATE/04_good_first_issue.yml | 4 +++- .../training/workflow/04_assigning_issues.md | 14 ++++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml b/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml index 7d42838ee..75f79894d 100644 --- a/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml +++ b/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml @@ -237,6 +237,7 @@ body: EDIT OR EXPAND THE CHECKLIST ON WHAT IS REQUIRED TO BE ABLE TO MERGE A PULL REQUEST FOR THIS ISSUE value: | To be able to merge a pull request for this issue, we need: + - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md)) - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)) - [ ] **All Tests Pass:** our workflow checks like unit and integration tests must pass @@ -253,14 +254,14 @@ body: value: | If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. - - [ ] **Claim this issue:** Comment below that you are interested in working on the issue. Without assignment, your pull requests might be closed and the issue given to another developer. - - [ ] **Wait for assignment:** A community member with the given rights will add you as an assignee of the issue + - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) - [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **Add a Changelog Entry :** your pull request will require a changelog. Read [Changelog Entry Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) to learn how. - [ ] **Push and Create a Pull Request :** Once your issue is resolved, and your commits are signed, and you have a changelog entry, push your changes and create a pull request. Detailed instructions can be found at [Submit PR Training](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/11_submit_pull_request.md), part of [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **You did it 🎉:** A maintainer or committer will review your pull request and provide feedback. If approved, we will merge the fix in the main branch. Thanks for being part of the Hiero community as an open-source contributor ❤️ + ***IMPORTANT*** You will ONLY be assigned to the issue if you comment: \assign ***IMPORTANT*** Your pull request CANNOT BE MERGED until you add a changelog entry AND sign your commits each with `git commit -S -s -m "chore: your commit message"` with a GPG key setup. validations: required: true diff --git a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml index 320c370f7..8a0d4deeb 100644 --- a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml +++ b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml @@ -229,6 +229,7 @@ body: EDIT OR EXPAND THE CHECKLIST ON WHAT IS REQUIRED TO BE ABLE TO MERGE A PULL REQUEST FOR THIS ISSUE value: | To be able to merge a pull request for this issue, we need: + - [ ] **Assignment:** You must be assigned to the issue, comment: "\assign" in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md)) - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)) - [ ] **All Tests Pass:** our workflow checks like unit and integration tests must pass @@ -245,7 +246,7 @@ body: value: | If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. - - [ ] **Claim this issue:** Comment below that you are interested in working on the issue. Without assignment, your pull requests might be closed and the issue given to another developer. + - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) - [ ] **Wait for assignment:** A community member with the given rights will add you as an assignee of the issue - [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) @@ -253,6 +254,7 @@ body: - [ ] **Push and Create a Pull Request :** Once your issue is resolved, and your commits are signed, and you have a changelog entry, push your changes and create a pull request. Detailed instructions can be found at [Submit PR Training](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/11_submit_pull_request.md), part of [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **You did it 🎉:** A maintainer or committer will review your pull request and provide feedback. If approved, we will merge the fix in the main branch. Thanks for being part of the Hiero community as an open-source contributor ❤️ + ***IMPORTANT*** You will ONLY be assigned to the issue if you comment: \assign ***IMPORTANT*** Your pull request CANNOT BE MERGED until you add a changelog entry AND sign your commits each with `git commit -S -s -m "chore: your commit message"` with a GPG key setup. validations: required: true diff --git a/docs/sdk_developers/training/workflow/04_assigning_issues.md b/docs/sdk_developers/training/workflow/04_assigning_issues.md index b7cc6cbe3..c2859246e 100644 --- a/docs/sdk_developers/training/workflow/04_assigning_issues.md +++ b/docs/sdk_developers/training/workflow/04_assigning_issues.md @@ -1,12 +1,14 @@ ## Getting Assigned to an Issue -It is important to be assigned an issue before starting work on it or creating a pull request. +Claim an issue as yours to work on by commenting on a good first issue with exactly: \assign We recommend Good First Issues for developers new to the Python SDK. These are easier and better documented tasks. -To do that, -1. Select a `Good First Issue` that interests you and is not yet assigned at [Python SDK Issues](https://github.com/hiero-ledger/hiero-sdk-python/issues) -2. Write a comment at the bottom of the issue page asking "I want to be assigned to this issue" -3. A maintainer will shortly assign you to the issue +Key steps: +1. Find an available `Good First Issue` that interests you and is not yet assigned at [Python SDK Good First Issues](https://github.com/hiero-ledger/hiero-sdk-python/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Good%20First%20Issue%22%20no%3Aassignee) +2. Write a comment replying to the issue with: \assign +3. You'll be automatically assigned -Congratulations! You are assigned and can now get started on the work. +Congratulations! You have claimed the issue and can now get started on the work. + +Intermediate and advanced issues require team approval to be assigned. From 7a0b93fc5cccacd3f4f8ee3f740b304d71501484 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:19:52 +0000 Subject: [PATCH 07/13] chore: add assign reminder feature Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/scripts/bot-gfi-assign-on-comment.js | 49 ++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.github/scripts/bot-gfi-assign-on-comment.js b/.github/scripts/bot-gfi-assign-on-comment.js index d5cfb4962..299a036c8 100644 --- a/.github/scripts/bot-gfi-assign-on-comment.js +++ b/.github/scripts/bot-gfi-assign-on-comment.js @@ -66,6 +66,21 @@ Once you find one you like, comment \`/assign\` to get started.` ); } +// HELPERS FOR PEOPLE THAT WANT TO BE ASSIGNED BUT DID NOT READ INSTRUCTIONS +const ASSIGN_REMINDER_MARKER = ''; + +function buildAssignReminder(username) { + return `${ASSIGN_REMINDER_MARKER} +👋 Hi @${username}! + +If you’d like to work on this **Good First Issue**, just comment: + +\`\`\` +/assign +\`\`\` + +and you’ll be automatically assigned. Feel free to ask questions here if anything is unclear!`; +} /// START OF SCRIPT /// module.exports = async ({ github, context }) => { @@ -102,6 +117,40 @@ module.exports = async ({ github, context }) => { } if (!commentRequestsAssignment(comment.body)) { + // Only remind if: + // - GFI + // - unassigned + // - reminder not already posted + if ( + issueIsGoodFirstIssue(issue) && + !issue.assignees?.length + ) { + const comments = await github.paginate( + github.rest.issues.listComments, + { + owner, + repo, + issue_number: issue.number, + per_page: 100, + } + ); + + const reminderAlreadyPosted = comments.some(c => + c.body?.includes(ASSIGN_REMINDER_MARKER) + ); + + if (!reminderAlreadyPosted) { + await github.rest.issues.createComment({ + owner, + repo, + issue_number: issue.number, + body: buildAssignReminder(comment.user.login), + }); + + console.log('[gfi-assign] Posted /assign reminder'); + } + } + console.log('[gfi-assign] Exit: comment does not request assignment'); return; } From 0ce176d69a9600ca747b3a23da8b4b4d29ccd6e1 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:25:01 +0000 Subject: [PATCH 08/13] chore: archive unused bu useful workflow Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/scripts/{ => archive}/gfi_notify_team.js | 1 + .github/workflows/{ => archive}/bot-gfi-notify-team.yml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) rename .github/scripts/{ => archive}/gfi_notify_team.js (98%) rename .github/workflows/{ => archive}/bot-gfi-notify-team.yml (95%) diff --git a/.github/scripts/gfi_notify_team.js b/.github/scripts/archive/gfi_notify_team.js similarity index 98% rename from .github/scripts/gfi_notify_team.js rename to .github/scripts/archive/gfi_notify_team.js index 2acb73720..5711893ef 100644 --- a/.github/scripts/gfi_notify_team.js +++ b/.github/scripts/archive/gfi_notify_team.js @@ -1,4 +1,5 @@ // Script to notify the team when a GFI issue receives its first human comment. +// Replaced by automatic GFI assignment const marker = ''; const TEAM_ALIAS = '@hiero-ledger/hiero-sdk-good-first-issue-support'; diff --git a/.github/workflows/bot-gfi-notify-team.yml b/.github/workflows/archive/bot-gfi-notify-team.yml similarity index 95% rename from .github/workflows/bot-gfi-notify-team.yml rename to .github/workflows/archive/bot-gfi-notify-team.yml index 2ed9dcf86..4f06782a0 100644 --- a/.github/workflows/bot-gfi-notify-team.yml +++ b/.github/workflows/archive/bot-gfi-notify-team.yml @@ -19,11 +19,10 @@ jobs: 'Good First Issue' ) - concurrency: group: gfi-notify-issue-${{ github.event.issue.number }} cancel-in-progress: false - + steps: - name: Harden the runner uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 @@ -40,4 +39,4 @@ jobs: with: script: | const script = require('./.github/scripts/gfi_notify_team.js'); - await script({ github, context}); \ No newline at end of file + await script({ github, context}); From 88a48ff0f4011c02e32ab7f4a8457c10f01d9e22 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:31:33 +0000 Subject: [PATCH 09/13] fix: URLs Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml | 8 ++++---- .github/ISSUE_TEMPLATE/04_good_first_issue.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml b/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml index 75f79894d..25a37dc8c 100644 --- a/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml +++ b/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml @@ -237,9 +237,9 @@ body: EDIT OR EXPAND THE CHECKLIST ON WHAT IS REQUIRED TO BE ABLE TO MERGE A PULL REQUEST FOR THIS ISSUE value: | To be able to merge a pull request for this issue, we need: - - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) - - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md)) - - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)) + - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) + - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) + - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **All Tests Pass:** our workflow checks like unit and integration tests must pass - [ ] **Issue is Solved:** The implementation fully addresses the issue requirements as described above - [ ] **No Further Changes are Made:** Code review feedback has been addressed and no further changes are requested @@ -254,7 +254,7 @@ body: value: | If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. - - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) + - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) - [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **Add a Changelog Entry :** your pull request will require a changelog. Read [Changelog Entry Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) to learn how. diff --git a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml index 8a0d4deeb..c06578346 100644 --- a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml +++ b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml @@ -229,9 +229,9 @@ body: EDIT OR EXPAND THE CHECKLIST ON WHAT IS REQUIRED TO BE ABLE TO MERGE A PULL REQUEST FOR THIS ISSUE value: | To be able to merge a pull request for this issue, we need: - - [ ] **Assignment:** You must be assigned to the issue, comment: "\assign" in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) - - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md)) - - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md)) + - [ ] **Assignment:** You must be assigned to the issue, comment: "\assign" in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) + - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) + - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **All Tests Pass:** our workflow checks like unit and integration tests must pass - [ ] **Issue is Solved:** The implementation fully addresses the issue requirements as described above - [ ] **No Further Changes are Made:** Code review feedback has been addressed and no further changes are requested @@ -246,7 +246,7 @@ body: value: | If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. - - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md)) + - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) - [ ] **Wait for assignment:** A community member with the given rights will add you as an assignee of the issue - [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) From 8fe6b17aa227c51948f347b063f67c67df537eb1 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:45:19 +0000 Subject: [PATCH 10/13] chore: changelog entry Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b658bfff..5b5808633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1. ## [Unreleased] ### Added -- Enable auto assignment to good first issues (#1312) +- Enable auto assignment to good first issues (#1312), archived good first issue support team notification. Changed templates with new assign instruction. - Added unit test for 'endpoint.py' to increase coverage. - Automated assignment guard for `advanced` issues; requires completion of at least one `good first issue` and one `intermediate` issue before assignment (exempts maintainers, committers, and triage members). (#1142) - Added Hbar object support for TransferTransaction HBAR transfers: From d93a8f5108d9858efdcdb08dacbcdbb585e99359 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 20:49:44 +0000 Subject: [PATCH 11/13] fix: remove reundant wait for assignment instruction Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/04_good_first_issue.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml index c06578346..f5dd98b5e 100644 --- a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml +++ b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml @@ -247,7 +247,6 @@ body: If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) - - [ ] **Wait for assignment:** A community member with the given rights will add you as an assignee of the issue - [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **Add a Changelog Entry :** your pull request will require a changelog. Read [Changelog Entry Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) to learn how. From 3ebe6ddb32df06214ac7abe220ef8e7eafd5f264 Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 21:06:03 +0000 Subject: [PATCH 12/13] fix: formatting fails Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .../ISSUE_TEMPLATE/01_good_first_issue_candidate.yml | 10 +++++----- .github/ISSUE_TEMPLATE/04_good_first_issue.yml | 10 +++++----- .github/scripts/bot-gfi-assign-on-comment.js | 2 +- .../training/workflow/04_assigning_issues.md | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml b/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml index 25a37dc8c..32cc9461f 100644 --- a/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml +++ b/.github/ISSUE_TEMPLATE/01_good_first_issue_candidate.yml @@ -237,9 +237,9 @@ body: EDIT OR EXPAND THE CHECKLIST ON WHAT IS REQUIRED TO BE ABLE TO MERGE A PULL REQUEST FOR THIS ISSUE value: | To be able to merge a pull request for this issue, we need: - - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) - - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) - - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) + - [ ] **Assignment:** You must be assigned to the issue, comment: `/assign` in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) + - [ ] **Changelog Entry:** Correct changelog entry [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) + - [ ] **Signed commits:** commits must be DCO and GPG key signed [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **All Tests Pass:** our workflow checks like unit and integration tests must pass - [ ] **Issue is Solved:** The implementation fully addresses the issue requirements as described above - [ ] **No Further Changes are Made:** Code review feedback has been addressed and no further changes are requested @@ -254,14 +254,14 @@ body: value: | If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. - - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) + - [ ] **Assignment:** You must be assigned to the issue, comment: `/assign` in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) - [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **Add a Changelog Entry :** your pull request will require a changelog. Read [Changelog Entry Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) to learn how. - [ ] **Push and Create a Pull Request :** Once your issue is resolved, and your commits are signed, and you have a changelog entry, push your changes and create a pull request. Detailed instructions can be found at [Submit PR Training](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/11_submit_pull_request.md), part of [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **You did it 🎉:** A maintainer or committer will review your pull request and provide feedback. If approved, we will merge the fix in the main branch. Thanks for being part of the Hiero community as an open-source contributor ❤️ - ***IMPORTANT*** You will ONLY be assigned to the issue if you comment: \assign + ***IMPORTANT*** You will ONLY be assigned to the issue if you comment: `/assign` ***IMPORTANT*** Your pull request CANNOT BE MERGED until you add a changelog entry AND sign your commits each with `git commit -S -s -m "chore: your commit message"` with a GPG key setup. validations: required: true diff --git a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml index f5dd98b5e..7a836e76f 100644 --- a/.github/ISSUE_TEMPLATE/04_good_first_issue.yml +++ b/.github/ISSUE_TEMPLATE/04_good_first_issue.yml @@ -229,9 +229,9 @@ body: EDIT OR EXPAND THE CHECKLIST ON WHAT IS REQUIRED TO BE ABLE TO MERGE A PULL REQUEST FOR THIS ISSUE value: | To be able to merge a pull request for this issue, we need: - - [ ] **Assignment:** You must be assigned to the issue, comment: "\assign" in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) - - [ ] **Changelog Entry:** Correct changelog entry (please link to the documentation - [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) - - [ ] **Signed commits:** commits must be DCO and GPG key signed ([see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) + - [ ] **Assignment:** You must be assigned to the issue, comment: `/assign` in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) + - [ ] **Changelog Entry:** Correct changelog entry [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) + - [ ] **Signed commits:** commits must be DCO and GPG key signed [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **All Tests Pass:** our workflow checks like unit and integration tests must pass - [ ] **Issue is Solved:** The implementation fully addresses the issue requirements as described above - [ ] **No Further Changes are Made:** Code review feedback has been addressed and no further changes are requested @@ -246,14 +246,14 @@ body: value: | If you have never contributed to an open source project at GitHub, the following step-by-step guide will introduce you to the workflow. - - [ ] **Assignment:** You must be assigned to the issue, comment: \assign in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) + - [ ] **Assignment:** You must be assigned to the issue, comment: `/assign` in the issue to get assigned [see guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/04_assigning_issues.md) - [ ] **Fork, Branch and Work on the issue:** Create a copy of the repository, create a branch for the issue and solve the problem. For instructions, please read our [Contributing guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) file. Further help can be found at [Set-up Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/setup) and [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **DCO and GPG key sign each commit :** each commit must be -s and -S signed. An explanation on how to do this is at [Signing Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/signing.md) - [ ] **Add a Changelog Entry :** your pull request will require a changelog. Read [Changelog Entry Guide](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/changelog_entry.md) to learn how. - [ ] **Push and Create a Pull Request :** Once your issue is resolved, and your commits are signed, and you have a changelog entry, push your changes and create a pull request. Detailed instructions can be found at [Submit PR Training](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/docs/sdk_developers/training/workflow/11_submit_pull_request.md), part of [Workflow Training](https://github.com/hiero-ledger/hiero-sdk-python/tree/main/docs/sdk_developers/training/workflow). - [ ] **You did it 🎉:** A maintainer or committer will review your pull request and provide feedback. If approved, we will merge the fix in the main branch. Thanks for being part of the Hiero community as an open-source contributor ❤️ - ***IMPORTANT*** You will ONLY be assigned to the issue if you comment: \assign + ***IMPORTANT*** You will ONLY be assigned to the issue if you comment: `/assign` ***IMPORTANT*** Your pull request CANNOT BE MERGED until you add a changelog entry AND sign your commits each with `git commit -S -s -m "chore: your commit message"` with a GPG key setup. validations: required: true diff --git a/.github/scripts/bot-gfi-assign-on-comment.js b/.github/scripts/bot-gfi-assign-on-comment.js index 299a036c8..72900e3f5 100644 --- a/.github/scripts/bot-gfi-assign-on-comment.js +++ b/.github/scripts/bot-gfi-assign-on-comment.js @@ -1,4 +1,4 @@ -// .github/scripts/gfi_assign_on_comment.js +// .github/scripts/bot-gfi_assign_on_comment.js // // Assigns human user to Good First Issue when they comment "/assign". // Posts a comment if the issue is already assigned. diff --git a/docs/sdk_developers/training/workflow/04_assigning_issues.md b/docs/sdk_developers/training/workflow/04_assigning_issues.md index c2859246e..befc6a7dc 100644 --- a/docs/sdk_developers/training/workflow/04_assigning_issues.md +++ b/docs/sdk_developers/training/workflow/04_assigning_issues.md @@ -1,12 +1,12 @@ ## Getting Assigned to an Issue -Claim an issue as yours to work on by commenting on a good first issue with exactly: \assign +Claim an issue as yours to work on by commenting on a good first issue with exactly: /assign We recommend Good First Issues for developers new to the Python SDK. These are easier and better documented tasks. Key steps: 1. Find an available `Good First Issue` that interests you and is not yet assigned at [Python SDK Good First Issues](https://github.com/hiero-ledger/hiero-sdk-python/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22Good%20First%20Issue%22%20no%3Aassignee) -2. Write a comment replying to the issue with: \assign +2. Write a comment replying to the issue with: `/assign` 3. You'll be automatically assigned Congratulations! You have claimed the issue and can now get started on the work. From bcb9373a52d882ac04656fffd35d580b3c6a7e6e Mon Sep 17 00:00:00 2001 From: exploreriii <133720349+exploreriii@users.noreply.github.com> Date: Fri, 2 Jan 2026 21:07:54 +0000 Subject: [PATCH 13/13] chore: try catch Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com> --- .github/scripts/bot-gfi-assign-on-comment.js | 195 ++++++++++--------- 1 file changed, 102 insertions(+), 93 deletions(-) diff --git a/.github/scripts/bot-gfi-assign-on-comment.js b/.github/scripts/bot-gfi-assign-on-comment.js index 72900e3f5..80f0bb361 100644 --- a/.github/scripts/bot-gfi-assign-on-comment.js +++ b/.github/scripts/bot-gfi-assign-on-comment.js @@ -84,121 +84,130 @@ and you’ll be automatically assigned. Feel free to ask questions here if anyth /// START OF SCRIPT /// module.exports = async ({ github, context }) => { + try { + const { issue, comment } = context.payload; + const { owner, repo } = context.repo; + + console.log('[gfi-assign] Payload snapshot:', { + issueNumber: issue?.number, + commenter: comment?.user?.login, + commenterType: comment?.user?.type, + commentBody: comment?.body, + }); - const { issue, comment } = context.payload; - const { owner, repo } = context.repo; - - console.log('[gfi-assign] Payload snapshot:', { - issueNumber: issue?.number, - commenter: comment?.user?.login, - commenterType: comment?.user?.type, - commentBody: comment?.body, - }); - - // Reject if issue, comment or comment user is missing, reject bots, or if no /assign message - if (!issue?.number) { - console.log('[gfi-assign] Exit: missing issue number'); - return; - } + // Reject if issue, comment or comment user is missing, reject bots, or if no /assign message + if (!issue?.number) { + console.log('[gfi-assign] Exit: missing issue number'); + return; + } - if (!comment?.body) { - console.log('[gfi-assign] Exit: missing comment body'); - return; - } + if (!comment?.body) { + console.log('[gfi-assign] Exit: missing comment body'); + return; + } - if (!comment?.user?.login) { - console.log('[gfi-assign] Exit: missing comment user login'); - return; - } + if (!comment?.user?.login) { + console.log('[gfi-assign] Exit: missing comment user login'); + return; + } - if (comment.user.type === 'Bot') { - console.log('[gfi-assign] Exit: comment authored by bot'); - return; - } + if (comment.user.type === 'Bot') { + console.log('[gfi-assign] Exit: comment authored by bot'); + return; + } - if (!commentRequestsAssignment(comment.body)) { - // Only remind if: - // - GFI - // - unassigned - // - reminder not already posted - if ( - issueIsGoodFirstIssue(issue) && - !issue.assignees?.length - ) { - const comments = await github.paginate( - github.rest.issues.listComments, - { - owner, - repo, - issue_number: issue.number, - per_page: 100, + if (!commentRequestsAssignment(comment.body)) { + // Only remind if: + // - GFI + // - unassigned + // - reminder not already posted + if ( + issueIsGoodFirstIssue(issue) && + !issue.assignees?.length + ) { + const comments = await github.paginate( + github.rest.issues.listComments, + { + owner, + repo, + issue_number: issue.number, + per_page: 100, + } + ); + + const reminderAlreadyPosted = comments.some(c => + c.body?.includes(ASSIGN_REMINDER_MARKER) + ); + + if (!reminderAlreadyPosted) { + await github.rest.issues.createComment({ + owner, + repo, + issue_number: issue.number, + body: buildAssignReminder(comment.user.login), + }); + + console.log('[gfi-assign] Posted /assign reminder'); } - ); + } - const reminderAlreadyPosted = comments.some(c => - c.body?.includes(ASSIGN_REMINDER_MARKER) - ); + console.log('[gfi-assign] Exit: comment does not request assignment'); + return; + } - if (!reminderAlreadyPosted) { - await github.rest.issues.createComment({ - owner, - repo, - issue_number: issue.number, - body: buildAssignReminder(comment.user.login), - }); + console.log('[gfi-assign] Assignment command detected'); - console.log('[gfi-assign] Posted /assign reminder'); - } + // Reject if issue is not a Good First Issue + if (!issueIsGoodFirstIssue(issue)) { + console.log('[gfi-assign] Exit: issue is not a Good First Issue'); + return; } - console.log('[gfi-assign] Exit: comment does not request assignment'); - return; - } + console.log('[gfi-assign] Issue is labeled Good First Issue'); - console.log('[gfi-assign] Assignment command detected'); + // Get requester username and issue number to enable comments and assignments + const requesterUsername = comment.user.login; + const issueNumber = issue.number; - // Reject if issue is not a Good First Issue - if (!issueIsGoodFirstIssue(issue)) { - console.log('[gfi-assign] Exit: issue is not a Good First Issue'); - return; - } + console.log('[gfi-assign] Requester:', requesterUsername); + console.log('[gfi-assign] Current assignees:', issue.assignees?.map(a => a.login)); - console.log('[gfi-assign] Issue is labeled Good First Issue'); + // Reject if issue is already assigned + // Comment failure to the requester + if (issue.assignees?.length > 0) { + console.log('[gfi-assign] Exit: issue already assigned'); - // Get requester username and issue number to enable comments and assignments - const requesterUsername = comment.user.login; - const issueNumber = issue.number; + await github.rest.issues.createComment({ + owner, + repo, + issue_number: issueNumber, + body: commentAlreadyAssigned(requesterUsername, issue), + }); - console.log('[gfi-assign] Requester:', requesterUsername); - console.log('[gfi-assign] Current assignees:', issue.assignees?.map(a => a.login)); + console.log('[gfi-assign] Posted already-assigned comment'); + return; + } - // Reject if issue is already assigned - // Comment failure to the requester - if (issue.assignees?.length > 0) { - console.log('[gfi-assign] Exit: issue already assigned'); + console.log('[gfi-assign] Assigning issue to requester'); - await github.rest.issues.createComment({ + // All validations passed and user has requested assignment on a GFI + // Assign the issue to the requester + // Do not comment on success + await github.rest.issues.addAssignees({ owner, repo, issue_number: issueNumber, - body: commentAlreadyAssigned(requesterUsername, issue), + assignees: [requesterUsername], }); - console.log('[gfi-assign] Posted already-assigned comment'); - return; + console.log('[gfi-assign] Assignment completed successfully'); + } catch (error) { + console.error('[gfi-assign] Error:', { + message: error.message, + status: error.status, + issueNumber: context.payload.issue?.number, + commenter: context.payload.comment?.user?.login, + }); + throw error; } - - console.log('[gfi-assign] Assigning issue to requester'); - - // All validations passed and user has requested assignment on a GFI - // Assign the issue to the requester - // Do not comment on success - await github.rest.issues.addAssignees({ - owner, - repo, - issue_number: issueNumber, - assignees: [requesterUsername], - }); - - console.log('[gfi-assign] Assignment completed successfully'); }; \ No newline at end of file