Skip to content

refactor: drop unused get_github_id wrapper orphaned by #932#1187

Merged
anderdc merged 2 commits into
entrius:testfrom
carlos4s:refactor/drop-unused-get-github-id-wrapper
May 14, 2026
Merged

refactor: drop unused get_github_id wrapper orphaned by #932#1187
anderdc merged 2 commits into
entrius:testfrom
carlos4s:refactor/drop-unused-get-github-id-wrapper

Conversation

@carlos4s
Copy link
Copy Markdown
Contributor

@carlos4s carlos4s commented May 12, 2026

Summary

get_github_id in gittensor/utils/github_api_tools.py:321 is a 3-line public function with no production callers. PR #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 on 2026-05-06.

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/ confirms the only match is the definition itself. The remaining references live in tests/utils/test_github_api_tools.py:31 (module-level alias) and :364-376 (test_get_github_id_retry_logic). The retry path that test exercises is already covered by the sibling test_get_github_identity_marks_5xx_as_transient / _marks_rate_limit_as_transient / _marks_bad_json_as_transient tests at :384-440, which patch requests.get at the same boundary.

This PR:

  • removes the wrapper function (3 lines + surrounding blanks)
  • removes the test alias and the duplicate retry test (21 lines)

Net: +0 / -26 lines, one fewer public symbol on gittensor.utils.github_api_tools.

Related Issues

Closes #1186.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other

Testing

  • uv run --extra dev pytest tests/utils/test_github_api_tools.py — all 88 tests pass.
  • grep -rn "get_github_id\b" gittensor/ neurons/ tests/ docs/ scripts/ — returns no hits after the change.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

@xiao-xiao-mao xiao-xiao-mao Bot added the refactor Code restructuring without behavior change label May 12, 2026
@carlos4s carlos4s force-pushed the refactor/drop-unused-get-github-id-wrapper branch from b074eda to 38547c7 Compare May 13, 2026 12:38
@carlos4s carlos4s force-pushed the refactor/drop-unused-get-github-id-wrapper branch from 5a7db36 to 9ecdd30 Compare May 13, 2026 12:45
@anderdc anderdc merged commit 47d2651 into entrius:test May 14, 2026
3 checks passed
@carlos4s carlos4s deleted the refactor/drop-unused-get-github-id-wrapper branch May 14, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] Drop unused get_github_id wrapper orphaned by #932

2 participants