Skip to content

--profile is broken: profile name is passed to the REST fields param instead of being resolved #726

Description

@ryancheley

Summary

yt issues list --profile {minimal,standard,full} does not resolve the profile to a field
set. The profile name string is passed straight to the YouTrack REST fields= parameter,
so the API returns near-empty issues (essentially just id). All three profiles produce
identical, useless output, and the profile is unusable both as a documented feature and as
the intended way to trim/speed up JSON output.

Evidence (v0.24.2)

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

invocation response size contents
(no --profile) 268,100 bytes full issues (summary, description, customFields…)
--profile minimal 5,343 bytes ~30 B/issue — basically only id
--profile standard 5,343 bytes identical to minimal
--profile full 5,343 bytes identical to minimal

All three profiles return the same 5,343 bytes — none of the FIELD_PROFILES field lists
are applied. minimal is supposed to include summary/state, standard/full add
description, customFields, etc., but the actual output has none of them.

Root cause

youtrack_cli/managers/issues.py, in both list_issues() and search_issues():

# Handle field_profile parameter (legacy)
if field_profile and not fields:
    fields = field_profile          # <-- passes "minimal"/"standard"/"full" verbatim

fields is then handed to the REST call as the fields= query param. YouTrack sees
fields=minimal, treats minimal as an (unknown) field name, and returns only what it can
(id/$type). The predefined field lists in youtrack_cli/field_selection.py
(FIELD_PROFILES["issues"]["minimal"|"standard"|"full"]) are never consulted on this path.

The older youtrack_cli/issues.py path does it correctly (around lines 265–277):

field_selector = get_field_selector()
params["fields"] = field_selector.get_fields("issues", profile)

Suggested fix

In managers/issues.py, resolve the profile through FieldSelector instead of passing it raw:

if field_profile and not fields:
    from ..field_selection import get_field_selector
    fields = get_field_selector().get_fields("issues", field_profile)

Why it matters

Beyond the profiles being non-functional, this blocks the natural workaround for slow/large
--format json fetches (use --profile minimal to shrink the payload). On a constrained
network a full-project JSON fetch (the 268 KB default, scaling to megabytes) can exceed a
gateway's request time limit and get killed; a working minimal/standard profile would cut
the payload dramatically. See the companion issue on JSON payload size.

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