Bug: tea issue create -L silently fails to add label if it's not on the first page #464

Closed
opened 2022-02-25 13:19:22 +00:00 by michaeljtsai · 1 comment

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)

If I try to create an issue with a label that's alphabetically early, it works. If I specify a label beyond about 50 in the list, the issue is created but it doesn't have the label (and no error is reported). It's as if it only works for labels that would be on the first page of results. As with #463, I tried increasing the default page size, but that didn't seem to help.

### describe your environment - tea version used (`tea -v`): 0.8.0 - [ ] 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) If I try to create an issue with a label that's alphabetically early, it works. If I specify a label beyond about 50 in the list, the issue is created but it doesn't have the label (and no error is reported). It's as if it only works for labels that would be on the first page of results. As with #463, I tried increasing the default page size, but that didn't seem to help.
michaeljtsai added the
kind/bug
label 2022-02-25 13:19:22 +00:00
Member

The issue here is, that we rely on the property of the API to return all labels when no pagination parameters are given (or are 0) in task.ResolveLabelNames().
But a change in the go-sdk (ListOptions.setDefaults()) added the default value of &page=1, adding pagination to the request.

Quickfix: pass .Page: -1 to disable pagination.
The proper fix would be to handle pagination in task.ResolveLabelNames(), for which it's probably best to wait for gitea/go-sdk#473

The issue here is, that we rely on the property of the API to return all labels when no pagination parameters are given (or are 0) [in `task.ResolveLabelNames()`](https://gitea.com/gitea/tea/src/commit/fb3e1f75e98405ac6caebf529084fa685f78d79b/modules/task/labels.go#L15). But a change in the go-sdk (`ListOptions.setDefaults()`) added the default value of `&page=1`, adding pagination to the request. Quickfix: pass `.Page: -1` to disable pagination. The proper fix would be to handle pagination in `task.ResolveLabelNames()`, for which it's probably best to wait for https://gitea.com/gitea/go-sdk/pulls/473
noerw added the
status/blocked
upstream/sdk
labels 2022-03-10 15:53:32 +00:00
noerw removed the
status/blocked
label 2022-03-12 13:10:40 +00:00
6543 closed this issue 2022-04-07 19:44:17 +00:00
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#464
No description provided.