feat: add --repo filter to gitt issues list - #910
Merged
Conversation
…of silently overwriting
…instead of silently overwriting" This reverts commit e109040.
Contributor
|
@anderdc , review time 🫡 |
anderdc
approved these changes
May 5, 2026
This was referenced May 8, 2026
RUNECTZ33
added a commit
to RUNECTZ33/gittensor
that referenced
this pull request
May 8, 2026
The `--repo <owner/name>` filter added in entrius#910 compares raw user input directly against `repository_full_name`, so: - malformed inputs like `ownerrepo` or `owner//repo` are silently accepted and quietly match nothing (no error to the user); - whitespace-padded valid inputs like `' entrius/gittensor '` fail to match real entries because the comparison string still contains the surrounding spaces. Fix by reusing the existing `validate_repository(verify_exists=False)` helper before any contract read, normalizing `repo_filter` to a clean `owner/repo` string and surfacing `click.BadParameter` through the existing `handle_exception` path so JSON consumers get a structured `bad_parameter` error and human callers exit non-zero. This is the same validator already used by `gitt issues register/cancel` mutating commands, so the read-side `--repo` filter now matches the documented contract enforced everywhere else. ## Tests - Malformed filters (`ownerrepo`, `owner//repo`, `owner/`, `/repo`, `owner repo`) rejected with structured `bad_parameter` error in JSON mode and non-zero exit in human mode, before any contract read. - Whitespace-padded valid filter `' owner/repo '` correctly matches the contract entry and returns the issue. - Mixed-case filter `OWNER/REPO` still matches (preserves existing case-insensitive behavior). - Valid non-matching filter returns empty list rather than all issues. Closes entrius#1061
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.
Fixes #892
Problem
gitt issues listrenders every on-chain issue with no way to filterby repository. With 100+ tracked repos and unbounded issue growth,
operators contributing to one repo are forced to scroll through
unrelated issues or resort to shell workarounds like
jqorgrep.Fix
Added
--repo <owner/name>option toissues_listinview.py.The filter is applied client-side after the contract read, before
rendering — both in JSON mode and table mode.
--idtakes precedenceover
--repo(the existing single-issue path is unchanged).The filter is case-insensitive.
Changes
gittensor/cli/issue_commands/view.py— added--repooption andtwo filter lines (JSON path and table path)