JetBrains / JetBrains/teamcity-cli

run view omits incompatible cloud images and reasons shown in UI

Open
#374 1 comment 0 reactions 0 assignees View on GitHub
blocked:needs-api bug votes-needed
Dominant language
Go
Stars
123
Forks
16
Avg merge
1d 13h
Merged PRs (30d)
22

Description

## CLI Version

`teamcity version 1.2.0`

## TeamCity Server Version

`TeamCity 2026.2 EAP (build 232620)`

## Operating System

macOS 26.5.1

## What happened?

For a queued build that cannot run because no compatible agents are available, the TeamCity Web UI shows an incompatible cloud image and the exact implicit requirement that makes it incompatible, but `teamcity run view` does not show this information.

CLI output:

```shell
$ teamcity run view 506
o Demo Log Generator 506 #
Triggered by

Wait reason: There are no idle compatible agents which can run this build

Compatible agents (0)
Incompatible agents (0)

View in browser: https://sugdyzhekov.demo.teamcity.com/build/506
```

The Web UI for the same build shows:

```text
Compatible agents (0): None

Incompatible agents (1)
Project 1 project pool (1)
lt-0098c599195042eab
Implicit requirements:
dT must have a value (referenced in Build step: Emit demo build log)
```

So the CLI makes it look like there are no incompatible agents/images to inspect, while the UI contains the useful diagnostic reason.

`teamcity run view 506 --json` also does not expose the UI-visible incompatible image/reason; it only returns the queued build summary and wait reason.

## Expected behavior

`teamcity run view` should show the same incompatible cloud image/agent diagnostics that the UI shows, or at least include:

- incompatible cloud image/agent count
- pool name
- cloud image/agent name
- incompatibility reason, including implicit requirements and the referenced build step

The JSON output should also expose this information when available.

## Steps to reproduce

1. Create or use a queued build that has no compatible running agents, but has at least one incompatible cloud image/agent visible in TeamCity UI.
2. Open the build in the TeamCity UI and go to `Compatible Agents`.
3. Observe that the UI lists an incompatible cloud image/agent and the incompatibility reason.
4. Run `teamcity run view `.
5. Observe that the CLI reports `Incompatible agents (0)` and omits the UI-visible cloud image/reason.

## Relevant log output

```shell
$ teamcity --version
teamcity version 1.2.0

$ teamcity api '/app/rest/server?fields=version,buildNumber'
{
"buildNumber": "232620",
"version": "2026.2 EAP (build 232620)"
}

$ teamcity run view 506 --json
{
"id": 506,
"buildTypeId": "Project1_DemoLogGenerator",
"state": "queued",
"href": "/app/rest/buildQueue/id:506",
"webUrl": "https://sugdyzhekov.demo.teamcity.com/build/506",
"queuedDate": "20260623T134307+0000",
"buildType": {
"id": "Project1_DemoLogGenerator",
"name": "Demo Log Generator",
"projectName": "Project 1",
"projectId": "Project1",
"href": "/app/rest/buildTypes/id:Project1_DemoLogGenerator",
"webUrl": "https://sugdyzhekov.demo.teamcity.com/buildConfiguration/Project1_DemoLogGenerator?mode=builds"
},
"triggered": {
"type": "user",
"date": "20260623T134307+0000",
"user": {
"id": 1,
"username": "admin",
"href": "/app/rest/users/id:1"
}
},
"waitReason": "There are no idle compatible agents which can run this build"
}
```

Contributor guide

Open the contributing guide

Research direction

Start at the `teamcity run view` command and its `--json` output, reproducing the queued build 506 case described in the report. Compare the CLI's empty incompatible-agent section with the Web UI details, then trace how queued-build diagnostics are obtained and rendered. Done means both output modes expose available counts, pool or image names, and incompatibility reasons, while still handling cases with no diagnostics.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.