chore: remove unused open_github_url/_StripAuthOnRedirect from _github_http.py#2883
Open
jawwad-ali wants to merge 1 commit into
Open
chore: remove unused open_github_url/_StripAuthOnRedirect from _github_http.py#2883jawwad-ali wants to merge 1 commit into
jawwad-ali wants to merge 1 commit into
Conversation
…b_http.py open_github_url() was orphaned when github#2393 moved download authentication to the config-driven registry in authentication/http.py; its dedicated _StripAuthOnRedirect handler was referenced only by open_github_url itself and duplicated the live implementation in authentication/http.py. Remove both, keep the live resolve_github_release_asset_api_url() and the tested build_github_request()/GITHUB_HOSTS utilities, and update the module docstring to match what the module does today. No runtime behavior change. Closes github#2876 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2876
Description
Removes the two helpers in
src/specify_cli/_github_http.pythat have no callers anywhere in the repo (production, tests, docs, templates, or workflows):open_github_url()— orphaned when feat: Config-driven opt-in authentication registry with multi-platform support #2393 moved download authentication to the config-driven registry inauthentication/http.py. Its only remaining reference was its own definition._StripAuthOnRedirect(the_github_httpcopy) — referenced only byopen_github_url()itself, and a duplicate of the live redirect/strip-auth implementation inspecify_cli/authentication/http.py(a separate class taking ahoststuple, covered bytests/test_authentication.py::TestRedirectStripping), which is untouched.No runtime behavior change — dead-code removal only.
resolve_github_release_asset_api_url()(used byextensions.py,presets.py, and__init__.py) is retained with all 8 of its tests, and the module docstring is updated to describe what the module does today.Caller-sweep evidence (string-literal,
getattr, and__all__dynamic patterns also checked — zero matches):Decision on
build_github_request()/GITHUB_HOSTS(acceptance criterion 3): kept as a tested, self-contained utility (11 passing tests intests/test_github_http.py). That keeps this PR to a single source file with zero test-file changes. Happy to remove them here or in a follow-up if maintainers prefer.Note on #2442: that open PR currently extends
open_github_url, but #2876 was filed by #2442's own author after narrowing that work, asking for these symbols' removal — the corresponding hunks can be dropped from #2442 on its next rebase.Testing
uv run specify --help(exit 0)uv sync && uv run pytestDetails (Windows 11, Python 3.12.12):
uvx ruff check src/— All checks passeduv run pytest tests/test_github_http.py tests/test_authentication.py -q— 100 passed, 1 skippeduv run pytest— 3474 passed, 160 skipped, 14 failed; counts identical to cleanmainon the same host. The 14 failures are pre-existing environment-only failures (os.symlink→WinError 1314; symlink creation requires elevation/Developer Mode on Windows), unrelated to this change and not touching_github_http.py.AI Disclosure
This PR was developed with Claude Code (Claude Opus 4.8) under my direction — the caller-sweep analysis, the code removal, the local verification runs quoted above, and this description. I reviewed the diff and the evidence before submission. If any of my review responses are AI-assisted, I will disclose that in the thread as well.