zed-industries/zed · error · RuntimeError

No assignment event for {assignee} on issue #{issue_number}

Error message

No assignment event for {assignee} on issue #{issue_number}

What it means

latest_assignment_time paginates the issue's REST timeline (100 per page, all pages) and collects events where event == "assigned" and assignee.login equals the passed login. If none match it raises, because callers need that timestamp for staleness math. The comparison is exact, so the usual cause is that the login passed is not the login GitHub recorded on the event — or the event genuinely does not exist (migrated/old issues, unusual assignment paths).

Source

Thrown at script/github-guild-board.py:183

def issue_comments(issue_number):
    return github_rest_get_paginated(
        f"repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue_number}/comments"
    )


def latest_assignment_time(issue_number, assignee):
    events = github_rest_get_paginated(
        f"repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue_number}/timeline"
    )
    times = [
        parse_dt(event["created_at"])
        for event in events
        if event.get("event") == "assigned"
        and (event.get("assignee") or {}).get("login") == assignee
    ]
    if not times:
        raise RuntimeError(
            f"No assignment event for {assignee} on issue #{issue_number}"
        )
    return max(times)


def issue_closing_prs(issue_node_id, include_closed_prs=False):
    # Caps at the first 20 closing PRs: callers only test presence or scan for a
    # single guild-authored merge, so an issue exceeding this bound is not worth
    # paginating.
    data = github_graphql(
        """
        query($issueId: ID!, $includeClosedPrs: Boolean!) {
          node(id: $issueId) {
            ... on Issue {
              closedByPullRequestsReferences(first: 20, includeClosedPrs: $includeClosedPrs) {
                nodes { merged author { login } }
              }
            }

View on GitHub (pinned to bc538def45)

Solutions

  1. Compare the passed assignee against the issue's assignees[].login from the API (exact, case-sensitive) before calling
  2. Dump the timeline for that issue and check which login the assigned events actually recorded
  3. Fall back to another timestamp (issue updated_at) when no event exists, if the staleness rules permit
  4. For bot-mediated assignment, accept either the bot slug or the effective user login

Example fix

// before
if not times:
    raise RuntimeError(f"No assignment event for {assignee} on issue #{issue_number}")
return max(times)

// after
if not times:
    # Migrated issues and bot-assigned ones can lack a matching timeline event;
    # updated_at is the closest safe proxy for when the issue last changed hands.
    return parse_dt(issue["updated_at"])
return max(times)
Defensive patterns

Strategy: fallback

Validate before calling

def issue_has_assignee_with_login(issue: dict, login: str) -> bool:
    return any(a.get("login") == login for a in issue.get("assignees", []))

Type guard

def timeline_has_assigned_event(events: list, login: str) -> bool:
    return any(
        e.get("event") == "assigned" and (e.get("assignee") or {}).get("login") == login
        for e in events
    )

Try / catch

try:
    assigned_at = latest_assignment_time(issue_number, assignee)
except RuntimeError:
    # No timeline event (migrated issue, bot assignment, deleted account):
    # fall back to the issue's last update time for staleness math.
    assigned_at = parse_dt(issue["updated_at"])

Prevention

When it happens

Trigger: GET /repos/{owner}/{repo}/issues/{n}/timeline returns no matching event: the assignee argument is a bot/app slug or differs in case from the user login; the issue's assignee was set without an assigned timeline event (imported/migrated repos); the assignee account was deleted so event.assignee is None; the issue passed actually has no assignee events at all.

Common situations: Automation passes a member handle or display name that differs from the GitHub login; issues imported from another tracker without timeline history; renames of user accounts breaking old event logins; race where the issue is queried before the assignment event is indexed.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/6f5ef431c830a7a9. Report an issue: GitHub.