mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
refactor(services): leave CLI flag and command names to the app layer
Services report ErrRunScanExhausted, ErrMaxPages and plain conflicts, and the commands add the --branch/--max-pages/--force hints. Unknown label names use the shared NotFoundError, and the repository-scoped review and team search refusal moves into tea search's own usage check. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
10 files changed
+37
-18
No files matched your search
@@ -75,11 +75,8 @@ func (s Issues) SearchPage(ctx context.Context, opts DiscussionSearchOptions) (P
|
||||
}
|
||||
|
||||
func (s Issues) searchRepository(ctx context.Context, opts DiscussionSearchOptions, kind gitea.IssueType) (Page[*gitea.Issue], error) {
|
||||
if opts.ReviewRequested || opts.Reviewed {
|
||||
return Page[*gitea.Issue]{}, &CapabilityError{Feature: "repository-scoped review search", Reason: "Gitea supports review filters on instance-wide search only; omit --repo or TEA_REPO"}
|
||||
}
|
||||
if opts.Team != "" {
|
||||
return Page[*gitea.Issue]{}, &CapabilityError{Feature: "repository-scoped team search", Reason: "Gitea supports team filters on instance-wide search only; omit --repo or TEA_REPO"}
|
||||
if opts.ReviewRequested || opts.Reviewed || opts.Team != "" {
|
||||
return Page[*gitea.Issue]{}, &CapabilityError{Feature: "repository-scoped review or team search", Reason: "Gitea supports review and team filters on instance-wide search only"}
|
||||
}
|
||||
owner, repo, err := splitRepository(s.Repository)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user