Skip to content

fix: correct truncated help text for schema load/check commands - #1240

Open
qduk wants to merge 2 commits into
stablefrom
fix/schema-cli-short-help
Open

fix: correct truncated help text for schema load/check commands#1240
qduk wants to merge 2 commits into
stablefrom
fix/schema-cli-short-help

Conversation

@qduk

@qduk qduk commented Aug 12, 2026

Copy link
Copy Markdown

Why

The infrahubctl schema command list truncated the load and check
descriptions mid-sentence ("Load one or multiple schema files into...",
"Check if schema files are valid and what..."). This came from Click's
default short-help generation, which truncates the first line of a
command's docstring at 45 characters when no explicit short_help is
set — both docstrings exceed that limit.

What changed

  • Set explicit short_help strings on the schema load and schema check
    Typer commands in infrahub_sdk/ctl/schema.py so Click no longer falls
    back to its 45-character auto-truncation.
  • Regenerated docs/docs/infrahubctl/infrahubctl-schema.mdx via
    uv run invoke docs-generate to pick up the fix.
  • Added a changelog fragment.

What stayed the same: No other commands, options, or behavior changed —
this only affects the one-line summary shown in --help and the generated
docs.

How to review

  • infrahub_sdk/ctl/schema.py — the two short_help= additions.
  • docs/docs/infrahubctl/infrahubctl-schema.mdx — regenerated, diff is
    two lines.

How to test

uv run infrahubctl schema --help

Confirm the load and check lines read as complete sentences.

Impact & rollout

  • Backward compatibility: None — cosmetic help-text change only.
  • Performance: N/A
  • Config/env changes: None
  • Deployment notes: Safe to deploy anytime.

Checklist

  • Changelog entry added
  • Tests added/updated (not applicable — no testable behavior changed)
  • External docs updated (regenerated via docs-generate)
  • Internal .md docs updated (not applicable)

Summary by cubic

Fix truncated help text for infrahubctl schema load and check by adding explicit short_help, so the CLI and generated docs show complete sentences. Regenerated schema docs; no behavior changes.

Written for commit 402c255. Summary will update on new commits.

Review in cubic

Adam Byczkowski added 2 commits August 11, 2026 21:53
Click's default short-help truncates at 45 chars when no explicit
short_help is set, cutting "load" and "check" mid-sentence in the
`infrahubctl schema` command list. Set explicit short_help strings
so the generated docs read as complete sentences.
@qduk qduk added type/bug Something isn't working as expected type/documentation Improvements or additions to documentation labels Aug 12, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 402c255
Status: ✅  Deploy successful!
Preview URL: https://0d06b7fb.infrahub-sdk-python.pages.dev
Branch Preview URL: https://fix-schema-cli-short-help.infrahub-sdk-python.pages.dev

View logs

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##           stable    #1240      +/-   ##
==========================================
- Coverage   83.37%   82.54%   -0.84%     
==========================================
  Files         141      138       -3     
  Lines       13577    12186    -1391     
  Branches     2195     1833     -362     
==========================================
- Hits        11320    10059    -1261     
+ Misses       1642     1568      -74     
+ Partials      615      559      -56     
Flag Coverage Δ
integration-tests 40.56% <100.00%> (-0.19%) ⬇️
python-3.10 56.32% <100.00%> (-2.12%) ⬇️
python-3.11 56.32% <100.00%> (-2.12%) ⬇️
python-3.12 56.32% <100.00%> (-2.12%) ⬇️
python-3.13 56.32% <100.00%> (-2.12%) ⬇️
python-3.14 56.34% <100.00%> (-2.09%) ⬇️
python-filler-3.12 22.27% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/ctl/schema.py 62.82% <100.00%> (-12.75%) ⬇️

... and 8 files with indirect coverage changes

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@qduk
qduk marked this pull request as ready for review August 12, 2026 07:18
@qduk
qduk requested a review from a team as a code owner August 12, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug Something isn't working as expected type/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants