Remove pagination from context (#807)

Pagination related flags now write directly to ListOption struct and enforce non negative numbers.
Flag tests were added to cover the validation

Reviewed-on: https://gitea.com/gitea/tea/pulls/807
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: TheFox0x7 <thefox0x7@gmail.com>
Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
TheFox0x7
2025-08-26 23:13:27 +00:00
committed by Lunny Xiao
parent 8876fe3cb8
commit b74405530a
17 changed files with 182 additions and 36 deletions

View File

@ -103,7 +103,7 @@ func runMilestoneIssueList(_ stdctx.Context, cmd *cli.Command) error {
}
issues, _, err := client.ListRepoIssues(ctx.Owner, ctx.Repo, gitea.ListIssueOption{
ListOptions: ctx.GetListOptions(),
ListOptions: flags.GetListOptions(),
Milestones: []string{milestone},
Type: kind,
State: state,

View File

@ -61,7 +61,7 @@ func RunMilestonesList(_ stdctx.Context, cmd *cli.Command) error {
client := ctx.Login.Client()
milestones, _, err := client.ListRepoMilestones(ctx.Owner, ctx.Repo, gitea.ListMilestoneOption{
ListOptions: ctx.GetListOptions(),
ListOptions: flags.GetListOptions(),
State: state,
})