Skip to content

Improve CLI runtime list rendering#1461

Merged
ChiragAgg5k merged 2 commits intomasterfrom
feat/cli-runtime-list-rendering
Apr 18, 2026
Merged

Improve CLI runtime list rendering#1461
ChiragAgg5k merged 2 commits intomasterfrom
feat/cli-runtime-list-rendering

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

What does this PR do?

Improves the CLI rendering for appwrite functions list-runtimes by adding a dedicated structured renderer for the runtimes collection.

Instead of falling back to the verbose per-item key/value block, the command now renders a compact aligned table with the fields that are most useful when choosing a runtime:

  • runtime
  • id
  • base
  • image

It also adds a CLI regression test that asserts this renderer is used and that the old verbose layout is no longer emitted for runtime lists.

Test Plan

  • vendor/bin/phpunit tests/CLIBun13Test.php
  • vendor/bin/phpunit tests/CLIBun10Test.php tests/CLIBun11Test.php
  • docker run --rm -v $(pwd):/app -w /app php:8.3-cli php example.php cli

Before

appwrite functions list-runtimes
total  4

runtimes (4)
  [1]
    $id      node-16.0
    key      node
    name     Node.js
    version  16.0
    base     node:16.20.2-alpine3.18
    image    openruntimes/node:v5-16.0
    logo     node.png
  [2]
    $id      node-18.0
    key      node
    name     Node.js
    version  18.0
    base     node:18.20.4-alpine3.20
    image    openruntimes/node:v5-18.0
    logo     node.png
  [3]
    $id      python-3.12
    key      python
    name     Python
    version  3.12
    base     python:3.12.6-alpine3.20
    image    openruntimes/python:v5-3.12
    logo     python.png
  [4]
    $id      flutter-3.41
    key      flutter
    name     Flutter
    version  3.41
    base     ghcr.io/cirruslabs/flutter:3.41.0
    image    openruntimes/flutter:v5-3.41
    logo     flutter.png

After

appwrite functions list-runtimes
total  4

runtimes (4)
  runtime           id            base                               image
  [1] Node.js 16.0  node-16.0     node:16.20.2-alpine3.18            openruntimes/node:v5-16.0
  [2] Node.js 18.0  node-18.0     node:18.20.4-alpine3.20            openruntimes/node:v5-18.0
  [3] Python 3.12   python-3.12   python:3.12.6-alpine3.20           openruntimes/python:v5-3.12
  [4] Flutter 3.41  flutter-3.41  ghcr.io/cirruslabs/flutter:3.41.0  openruntimes/flutter:v5-3.41

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 18, 2026

Greptile Summary

This PR adds a dedicated runtimes structured renderer to the CLI, replacing the verbose per-item key/value block with a compact aligned table showing runtime, id, base, and image columns. The implementation follows the established pattern exactly (schema → label helper → createColumnRenderer entry) and is accompanied by a regression test that both asserts the new format is present and that the old verbose tokens are absent.

Confidence Score: 5/5

Safe to merge — the change is additive, schema-validated, and covered by regression tests across three Bun suites.

All findings are P2 or lower. The implementation faithfully mirrors every other structured renderer in the file, the schema validation fallback is preserved, and the test covers both positive and negative assertions with a proper async guard.

No files require special attention.

Important Files Changed

Filename Overview
templates/cli/lib/response-config.ts Adds RuntimeSummarySchema, runtimeLabel helper, and a "runtimes" entry in structuredCollectionRenderers — follows the exact same pattern as existing renderers (identities, sessions, logs, etc.). Logic is sound.
tests/languages/cli/test.js Adds captureStdoutSync helper plus inclusion/exclusion token assertions for the new runtime table layout. Async guard is present. Forbidden-token patterns are tight enough to catch old verbose output.
tests/Base.php Adds CLI_RUNTIME_RENDERING_RESPONSES constant used by the three Bun test suites.
tests/CLIBun10Test.php Spreads CLI_RUNTIME_RENDERING_RESPONSES into the expected response array — trivial, correct.
tests/CLIBun11Test.php Same as CLIBun10Test — adds runtime rendering expectation.
tests/CLIBun13Test.php Same as CLIBun10Test — adds runtime rendering expectation.

Reviews (2): Last reviewed commit: "Clarify sync-only CLI stdout capture hel..." | Re-trigger Greptile

Comment thread tests/languages/cli/test.js
@ChiragAgg5k ChiragAgg5k merged commit ef782ac into master Apr 18, 2026
56 checks passed
@ChiragAgg5k ChiragAgg5k deleted the feat/cli-runtime-list-rendering branch April 18, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant