Skip to content

feat: add --repo filter to gitt issues list - #910

Merged
anderdc merged 4 commits into
entrius:testfrom
Tet-9:feat/892-issues-list-repo-filter
May 5, 2026
Merged

feat: add --repo filter to gitt issues list#910
anderdc merged 4 commits into
entrius:testfrom
Tet-9:feat/892-issues-list-repo-filter

Conversation

@Tet-9

@Tet-9 Tet-9 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #892

Problem

gitt issues list renders every on-chain issue with no way to filter
by 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 jq or grep.

Fix

Added --repo <owner/name> option to issues_list in view.py.
The filter is applied client-side after the contract read, before
rendering — both in JSON mode and table mode. --id takes precedence
over --repo (the existing single-issue path is unchanged).
The filter is case-insensitive.

Changes

  • gittensor/cli/issue_commands/view.py — added --repo option and
    two filter lines (JSON path and table path)

@igeabdulrahmanikeoluwa-str

Copy link
Copy Markdown
Contributor

@anderdc , review time 🫡

@anderdc
anderdc merged commit 58036fd into entrius:test May 5, 2026
3 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] gitt issues list dumps every on-chain issue with no way to filter — make --repo <owner/name> filter at the CLI level

3 participants