Skip to content

Refine docs command configuration and error handling - #20269

Merged
Jared Holgate (jaredfholgate) merged 2 commits into
mainfrom
jaredfholgate-docs-command-cleanup
Sep 8, 2026
Merged

Jared Holgate (jaredfholgate) merged 2 commits into
mainfrom
jaredfholgate-docs-command-cleanup

Conversation

@jaredfholgate

@jaredfholgate Jared Holgate (jaredfholgate) commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #20183 that incorporates Anthony's post-merge feedback and the useful parts of the closed reference #20223.

  • remove documentation-specific pseudo-diagnostic codes and use the normal CLI exception path for setup, rendering, and write failures
  • use the existing per-input diagnostic/SARIF flow used by other pattern-based commands
  • consolidate the docs command group and generation handler in DocsGenerateCommand
  • make bicepconfig.json the source of template file and include-root settings
  • keep custom template values invocation-specific through CLI options and JSON-RPC request values
  • remove documentation.template.values from configuration and reject it with an actionable error
  • retain the explicit Microsoft.Extensions.FileSystemGlobbing dependency because Bicep.Core uses it directly
  • preserve the released JSON-RPC response shape for compatibility

Behavior

--template-file and --template-root are removed. Templates are selected through documentation.template.file and documentation.template.includeRoot.

--custom-template-value and --custom-template-value-file-path remain repeatable and are applied in command-line order. JSON-RPC similarly accepts per-request custom values while resolving templates from bicepconfig.json.

Pattern compilation diagnostics continue to allow valid modules to render. Setup, template, filesystem, and write exceptions stop the command, matching existing CLI commands.

AVM tooling

Azure/azure-verified-modules-tools PR #101 updates the parity tooling to configure one dispatcher template through bicepconfig.json while keeping per-module values invocation-specific.

The final full validation used Azure/bicep-registry-modules commit 96a1dcb69b9bbb9c56638c4f5c457914d3e8bd21:

  • 573 eligible modules evaluated
  • 572 READMEs generated; all 572 matched byte-for-byte
  • one retained compiler failure in avm/ptn/app/container-job-toolkit
  • nine known parameter-model differences
  • one upstream README/test-metadata example-name drift in avm/ptn/sa/conversation-knowledge-mining
  • validation checkout configuration restored byte-for-byte with no tracked changes

Validation

  • full Bicep.sln build: 0 warnings, 0 errors
  • Bicep.Cli.IntegrationTests: 1,133 passed
  • Bicep.Core.UnitTests: 7,202 passed
  • Bicep.RpcClient.Tests: 95 passed, 1 skipped
  • pull request CI passed across CLI builds, .NET tests, live/e2e tests, VS Code, Visual Studio, playground, and NuGet packaging
Microsoft Reviewers: Open in CodeFlow

Keep templates in bicepconfig while allowing invocation-specific custom values, align diagnostics and failures with existing CLI behavior, consolidate command registration, and remove redundant direct globbing references.

Co-authored-by: Anthony Martin <38542602+anthony-c-martin@users.noreply.github.com>

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 008f3689-f779-43d5-a0ed-efffca450f72
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 34277737550)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 34277737550
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 34277737550"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 34277737550
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 34277737550"

Retain the direct Microsoft.Extensions.FileSystemGlobbing reference because Bicep.Core uses it directly instead of relying on another package's transitive dependency graph.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 008f3689-f779-43d5-a0ed-efffca450f72

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great, thank you!

@jaredfholgate
Jared Holgate (jaredfholgate) merged commit 1758d3a into main Sep 8, 2026
45 checks passed
@jaredfholgate
Jared Holgate (jaredfholgate) deleted the jaredfholgate-docs-command-cleanup branch September 8, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants