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

Open
opened 4 months ago by michaeljtsai · 2 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 4 months ago
Collaborator

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 4 months ago
Collaborator

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 4 months ago
Sign in to join this conversation.
Loading…
There is no content yet.