Implement more issue filters #400

Merged
6543 merged 15 commits from noerw/tea:more-issue-filters into master 2 months ago
noerw commented 4 months ago
Collaborator

This adds new filters to tea issues ls and tea pr ls, made available in SDK 0.15:

--state value                 Filter by state (all|open|closed) (default: open)
--keyword value, -k value     Filter by search string
--labels value, -L value      Comma-separated list of labels to match issues against.
--milestones value, -m value  Comma-separated list of milestones to match issues against.
--author value, -A value      
--assignee value, -a value    
--mentions value, -M value    
--from value, -F value        Filter by activity after this date
--until value, -u value       Filter by activity before this date

Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg mentioned_by) and or inconsistent with usage in other commands (eg tea times --until)

These filters are made available to the PR listing too, though this has some caveats:
For the PR listing we previously used the /pulls endpoint, but that didn't support many filters (see docs).
Instead, we now do an issue listing, which also supports listing PRs.
The drawback here is that it only returns issue fields, but none of a PR's special fields like head repo, base branch, mergeable flag, ...
This is a limitation of the upstream API, and we should carefully decide which of the limitations to take (adding more filters, or exposing more attributes), because enhancements to the gitea API etc will take quite some time to propagate through the ecosystem..
This PR also adds the --fields flag to tea pr ls due to the merging of the listing functions

fixes #376, related #323

This adds new filters to `tea issues ls` and `tea pr ls`, made available in SDK 0.15: ``` --state value Filter by state (all|open|closed) (default: open) --keyword value, -k value Filter by search string --labels value, -L value Comma-separated list of labels to match issues against. --milestones value, -m value Comma-separated list of milestones to match issues against. --author value, -A value --assignee value, -a value --mentions value, -M value --from value, -F value Filter by activity after this date --until value, -u value Filter by activity before this date ``` Note: I felt free to change parameter names as exposed by SDK & API, as the names exposed by them are partially bollocks (eg `mentioned_by`) and or inconsistent with usage in other commands (eg `tea times --until`) ~~These filters are made available to the PR listing too, though this has **some caveats**: For the PR listing we previously used the `/pulls` endpoint, but that didn't support many filters ([see docs](https://gitea.com/api/swagger#/repository/repoListPullRequests)). Instead, we now do an issue listing, which also supports listing PRs. The drawback here is that it only returns issue fields, but none of a PR's special fields like head repo, base branch, mergeable flag, ... This is a limitation of the upstream API, and we should carefully decide which of the limitations to take (adding more filters, or exposing more attributes), because enhancements to the gitea API etc will take quite some time to propagate through the ecosystem.. This PR also adds the --fields flag to `tea pr ls` due to the merging of the listing functions~~ fixes #376, related #323
noerw added this to the v0.9.0 milestone 4 months ago
noerw added the
kind/enhancement
status/wip
labels 4 months ago
noerw added 4 commits 4 months ago
2cd2363000 add new issue filter flags
e1094c47a0 refactor `pr list` to use same filter flags as issues
noerw removed the
status/wip
label 4 months ago
noerw added 1 commit 4 months ago
9baad74766 lint
noerw added 1 commit 4 months ago
e3a6d958f8 Merge branch 'master' into more-issue-filters
noerw added 1 commit 4 months ago
b4dd97bc58 Merge branch 'master' into more-issue-filters
noerw added 3 commits 4 months ago
bdbf678dab add --kind, to make keyword search on PRs available for PRs too
noerw added 1 commit 4 months ago
6d95dc111e Merge branch 'master' into more-issue-filters
noerw added 1 commit 3 months ago
5cda3d734f Merge branch 'master' into more-issue-filters
noerw added 1 commit 3 months ago
549e60b7e3 Merge branch 'master' into more-issue-filters
noerw added 1 commit 3 months ago
5f95747fd0 Merge branch 'master' into more-issue-filters
lunny approved these changes 3 months ago
noerw added 1 commit 3 months ago
b0e12fc28b Merge branch 'master' into more-issue-filters
6543 approved these changes 2 months ago
6543 merged commit a89f51f9ec into master 2 months ago
6543 referenced this issue from a commit 2 months ago
6543 deleted branch more-issue-filters 2 months ago

Reviewers

lunny approved these changes 3 months ago
6543 approved these changes 2 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as a89f51f9ec.
Sign in to join this conversation.
Loading…
There is no content yet.