← Back to Pull requests

docs: check missing prompts in man-page examples #29875

Merged
Garvity merged 46 files (404 lines) on Oct 06, 2026 20:34 UTC
View on GitHub
Garvity Garvity commented on Oct 01, 2026 15:19 UTC
Author

Fixes: #26428

Some commands inside existing man-page code fences were missing the $ or # prompt described in MANPAGE_SYNTAX.md. Added the missing prompts and documented how the new check works.

Added a check to xref-helpmsgs-manpages for fenced blocks in EXAMPLE and EXAMPLES sections.
It checks unlabelled blocks and blocks labelled sh, bash, shell, or console. After skipping blank lines and ### comments, it reports an error if the first remaining line starts with bare podman or sudo podman.
The error includes the file and line number.

Only that first remaining line is checked, since later lines may contain command output.
Blocks labelled for Windows shells are excluded from the Unix prompt check.
Added powershell labels to the existing Hyper-V example fences.

Added regression tests and included them in the tooling self-tests.
These tests do not need a built Podman binary or generated docs.

Also fixed the existing volume-prune test, which still looked for driver and opt rows that were removed from the man page. Using the existing label and until rows restores both checks for a misplaced negated filter and a duplicate filter entry.

<!-- Thanks for sending a pull request! -->

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:
<!-- Use [x] to mark as done, or click the checkbox after opening PR -->

  • I have read and understood our contributing guidelines and will not have more than two open PRs as a new contributor.

  • PR description, commit message, and GitHub comments are human-written, per LLM Policy

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all

  • commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)

  • Tests have been added/updated (or no tests are needed)

  • Documentation has been updated (or no documentation changes are needed)

  • All commits pass make validatepr (format/lint checks)

  • Release note entered in the section below (or None if no user-facing changes)
  • Does this PR introduce a user-facing change?

    <!--
    Write None if there are no user-facing changes, otherwise enter your release note below.
    Include "action required" if users need to take action when upgrading.
    -->

    ``release-note
    None
    ``

    Diff: 404 lines (+265 / -139) across 46 files Reviewer: Honny1 Review duration: 7515m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.67) × (1 − Review Confidence (0.76)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.67 · 404 lines diff across 46 files
    0.67
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.53 · 5 substantive comment(s)
    0.53
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    76%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.359
    Mass File Touch mass_file_touch
    0.080
    Real PR Conversation Timeline
    11 items
    Honny1 Honny1 commented on code on Oct 05, 2026 12:27 UTC
    Code Review
    Makefile:1
    @@ -284,6 +284,7 @@ help: ## Print this help message
     .check-self-tests:
     	hack/markdown-preprocess.t
     	hack/swagger-check.t
    +	hack/xref-helpmsgs-manpages-examples.t

    Update the Makefile comment above .check-self-tests. It still says only xref-helpmsgs-manpages.t is excluded because it needs a built podman; this PR adds xref-helpmsgs-manpages-examples.t to self-tests. A one-line note that example-prompt tests are split out would avoid confusing the next editor.

    Honny1 Honny1 commented on code on Oct 05, 2026 12:31 UTC
    Code Review
    hack/xref-helpmsgs-manpages:1
    @@ -571,9 +571,33 @@ sub podman_man {
         my $previous_flag = '';
         my $previous_format = '';
         my $previous_filter = '';
    +    my $fence = '';
    +    my $first_example_line = 0;
       LINE:
         while (my $line = <$fh>) {
             chomp $line;
    +        if ($fence) {
    +            if ($line =~ /^ {0,3}(`+|~+)[ \t]*$/
    +                && substr($1, 0, 1) eq substr($fence, 0, 1)
    +                && length($1) >= length($fence)) {
    +                $fence = '';
    +            }
    +            elsif ($first_example_line && $line =~ /\S/ && $line !~ /^\s*###\s/) {
    +                # Only inspect the first command: later lines may be output,
    +                # shell continuations, or the contents of a here-document.
    +                if ($line =~ /^\s*(?:sudo\s+)?podman(?:\s|$)/) {
    +                    warn "$ME: $subpath:$.: example command needs a '\$' (rootless) or '#' (root-only) prompt\n";

    What about PowerShell or Windows examples? Maybe it would be good to require labeled blocks?

    Honny1 Honny1 approved these changes on Oct 05, 2026 12:32 UTC
    Approved Reviewer

    I have some nonblocking nits. Otherwise LGTM!

    PTAL @podman-container-tools/podman-maintainers @podman-container-tools/podman-reviewers

    Garvity Garvity commented on code on Oct 05, 2026 14:07 UTC
    Code Review
    Makefile:1
    @@ -284,6 +284,7 @@ help: ## Print this help message
     .check-self-tests:
     	hack/markdown-preprocess.t
     	hack/swagger-check.t
    +	hack/xref-helpmsgs-manpages-examples.t

    Done! Added a comment explaining that the example-prompt tests are separate and do not require a built Podman binary or generated documentation.

    Garvity Garvity commented on code on Oct 05, 2026 14:13 UTC
    Code Review
    hack/xref-helpmsgs-manpages:1
    @@ -571,9 +571,33 @@ sub podman_man {
         my $previous_flag = '';
         my $previous_format = '';
         my $previous_filter = '';
    +    my $fence = '';
    +    my $first_example_line = 0;
       LINE:
         while (my $line = <$fh>) {
             chomp $line;
    +        if ($fence) {
    +            if ($line =~ /^ {0,3}(`+|~+)[ \t]*$/
    +                && substr($1, 0, 1) eq substr($fence, 0, 1)
    +                && length($1) >= length($fence)) {
    +                $fence = '';
    +            }
    +            elsif ($first_example_line && $line =~ /\S/ && $line !~ /^\s*###\s/) {
    +                # Only inspect the first command: later lines may be output,
    +                # shell continuations, or the contents of a here-document.
    +                if ($line =~ /^\s*(?:sudo\s+)?podman(?:\s|$)/) {
    +                    warn "$ME: $subpath:$.: example command needs a '\$' (rootless) or '#' (root-only) prompt\n";

    PowerShell and Windows examples are excluded from the Unix prompt check when their blocks have an explicit Windows language label. Without a label, a bare podman command would receive the $ / # prompt warning.

    I’ve added powershell labels to the four Hyper-V examples, documented the Windows labels, and added regression tests for this behaviour. Windows prompts themselves are not validated.

    Example blocks without a language label still receive the prompt check. For this update, I labelled the Windows examples touched by the PR. Would you prefer requiring language labels on all example blocks in this PR, or handling that separately?

    baude baude commented on Oct 05, 2026 18:20 UTC
    Contributor

    LGTM but I dont like the commit message; it seems machine generated.

    Honny1 Honny1 requested changes on Oct 06, 2026 09:34 UTC
    Changes Requested Reviewer

    LGTM, but please adjust the commit msg. Please refer to the issue in this format: Fixes: https://github.com/podman-container-tools/podman/issues/26428

    Garvity Garvity commented on Oct 06, 2026 10:10 UTC
    Author

    I have updated the commit message. PTAL @Honny1 @baude.

    Honny1 Honny1 approved these changes on Oct 06, 2026 11:37 UTC
    Approved Reviewer

    LGTM, Thanks!

    PTAL @baude @podman-container-tools/podman-maintainers

    mheon mheon commented on Oct 06, 2026 20:34 UTC
    Contributor

    LGTM

    Reviewers
    Assignees
    Garvity Garvity
    Labels
    risk: low confidence: 76.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 67.4% (HIGH) · Higher = larger blast radius
    67.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 76.3% · Lower = rushed or shallow review
    76.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.0% · Safe to merge
    16.0%