Add gh-prs-fix-all: fix the threatcrush-scan PRs that are ours - #2
Merged
Conversation
Wraps `tcfeed check --fix`, which reads every open threatcrush-scan pull request and sorts the red into two piles by workflow path: ours is .github/workflows/threatcrush-scan.yml, theirs is anything else. A file here rather than a function in ~/.zsh_aliases, and that is the whole reason it exists in this repo. The moshcode pit runs its aliases with `zsh -c <command>`, and `zsh -c` is a non-interactive shell - it reads neither ~/.zshrc nor ~/.zsh_aliases. Defined as a function it answered `command not found` from the pit while the identical word worked when typed at a prompt, which is a confusing way to find out. An executable works from an interactive shell, from `zsh -c` and from the pit alike, because none of them have to have sourced anything first. Nothing is aliased to it either: a function beats PATH, so a wrapper of the same name would silently shadow this and the two would drift. Same reasoning is why it is not called gh-prs - that is already a different tool in this directory. It refuses a threatcrush checkout that predates the subcommand instead of handing it a word it does not know. tcfeed reads its first argument as a post count and falls back to 50 when it is not a number, so an older script answers `check` by fetching reddit and scanning ten strangers' repositories - a long, rate-limited and entirely wrong answer to "fix my pull requests". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`tcfeed` was a zsh function in ~/.zsh_aliases. The moshcode pit runs its aliases with `zsh -c <command>`, and `zsh -c` is a non-interactive shell that reads neither ~/.zshrc nor ~/.zsh_aliases, so `/alias tcfeed "tcfeed"` answered `command not found` while the identical word worked when typed at a prompt. This is the second time the same shape of bug landed, so the note in ~/.zsh_aliases now says not to define either name there again: a function beats PATH, so a wrapper of the same name silently shadows the real file and the two drift. The shadow is what let the broken version survive long enough to be puzzling. Behaviour is unchanged from the function - same TCFEED_REPO default, same `cd` into the repo so npx resolves tsx against its node_modules before reaching for the network, same passthrough of every argument and environment variable to bin/tcfeed.ts. `tcfeed-forget` is not carried over; `tcfeed --forget` is the same thing and one fewer name to keep working from two places. Co-Authored-By: Claude Opus 5 (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.
Wraps
tcfeed check --fix(threatcrushbin/tcfeed.ts, merged in profullstack/threatcrush#111). It reads every openthreatcrush-scanpull request and sorts the red into two piles by workflow path, not job name:.github/workflows/threatcrush-scan.yml, the file those PRs addWhy it is a file here and not a function in ~/.zsh_aliases
This is the whole reason it belongs in this repo. The moshcode pit runs its aliases with
zsh -c <command>, andzsh -cis a non-interactive shell — it reads neither~/.zshrcnor~/.zsh_aliases. Defined as a function it answeredcommand not foundfrom the pit while the identical word worked when typed at a prompt, which is a confusing way to find out:An executable works from an interactive shell, from
zsh -c, and from the pit alike, because none of them have to have sourced anything first.Nothing is aliased to it either — a function beats PATH, so a wrapper of the same name would silently shadow this one and the two would drift. Same reasoning is why it is not called
gh-prs: that is already a different tool in this directory, and the collision would not have announced itself.It refuses an out-of-date checkout
tcfeedreads its first argument as a post count and falls back to 50 when it is not a number. Handedcheckby a checkout that predates the subcommand, it would go and fetch reddit and scan ten strangers' repositories — a long, rate-limited, entirely wrong answer to "fix my pull requests". So it greps for the subcommand first and stops with instructions.Not included
README.mdhas an entry forgh-prsandgh-prs-merge, so this wants one too — but the working tree already has uncommitted changes to that file (and an untrackedbin/domainjson), and staging README.md here would have swept unrelated in-progress work into this commit. Left for whoever owns those changes.🤖 Generated with Claude Code