Skip to content

--format json full-project fetch over-fetches fields and can exceed gateway request-time limits #727

Description

@ryancheley

Summary

yt issues list --format json (and --all) requests a heavy field set by default —
dominated by customFields(...) expanded for every issue — producing large responses that,
on a constrained/remote network, make a full-project fetch exceed a gateway's per-request time
limit and get killed (the process is SIGTERM'd, exit 15). There is currently no working way
to trim the field set
for JSON output, because --profile is broken (#726).

Evidence (v0.24.2, 178-issue project)

yt issues list --project-id NGDEV --format json --top 178:

fields response time (local, fast net)
default 268,100 bytes (~1.5 KB/issue) 1.84s
explicit --fields idReadable,summary,description,created,customFields(name,value(name)) 200,831 bytes 0.65s
--fields idReadable,summary,description,created (no customFields) much smaller

The default field set (from youtrack_cli/services/issues.py, ~line 141):

id,summary,description,state,priority,type,customFields(id,name,value(login,fullName,name))

customFields(...) returns every custom field for every issue, which is the bulk of
the payload. Scaled up: a 2,000-issue project ≈ 3 MB in one response. Over a remote link with,
say, a ~20s gateway timeout, the request never completes and is killed — the caller sees 0
issues, no error.

Observed request-time curve (against a real gated instance)

--top wall time
100 ~6s
250 ~8s
500 ~22s → killed (exit 15)
--all / default (whole project) killed

So the per-request payload/time grows past the gateway ceiling well before the whole project
is fetched.

Suggestions (in priority order)

  1. Fix --profile (--profile is broken: profile name is passed to the REST fields param instead of being resolved #726) so --profile minimal/standard actually shrink the payload —
    the primary lever for JSON perf.
  2. Add a JSON-friendly lean profile (e.g. compact) that includes summary/description
    but omits the full customFields expansion, for callers that don't need every custom field.
  3. Consider a leaner default fields for --format json, or at least document that large
    JSON fetches should pass --fields/--profile to stay under network limits.
  4. Request-time resilience for --all: smaller default page size and/or streaming/NDJSON
    output so a large project is fetched as many small responses rather than one big one that a
    gateway can kill.

Context

Hit while building a tool that fetches whole projects as JSON over a remote network. We worked
around it by chunking (--top + a created-date cursor) so each request is bounded, but the
underlying payload weight and the broken --profile are the real levers, especially for JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions