Skip to content

fix(ci): single assignee per good first issue#1183

Merged
muddlebee merged 1 commit intoTracer-Cloud:mainfrom
muddlebee:fix/gfi-single-assignee-per-issue
May 1, 2026
Merged

fix(ci): single assignee per good first issue#1183
muddlebee merged 1 commit intoTracer-Cloud:mainfrom
muddlebee:fix/gfi-single-assignee-per-issue

Conversation

@muddlebee
Copy link
Copy Markdown
Collaborator

Context

Follow-up to #1179 (already merged). That PR added auto-assignment for eligible commenters on good first issue threads. This change tightens behavior so only the first assignee counts: if anyone is already assigned (bot or human), further eligible commenters are not added.

Changes

  • issue_already_claimed when assignees is non-empty and the commenter is not already in that list.
  • Doc comment + workflow header note; unit test test_screen_skips_when_issue_claimed_by_other.

Testing

  • pytest tests/github/test_good_first_issue_assign.py

Skip auto-assign when the issue already has any assignee (unless the
commenter is already in that list). Prevents a second new contributor
from being added after the first claim.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 1, 2026

Greptile Summary

This follow-up to #1179 tightens the good-first-issue auto-assignment script so only the first assignee (bot or human) locks an issue. screen_event_without_api now builds a set of assigned_logins in one pass, returning "already_assignee" if the commenter is already in the list and "issue_already_claimed" if any other assignee exists. The new test and updated doc comments accurately reflect the new behavior.

Confidence Score: 5/5

Safe to merge — small, well-scoped change with correct ordering logic and a targeted new test.

No P0/P1 findings. The two-step check (commenter-is-assignee, then any-assignee) is ordered correctly. The set-based rewrite is cleaner than the old loop. The new test exercises the exact path added. All remaining observations are P2 or lower.

No files require special attention.

Important Files Changed

Filename Overview
.github/scripts/good_first_issue_assign.py Adds issue_already_claimed early-exit: builds a set of assigned logins, returns "already_assignee" if the commenter is present, then "issue_already_claimed" if any other assignee exists — logic and ordering are correct.
.github/workflows/good-first-issue-assign.yml Header comment updated to reflect the new "first eligible commenter wins" semantics; no functional workflow changes.
tests/github/test_good_first_issue_assign.py Adds test_screen_skips_when_issue_claimed_by_other covering the new guard; existing tests are unchanged and still pass.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[issue_comment event] --> B{is PR thread?}
    B -- yes --> Z1[skip: comment_on_pull_request]
    B -- no --> C{issue open?}
    C -- no --> Z2[skip: issue_not_open]
    C -- yes --> D{has 'good first issue' label?}
    D -- no --> Z3[skip: not_good_first_issue]
    D -- yes --> E{commenter is Bot?}
    E -- yes --> Z4[skip: bot_commenter]
    E -- no --> F{commenter is OWNER/MEMBER/COLLABORATOR?}
    F -- yes --> Z5[skip: commenter_repo_insider]
    F -- no --> G{build assigned_logins set}
    G --> H{commenter already in set?}
    H -- yes --> Z6[skip: already_assignee]
    H -- no --> I{set non-empty?}
    I -- yes --> Z7[skip: issue_already_claimed NEW]
    I -- no --> J[fetch merged PR count via API]
    J --> K{merged PRs > 0?}
    K -- yes --> Z8[skip: has_merged_prs]
    K -- no --> L[assign & notify commenter]
Loading

Reviews (1): Last reviewed commit: "fix(ci): allow only first assignee on go..." | Re-trigger Greptile

@muddlebee muddlebee merged commit c59ecea into Tracer-Cloud:main May 1, 2026
10 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🔥 Another one. @muddlebee said "here's a PR" and maintainers said "ship it". That's how it's done.


👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome.

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.

1 participant