Cut issue, pr, label, milestone and comment examples to at most three, drop
doc comments that only restate the name, fold the comment and attachment
argument lookups into one closure each, and inline label helpers with one
caller.
Signed-off-by: bircni <bircni@icloud.com>
Long texts no longer restate the flag list, the instance selection
of tea help environment, the config keys with descriptions or the
team argument rules shown under ARGUMENTS; webhook events come from
services.WebhookEvents; the migration guide refers to tea help
formatting for the terminal layout.
Signed-off-by: bircni <bircni@icloud.com>
pr edit with reviewers and other fields reads the pull request once,
org delete counts only repositories, org view counts concurrently,
team list skips the repository count of all-repository teams,
pr diff --web builds the URL locally, pr list re-reads pull requests
concurrently for review fields, and glamour renderers are built once
per width and color.
Signed-off-by: bircni <bircni@icloud.com>
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>
Every command accepts a flag's plural, such as --add-labels for
--add-label (D8), instead of per-command alias maps.
Signed-off-by: bircni <bircni@icloud.com>
writeFirstPage answers paged listings in app and services tests,
testNow replaces the copied clock, withoutANSI the second color
stripper, and the single-entry table test becomes a plain test.
Signed-off-by: bircni <bircni@icloud.com>
services.IsNotFound replaces the hand-rolled 404 checks, convertPage
the copied page conversions and lastPathNumber the comment's own
number parser. The List wrappers around ListPage of releases,
branches, wiki pages, secrets and variables go, pull request filters
resolve milestones through Milestones.FindOne like issues, and
localFlagsChanged, boolOrder, Cell.Render, stateBadge and dueText
replace their copies.
Signed-off-by: bircni <bircni@icloud.com>
The application caches the settings snapshot and reloads it only after
an update through the store, so output and prompt helpers no longer
read and parse config.yml and hosts.yml several times per command.
canPrompt and chooser replace the inline prompt-policy checks.
Checks are tallied by one services.Tally, terminal.Plural replaces the
two app copies, refKind.article/noun replace the comment group's own
words, list commands use servicePage, and web URLs are built by
repositoryURL and webURL in browser.go.
Signed-off-by: bircni <bircni@icloud.com>
The six commands that take a file or directory argument set their
completer directly instead of a Use-line parser wrapping every
command, the first-argument-only wrappers become one firstArg helper,
and only the bash completion help keeps a custom text.
Signed-off-by: bircni <bircni@icloud.com>
FormPrompter is the only production prompter and implements the rich
prompt API, so Ask, AskText and ConfirmDefault become the Prompter
interface and the plain Input/Confirm fallbacks go away.
Confirmations that default to no derive their non-terminal wording
from the prompt, and single deletes share deleteConfirmed for the
prompt, the request and the done line.
Signed-off-by: bircni <bircni@icloud.com>
Mutations end with a.jsonResult or a.created instead of hand-rolled
--json branches, the two identical jsonResult/writeMutationJSON helpers
become one, and writeBatchJSON checks --json itself so batch commands
share one tail.
Signed-off-by: bircni <bircni@icloud.com>
Errors are named by the service call that failed: Classify,
NotFoundError and ConflictError at the call site. Remove the endpoint
parser that guessed the resource from the request path, and the
follow-up reads the explainer made at error time (repository state,
issue-vs-pull-request, the existing pull request's URL) together with
the credentialed transport each API error carried for them.
Calls that the endpoint parser covered and the services did not now
classify themselves: issues, pull requests, reviews, comments,
releases, branches, wiki pages, repositories, organizations and SSH
keys. Unclassified failures fall back to the generic
"not found (HTTP 404 GET ...)" text.
Signed-off-by: bircni <bircni@icloud.com>
Drop additions that the UX plan does not ask for:
- the interactive label edit form; label edit now requires a flag
- label clone and the skip mode of label creation it needed
- repo rename rewriting the Git remote or tea.repository; it now
warns that the remote still points to the old name
- the extra "source" remote on clones of pull mirrors
- run artifact download, which duplicates run download --zip
- 256-color and 24-bit label swatches; colors stay ANSI 16
- config list --show-source (config get keeps it)
- the membership and access GETs before team member/repo add and
remove; Gitea's PUT and DELETE are idempotent
label edit/delete keep --by-name: it is the only way to address a
label whose name is a number that is also another label's ID.
Signed-off-by: bircni <bircni@icloud.com>
Drop writeDownload, terminal.Require, terminal.Confirm, terminal.Row,
terminal.Record and Pulls.FindOpenByHead, which no command calls anymore,
and point their tests at the code that replaced them.
Signed-off-by: bircni <bircni@icloud.com>
The hints for a missing repository, a pull request number that names an
issue and an existing pull request read the API with raw GETs from the app
layer. Read them through SDK lookups in services, which reuse the failed
request's instance and credential, and let transport only hand out that
client.
Signed-off-by: bircni <bircni@icloud.com>
Completion fetched repository assignees and tags with raw GETs. List them
through new Repositories.Assignees and Repositories.Tags service methods on
the SDK, and remove the raw fetch helper.
Signed-off-by: bircni <bircni@icloud.com>
Use one canPrompt and pullNumberArguments for the comment commands, set
display preferences instead of the retired environment variables in
tests, and delete writeList, writeItem, batch, table, writeRecord(s),
the legacy column map, confirm, require, validateMilestoneFlags and
listWindow now that every command uses their replacements.
Signed-off-by: bircni <bircni@icloud.com>
issue create, issue edit and comment prompts ask canPrompt, like the
milestone and label forms, instead of loading the settings themselves.
Signed-off-by: bircni <bircni@icloud.com>
tea issue close 999 printed "issue 999: not found (HTTP 404 GET …)" and
issue attachment view 1 9 blamed issue #1 for a missing attachment.
Batch commands (issue close, reopen, edit, milestone issue add and
remove) now report "issue 999: not found in alice/x", and attachment
commands "attachment 9 not found in alice/x#1".
Signed-off-by: bircni <bircni@icloud.com>
tea issue list --since 7d was rejected; only h, m and s durations worked.
Time bounds such as --since, --until and --before now also take whole
days and weeks: 7d, 2w.
Signed-off-by: bircni <bircni@icloud.com>