Bug: tea milestone ls and tea labels ls don't show all the results, despite --limit #463

Closed
opened 2022-02-25 13:14:19 +00:00 by michaeljtsai · 3 comments

describe your environment

  • tea version used (tea -v): 0.8.0
  • Gitea version used: 1.16.1
    • the issue only occurred after updating gitea recently
  • operating system: macOS 12.2.1
  • I make use of...
    • non-standard default branch names (no main,master, or trunk)
    • .ssh/config or .gitconfig host aliases in my git remotes
    • ssh_agent or similar
    • non-standard ports for gitea and/or ssh
    • something else that's likely to interact badly with tea: ...

Please provide the output of git remote -v (if the issue is related to tea not finding resources on Gitea):


describe the issue (observed vs expected behaviour)

I am running tea from a script to try to get lists of my current milestones and labels. But I have 100+ milestones and 60+ labels, and it was only returning the first page. Even when using a very high --limit, it seems to give me a max of 50. I also tried increasing the limits in the app.ini:

[api]
DEFAULT_PAGING_NUM = 60
MAX_RESPONSE_ITEMS = 60

but it still doesn't give me more than 50 at a time. I am able to get the remaining items by using additional invocations of tea with a different --page, but that's not very convenient in a script.

### describe your environment - tea version used (`tea -v`): 0.8.0 - [x] I also reproduced the issue [with the latest master build](https://dl.gitea.io/tea/master) - Gitea version used: 1.16.1 - [ ] the issue only occurred after updating gitea recently - operating system: macOS 12.2.1 - I make use of... - [ ] non-standard default branch names (no `main`,`master`, or `trunk`) - [ ] .ssh/config or .gitconfig host aliases in my git remotes - [ ] ssh_agent or similar - [ ] non-standard ports for gitea and/or ssh - [ ] something else that's likely to interact badly with tea: ... Please provide the output of `git remote -v` (if the issue is related to tea not finding resources on Gitea): ``` ``` ### describe the issue (observed vs expected behaviour) I am running `tea` from a script to try to get lists of my current milestones and labels. But I have 100+ milestones and 60+ labels, and it was only returning the first page. Even when using a very high `--limit`, it seems to give me a max of 50. I also tried increasing the limits in the [app.ini](https://docs.gitea.io/en-us/config-cheat-sheet/#api-api): ``` [api] DEFAULT_PAGING_NUM = 60 MAX_RESPONSE_ITEMS = 60 ``` but it still doesn't give me more than 50 at a time. I am able to get the remaining items by using additional invocations of `tea` with a different `--page`, but that's not very convenient in a script.
michaeljtsai added the
kind/bug
label 2022-02-25 13:14:19 +00:00
Member

This is (at least partially) an issue with the Gitea API, not tea.
Try the following examples. That repo currently has 91 labels:


I didn't test yet locally with different values of MAX_RESPONSE_ITEMS and DEFAULT_PAGING_NUM, there might be more weirdness hiding.


Additionally there seems to be a bug with tea, as I can't reproduce it with raw API calls:

$ tea labels --output simple --repo lunny/gitea --limit 60 | wc -l
10
This is (at least partially) an issue with the Gitea API, not tea. Try the following examples. That repo currently has 91 labels: - https://gitea.com/api/v1/repos/lunny/gitea/labels - 91 results, questionable if `MAX_RESPONSE_ITEMS = 50`, but probably for backwards compat reasons. - https://gitea.com/api/v1/repos/lunny/gitea/labels?limit=60&page=1 - 50 results, reasonable if `MAX_RESPONSE_ITEMS = 50` - https://gitea.com/api/v1/repos/lunny/gitea/labels?limit=60 - 91 results, certainly wrong - https://gitea.com/api/v1/repos/lunny/gitea/labels?page=1 - 30 results, reasonable if `DEFAULT_PAGING_NUM = 30`, though strange UX --- I didn't test yet locally with different values of `MAX_RESPONSE_ITEMS` and `DEFAULT_PAGING_NUM`, there might be more weirdness hiding. --- Additionally there seems to be a bug with tea, as I can't reproduce it with raw API calls: ``` $ tea labels --output simple --repo lunny/gitea --limit 60 | wc -l 10 ```
noerw added the
upstream/gitea
label 2022-03-10 15:19:42 +00:00
Member

The second & third part of my reply are caused by the go-sdk, see gitea/go-sdk#571.

The second & third part of my reply are caused by the go-sdk, see https://gitea.com/gitea/go-sdk/issues/571.
noerw added the
upstream/sdk
label 2022-03-10 15:38:47 +00:00
6543 referenced this issue from a commit 2022-09-13 17:52:45 +00:00
6543 closed this issue 2022-09-13 17:52:45 +00:00
Member

The remaining issue upstream in gitea is tracked at https://github.com/go-gitea/gitea/issues/21158

The remaining issue upstream in gitea is tracked at https://github.com/go-gitea/gitea/issues/21158
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/tea#463
No description provided.