Skip to content

[Refactor] Drop unused get_github_id wrapper orphaned by #932 #1186

Description

@Crystora

Summary

get_github_id in gittensor/utils/github_api_tools.py:321-323 is a 3-line public function with zero production callers. #932 introduced get_github_identity (which returns GitHubIdentityResult(github_id, status) so callers can distinguish transient failures from invalid auth) and migrated every production site. The wrapper has been dead code since #932 merged.

def get_github_id(token: str) -> Optional[str]:
    """Get GitHub numeric user id (as string) using a PAT."""
    return get_github_identity(token).github_id

grep -rn "get_github_id\b" gittensor/ neurons/ returns only the definition itself. The remaining references — the alias on tests/utils/test_github_api_tools.py:31 and test_get_github_id_retry_logic at lines 364-376 — duplicate retry coverage already in the sibling test_get_github_identity_marks_5xx_as_transient / _marks_rate_limit_as_transient / _marks_bad_json_as_transient tests at lines 384-440.

Motivation

Removes one public symbol from gittensor.utils.github_api_tools with no behavior change and drops a duplicated test. The wrapper creates ambiguity in code review — both get_github_id and get_github_identity return the same github_id in the success case, but only get_github_identity exposes the transient/invalid-auth distinction that #932 was designed to enforce.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrefactorCode restructuring without behavior change

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions