fix: ponytail audit — remove ~330 lines of redundant code#30
Merged
Conversation
- lib: add err(), --api-version param to gh_api() - close-archived-alerts: collapse 3 close_*_alerts() into 1 generic close_alerts(); replace hand-rolled pagination with gh_api_paginate - copilot-report: collapse _copilot_api() 30→3 lines using --api-version; remove info()/warn() pass-through aliases - repo-permissions-report: remove info() pass-through alias - dockerfile-discovery: delete dead gh_api_link() + RESPONSE_LINK global; remove vestigial print_* redefines; inline check_prerequisites() - get-public-repos: inline check_prerequisites(); drop no-op print_error override - 7 pagination scripts: remove local get_repo_pagination() wrappers, use lib get_repo_page_count() directly - organize-stars: replace 7-line command check loop with require_command - archive-old-repos: inline validate_environment(); move local declarations to assignment site; drop stale comments - auto-repo-creation: merge add_teams_to_repo + add_repo_owners_to_repo into single add_team_to_repo with permission param - docs: update AGENTS.md and copilot-instructions.md with err(), --api-version, correct pagination example, and fill blank shared-library section Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Summary
Third-pass complexity reduction across the codebase (~330 lines removed net).
Changes
lib/github-common.sherr()helper (print_error+exit 1in one call)--api-version VERSIONoptional param togh_api()github-close-archived-repo-security-alertsclose_*_alerts()functions (~165 lines) into 1 genericclose_alerts()(~55 lines)mapfile + gh_api_paginategithub-copilot-report_copilot_api()from 30 lines to 3 using--api-version 2026-03-10info()/warn()pass-through aliases; replace call sites withprint_status/print_warningerr()(now from lib)github-repo-permissions-reportinfo()pass-through aliaserr()(now from lib)github-dockerfile-discoverygh_api_link()function +RESPONSE_LINKglobal (~40 lines, never called)print_*stderr-redirect redefinescheck_prerequisites()github-get-public-reposcheck_prerequisites()print_erroroverride (lib already writes to stderr)7 pagination scripts (
add-repo-permissions,add-repo-collaborators-by-pattern,archive-old-repos,enable-issues,get-repo-list,migrate-internal-repos-to-private,monthly-issues-report)get_repo_pagination()/limit_repo_pagination()wrappers; useget_repo_page_countfrom lib directlygithub-organize-starscommand -vloop withrequire_command jqgithub-archive-old-reposvalidate_environment()intomain()localvars to assignment sitegithub-auto-repo-creationadd_teams_to_repo+add_repo_owners_to_repointo singleadd_team_to_repo repo team permissionDocs
AGENTS.md+copilot-instructions.md: adderr()to helpers table, document--api-versionongh_apicopilot-instructions.md: fix stale pagination example (was showing deletedget_repo_pagination()pattern); fill previously blank Shared Library section