Implement more issue filters #400

Merged
6543 merged 15 commits from noerw/tea:more-issue-filters into master 2021-12-02 19:26:48 +00:00
Member

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 2021-09-14 09:58:17 +00:00
noerw added the
kind
enhancement
status/wip
labels 2021-09-14 09:58:18 +00:00
noerw added 4 commits 2021-09-14 09:58:18 +00:00
add new issue filter flags
they are now exposed on `tea pr ls` too, but have no effect yet
2cd2363000
refactor pr list to use same filter flags as issues
previously we used the /pulls endpoint, but that didn't support many
filters (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
limitation to take, as changes to the API etc will take quite some time to propagate
through the ecosystem

This commit also adds the --fields flag to `tea pulls list`, with the
same fields available as issues (see above)
Some checks failed
continuous-integration/drone/pr Build is failing
e1094c47a0
noerw removed the
status/wip
label 2021-09-14 10:05:17 +00:00
noerw added 1 commit 2021-09-14 10:07:15 +00:00
lint
All checks were successful
continuous-integration/drone/pr Build is passing
9baad74766
noerw added 1 commit 2021-09-22 09:15:42 +00:00
Merge branch 'master' into more-issue-filters
All checks were successful
continuous-integration/drone/pr Build is passing
e3a6d958f8
noerw added 1 commit 2021-09-23 11:26:03 +00:00
Merge branch 'master' into more-issue-filters
All checks were successful
continuous-integration/drone/pr Build is passing
b4dd97bc58
noerw added 3 commits 2021-09-28 09:47:16 +00:00
separate IssuePRListing flags again
as the APIs are incompatible
635de20ce2
add --kind, to make keyword search on PRs available for PRs too
as a workaround for the missing filters on the PR listing API, tea issues can also show PRs now
All checks were successful
continuous-integration/drone/pr Build is passing
bdbf678dab
noerw added 1 commit 2021-09-29 10:55:33 +00:00
Merge branch 'master' into more-issue-filters
All checks were successful
continuous-integration/drone/pr Build is passing
6d95dc111e
noerw added 1 commit 2021-10-09 17:06:54 +00:00
Merge branch 'master' into more-issue-filters
All checks were successful
continuous-integration/drone/pr Build is passing
5cda3d734f
noerw added 1 commit 2021-10-11 12:03:42 +00:00
Merge branch 'master' into more-issue-filters
All checks were successful
continuous-integration/drone/pr Build is passing
549e60b7e3
noerw added 1 commit 2021-10-14 14:40:38 +00:00
Merge branch 'master' into more-issue-filters
All checks were successful
continuous-integration/drone/pr Build is passing
5f95747fd0
lunny approved these changes 2021-10-15 03:10:45 +00:00
noerw added 1 commit 2021-10-18 16:02:32 +00:00
Merge branch 'master' into more-issue-filters
All checks were successful
continuous-integration/drone/pr Build is passing
b0e12fc28b
6543 approved these changes 2021-12-02 19:26:20 +00:00
6543 merged commit a89f51f9ec into master 2021-12-02 19:26:48 +00:00
6543 deleted branch more-issue-filters 2021-12-02 19:26:49 +00:00
Sign in to join this conversation.
No description provided.