mirror of
https://gitea.com/gitea/tea.git
synced 2026-06-05 18:58:43 +02:00
Move sdk from code.gitea.io/sdk/gitea to gitea.dev/sdk (#1006)
Reviewed-on: https://gitea.com/gitea/tea/pulls/1006 Reviewed-by: Zettat123 <39446+zettat123@noreply.gitea.com>
This commit is contained in:
+3
-3
@@ -7,7 +7,7 @@ import (
|
||||
stdctx "context"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
gitea "gitea.dev/sdk"
|
||||
|
||||
"gitea.dev/tea/cmd/flags"
|
||||
"gitea.dev/tea/modules/context"
|
||||
@@ -30,7 +30,7 @@ var CmdIssuesClose = cli.Command{
|
||||
}
|
||||
|
||||
// editIssueState abstracts the arg parsing to edit the given issue
|
||||
func editIssueState(_ stdctx.Context, cmd *cli.Command, opts gitea.EditIssueOption) error {
|
||||
func editIssueState(requestCtx stdctx.Context, cmd *cli.Command, opts gitea.EditIssueOption) error {
|
||||
ctx, err := context.InitCommand(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -49,7 +49,7 @@ func editIssueState(_ stdctx.Context, cmd *cli.Command, opts gitea.EditIssueOpti
|
||||
|
||||
client := ctx.Login.Client()
|
||||
for _, index := range indices {
|
||||
issue, _, err := client.EditIssue(ctx.Owner, ctx.Repo, index, opts)
|
||||
issue, _, err := client.Issues.EditIssue(requestCtx, ctx.Owner, ctx.Repo, index, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ var CmdIssuesCreate = cli.Command{
|
||||
Flags: flags.IssuePRCreateFlags,
|
||||
}
|
||||
|
||||
func runIssuesCreate(_ stdctx.Context, cmd *cli.Command) error {
|
||||
func runIssuesCreate(requestCtx stdctx.Context, cmd *cli.Command) error {
|
||||
ctx, err := context.InitCommand(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -35,20 +35,19 @@ func runIssuesCreate(_ stdctx.Context, cmd *cli.Command) error {
|
||||
}
|
||||
|
||||
if ctx.IsInteractiveMode() {
|
||||
err := interact.CreateIssue(ctx.Login, ctx.Owner, ctx.Repo)
|
||||
err := interact.CreateIssue(requestCtx, ctx.Login, ctx.Owner, ctx.Repo)
|
||||
if err != nil && !interact.IsQuitting(err) {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
opts, err := flags.GetIssuePRCreateFlags(ctx)
|
||||
opts, err := flags.GetIssuePRCreateFlags(requestCtx, ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return task.CreateIssue(
|
||||
ctx.Login,
|
||||
return task.CreateIssue(requestCtx, ctx.Login,
|
||||
ctx.Owner,
|
||||
ctx.Repo,
|
||||
*opts,
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ use an empty string (eg. --milestone "").`,
|
||||
Flags: flags.IssuePREditFlags,
|
||||
}
|
||||
|
||||
func runIssuesEdit(_ stdctx.Context, cmd *cli.Command) error {
|
||||
func runIssuesEdit(requestCtx stdctx.Context, cmd *cli.Command) error {
|
||||
ctx, err := context.InitCommand(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -57,7 +57,7 @@ func runIssuesEdit(_ stdctx.Context, cmd *cli.Command) error {
|
||||
for _, opts.Index = range indices {
|
||||
if ctx.IsInteractiveMode() {
|
||||
var err error
|
||||
opts, err = interact.EditIssue(*ctx, opts.Index)
|
||||
opts, err = interact.EditIssue(requestCtx, *ctx, opts.Index)
|
||||
if err != nil {
|
||||
if interact.IsQuitting(err) {
|
||||
return nil // user quit
|
||||
@@ -66,7 +66,7 @@ func runIssuesEdit(_ stdctx.Context, cmd *cli.Command) error {
|
||||
}
|
||||
}
|
||||
|
||||
issue, err := task.EditIssue(ctx, client, *opts)
|
||||
issue, err := task.EditIssue(requestCtx, ctx, client, *opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
+4
-4
@@ -8,7 +8,7 @@ import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
gitea "gitea.dev/sdk"
|
||||
|
||||
"gitea.dev/tea/cmd/flags"
|
||||
"gitea.dev/tea/modules/context"
|
||||
@@ -33,7 +33,7 @@ var CmdIssuesList = cli.Command{
|
||||
}
|
||||
|
||||
// RunIssuesList list issues
|
||||
func RunIssuesList(_ stdctx.Context, cmd *cli.Command) error {
|
||||
func RunIssuesList(requestCtx stdctx.Context, cmd *cli.Command) error {
|
||||
ctx, err := context.InitCommand(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -72,7 +72,7 @@ func RunIssuesList(_ stdctx.Context, cmd *cli.Command) error {
|
||||
milestones, _ := flags.MilestoneFilterFlag.GetValues(cmd)
|
||||
var issues []*gitea.Issue
|
||||
if ctx.Repo != "" {
|
||||
issues, _, err = ctx.Login.Client().ListRepoIssues(owner, ctx.Repo, gitea.ListIssueOption{
|
||||
issues, _, err = ctx.Login.Client().Issues.ListRepoIssues(requestCtx, owner, ctx.Repo, gitea.ListIssueOption{
|
||||
ListOptions: flags.GetListOptions(cmd),
|
||||
State: state,
|
||||
Type: kind,
|
||||
@@ -92,7 +92,7 @@ func RunIssuesList(_ stdctx.Context, cmd *cli.Command) error {
|
||||
if ctx.IsSet("assignee") {
|
||||
return errors.New("--assignee requires --repo (global issue search does not support assignee filter)")
|
||||
}
|
||||
issues, _, err = ctx.Login.Client().ListIssues(gitea.ListIssueOption{
|
||||
issues, _, err = ctx.Login.Client().Issues.ListIssues(requestCtx, gitea.ListIssueOption{
|
||||
ListOptions: flags.GetListOptions(cmd),
|
||||
State: state,
|
||||
Type: kind,
|
||||
|
||||
@@ -6,7 +6,7 @@ package issues
|
||||
import (
|
||||
"context"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"gitea.dev/sdk"
|
||||
|
||||
"gitea.dev/tea/cmd/flags"
|
||||
"github.com/urfave/cli/v3"
|
||||
|
||||
Reference in New Issue
Block a user