Skip to content

fix(ci): the gate row lines lose the row name to Rich markup #5033

Closed

Description

@dan-petty

Problem Description

Each row line of the devops ci gate has the form {badge} [{name}] {title} ({duration}) (_execute_check_async, src/devops_cli/commands/ci.py). print_muted reads the text as Rich markup, so Rich takes [{name}] as a style tag and removes it. No row line shows the name of its row. The names are what --only and --skip take, so a person who reads a failed line must find the name from the title.

Reproduction Steps

  1. uv run python -I -c "from devops_cli.output import print_muted; print_muted(' X [lint] ruff check (1s)')"
  2. uv run devops ci --check --only format

Expected vs Actual Behavior

Expected: ✓ pass [format] ruff format (3.85s).
Actual: ✓ pass ruff format (3.85s). Step 1 prints X ruff check (1s).

Environment Diagnostics

devcontainer, origin/main 87ae9ee, Python 3.14.

Logs, Traces, or Terminal Output

  ✓ pass  python version check (3.14+) (10µs)
  ✗ fail  startup imports (modules that each command imports at start) (stopped after 9.27s)

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source: #5031

Alternatives check of 2026-11-15: in-use.
The repository already uses this tool.
Tool: Textualize/rich (https://github.com/Textualize/rich), MIT, last activity 2026-11-13, maintained.

Proposed design

Problem statement

The devops ci gate prints one row line for each check. The line has the form {badge} [{name}] {title} ({duration}). print_muted parses the line as Rich markup. Rich removes [{name}] as a style tag. No row line shows its row name. A person who reads a failed line cannot find the name that --only and --skip take.

Acceptance criteria

Requirement: Gate row line shows the row name

The devops ci gate SHALL print each row line with the literal row name inside square brackets.

Scenario: A completed row line shows its name

  • WHEN a gate row completes and _execute_check_async prints its result line
  • THEN the line contains the row name in square brackets, and Rich does not consume the name as markup.

Requirement: Skipped and error row lines show the row name

The devops ci gate SHALL print the literal row name in every skipped, timed-out or cancelled row line.

Scenario: A skipped row line shows its name

  • WHEN a gate row is skipped, times out or is cancelled and _execute_check_async prints its line
  • THEN the line contains the row name in square brackets, and Rich does not consume the name as markup.

Requirement: Printed row name matches the selection name

The printed row name SHALL be the same string that --only and --skip accept.

Scenario: The printed name selects the same row

  • WHEN a row line prints a name and a user passes that name to --only
  • THEN the gate runs the same row and prints the same name again.

Existing Tool Considered

Textualize/rich (https://github.com/Textualize/rich) is already in use. It provides rich.markup.escape and markup=False. It lacks the change to the row-line formatting in src/devops_cli/commands/ci.py. The project must escape the row name or disable markup for that line.

Key questions

  • Which row lines must show the row name?: Every row line printed by _execute_check_async, including the normal, timeout, cancelled and skipped lines. [sources: src/devops_cli/commands/ci.py:564, src/devops_cli/commands/ci.py]
  • Does print_muted parse Rich markup?: Yes. print_muted wraps a Rich console, so it parses the text as markup. [sources: src/devops_cli/output/console.py:470]
  • How should the row name survive Rich markup parsing?: Escape only the row name with rich.markup.escape before it goes into the row line. The badge keeps its Rich style markup. (best practice) [sources: src/devops_cli/commands/ci.py:564, src/devops_cli/output/console.py:470]
    • Chosen: Escape the row name with rich.markup.escape. It keeps the intentional badge markup and makes the literal name survive.
    • Rejected: Disable markup for the whole row line with markup=False. It also disables the badge colors, which the gate uses to show pass and fail.
    • Rejected: Build a rich.text.Text object with separate styled spans. It works but is more code than escaping the one literal segment.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/ci
    status/new
    value/medium
    effort/low
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The searches found no separate library for the CI gate row lines: the defect is that print_muted parses its argument as Rich markup, and Rich — the console library the project already prints through — already provides the markup escaping (and a markup=False / plain-text mode) that makes a literal [name] survive. Rich therefore covers the escaping half of the need, while the row-line change in ci.py/output.py stays with the project.

    The repository already uses this tool.

    Tool: Textualize/rich (https://github.com/Textualize/rich)

    • License: MIT
    • Last activity: 2026-11-13
    • Maintained: yes

    Covers:

    • Rich provides markup escaping (rich.markup.escape) so a literal [name] renders instead of being consumed as a style tag
    • Rich can print text with markup parsing turned off (markup=False / plain Text), which is the other way to keep [name] visible
    • print_muted in src/devops_cli/output.py is already a wrapper over a Rich console, so no new dependency is needed

    Lacks:

    • No external tool changes the gate row formatting in _execute_check_async; escaping or disabling markup in print_muted and passing the row name must be done in src/devops_cli/commands/ci.py and src/devops_cli/output.py
    • Rich markup parsing is itself the cause of the bug, so Rich alone does not fix the output until the project code escapes the row name

    Tools considered:

    Searches run:

    • rich markup escape literal square brackets print text, results: 5
    • Rich Python library escaping markup rich.markup.escape documentation, results: 5
    • rich.readthedocs.io markup escape, results: 5
    • Python Rich console markup square brackets removed from text fix, results: 5
    • Textualize rich console markup guide, results: 5

    Sources:

    Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.

  5. added
    status/ready
    and removed
    status/new
    on Nov 16, 2026
  6. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 9cc974b (see proposed design in issue body).

  7. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 17, 2026
  8. removed
    status/in-review
    on Nov 17, 2026
  9. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-17 19:36 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/cisource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions