Skip to content

doc(console): Adds add_renderable example and apply-live demo#15

Merged
EspenAlbert merged 9 commits into
mainfrom
add-renderable-help
May 19, 2026
Merged

doc(console): Adds add_renderable example and apply-live demo#15
EspenAlbert merged 9 commits into
mainfrom
add-renderable-help

Conversation

@EspenAlbert
Copy link
Copy Markdown
Owner

@EspenAlbert EspenAlbert commented May 19, 2026

Summary

  • Adds tested example docs for add_renderable at docs/examples/console/add_renderable.md: dynamic __rich_console__ renderables, wiring into the live region, and CI vs TTY rendering notes.
  • Adds examples/apply_live/, a standalone Typer demo (no tfdo import) that streams terraform apply -json -auto-approve through ask-shell message_callbacks with skip_progress_output=True.
  • Includes a Terraform workspace with four chained time_sleep resources (~20s fresh apply) and a minimal NDJSON stream handler using add_renderable locally plus logger.info heartbeats when interactive_shell() is false.
  • Registers the example in pkg-ext (examples_include), mkdocs nav, and ask_shell/test_docs.py.
  • Adds just apply-live and a CI job that runs checkout, setup, Terraform 1.12.1 (terraform_wrapper: false), and just apply-live with CI=true.

apply-live demo

Run locally from code/ask-shell/:

just apply-live
CI=true just apply-live   # heartbeat log lines instead of live panel

The CLI always runs terraform init -input=false before apply so a clean checkout works without a separate init step. Re-run after the first apply is a no-op; reset with terraform destroy -auto-approve in examples/apply_live/workspace/.

Test plan

  • uv run pytest ask_shell/test_docs.py -k add_renderable
  • uv run pytest examples/apply_live/stream_handler_test.py
  • just pre-commit-ask
  • CI=true just apply-live (local)
  • CI apply-live job on GitHub Actions

@EspenAlbert EspenAlbert changed the title todo update me with the PR title for branch add-renderable-help doc(console): Adds add_renderable example and apply-live demo May 19, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 19, 2026

Codecov Report

❌ Patch coverage is 85.80247% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.61%. Comparing base (dfcb93f) to head (e1e0ab3).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
examples/apply_live/stream_handler.py 84.28% 22 Missing ⚠️
ask_shell/_internal/rich_live.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
+ Coverage   85.56%   85.61%   +0.04%     
==========================================
  Files          20       21       +1     
  Lines        1878     2037     +159     
==========================================
+ Hits         1607     1744     +137     
- Misses        271      293      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…ist[ShellRunCallbackT] | None, and removed the now-unused ShellRunEventT import. Pyright passes cleanly.
@EspenAlbert EspenAlbert marked this pull request as ready for review May 19, 2026 10:03
@EspenAlbert EspenAlbert merged commit a362abc into main May 19, 2026
18 checks passed
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.

2 participants