Skip to content

V1.1.0/docfx - #19

Open
gimlichael wants to merge 8 commits into
mainfrom
v1.1.0/docfx
Open

gimlichael wants to merge 8 commits into
mainfrom
v1.1.0/docfx

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request introduces DocFX run-actions tooling and updates the API type examples so readers can execute each sample natively or in Docker.

DocFX run-actions:

  • Adds the run-actions build script, manifest, and settings to materialize native and Docker execution scripts for API examples.
  • Wires the generated run-actions content and template into the DocFX site configuration.

Runnable API examples:

  • Updates the type page examples to expose runnable Main entry points with public models and removes redundant availability includes.
  • Links each example page to its generated native and Docker run-action scripts.

Changelog:

  • Updates CHANGELOG.md for 1.1.0 with the new DocFX run-actions tooling and runnable example updates.

aicia-bot and others added 3 commits November 21, 2026 04:24
Type page examples now expose a Main entry point with public models, drop the redundant availability includes, and link to generated native and Docker run actions so readers can execute each sample.
Adds the run-actions manifest, settings and build script, and wires the run-actions content and template into docfx.json so example pages can publish native and Docker run scripts.
@gimlichael gimlichael self-assigned this Nov 21, 2026
@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes reach the DocFX build and five API example pages, not Carter's request-processing runtime.

The PR should not merge until the previously reported compile error in the endpoint example is fixed.

Fix All in CodexFindings

  1. P1 Endpoint example cannot compile ▶
  2. P2 Stopped hosts pass the check ▶
Fix with agent prompt
### Issue 1
.docfx/run-actions.manifest.json:undefined-51
The new runnable source imports both `Codebelt.Extensions.Carter` and `Microsoft.AspNetCore.Builder`, which each define `EndpointConventionBuilderExtensions`. The unqualified `EndpointConventionBuilderExtensions.Produces<OrderSummary>(...)` call fails with `CS0104`, so neither run script can show the response metadata.

Use `fakeBuilder.Produces<OrderSummary>(...)`, as the repository tests do, or fully qualify the class. Update both the embedded source here and the example page.

### Issue 2
.docfx/BuildRunActions.ps1:379-382
When a host example sets `probePath` to an empty string, `WaitForExit` returns early if the app stops. This check accepts exit code zero, then reports that the host ran for the full `startupDelayMs`. A sample that forgets to keep the host running therefore passes. Reject any exit during the observation period, regardless of exit code.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds native and Docker run scripts to the DocFX API examples.

  • DocFX builds native and Docker scripts for each listed example.
  • API examples now run directly as small programs.
  • Example pages offer copy buttons and script previews.

Reviews (3) · Last reviewed commit: "🔨 update docfx run-actions materializer..." · Reviewed by Greptile

"dependsOn": [
"Codebelt.Extensions.Carter@1.1.0"
],
"source": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Codebelt.Extensions.Carter;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Http.Metadata;\nusing Microsoft.AspNetCore.Routing;\nusing Microsoft.AspNetCore.Routing.Patterns;\n\nnamespace DocfxExample;\n\npublic static class ProducesExtensionExample\n{\n public static void Main()\n {\n var endpointBuilder = new RouteEndpointBuilder(\n context => Task.CompletedTask,\n RoutePatternFactory.Parse(\"/api/orders\"),\n 0);\n\n var fakeBuilder = new FakeEndpointConventionBuilder();\n EndpointConventionBuilderExtensions.Produces<OrderSummary>(fakeBuilder, StatusCodes.Status200OK, \"application/json\");\n fakeBuilder.Produces(StatusCodes.Status404NotFound);\n\n foreach (var convention in fakeBuilder.Conventions)\n {\n convention(endpointBuilder);\n }\n\n foreach (var metadata in endpointBuilder.Metadata.OfType<IProducesResponseTypeMetadata>())\n {\n Console.WriteLine(\n $\"Status: {metadata.StatusCode}, \" +\n $\"Type: {metadata.Type?.Name ?? \"(none)\"}, \" +\n $\"ContentTypes: {string.Join(\", \", metadata.ContentTypes)}\");\n }\n }\n\n private sealed class FakeEndpointConventionBuilder : IEndpointConventionBuilder\n {\n public List<Action<EndpointBuilder>> Conventions { get; } = [];\n public void Add(Action<EndpointBuilder> convention) => Conventions.Add(convention);\n }\n}\n\npublic sealed record OrderSummary(int Id, string Name);"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Endpoint example cannot compile

The new runnable source imports both Codebelt.Extensions.Carter and Microsoft.AspNetCore.Builder, which each define EndpointConventionBuilderExtensions. The unqualified EndpointConventionBuilderExtensions.Produces<OrderSummary>(...) call fails with CS0104, so neither run script can show the response metadata.

Use fakeBuilder.Produces<OrderSummary>(...), as the repository tests do, or fully qualify the class. Update both the embedded source here and the example page.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .docfx/run-actions.manifest.json
Line: 45

Comment:
**Endpoint example cannot compile**

The new runnable source imports both `Codebelt.Extensions.Carter` and `Microsoft.AspNetCore.Builder`, which each define `EndpointConventionBuilderExtensions`. The unqualified `EndpointConventionBuilderExtensions.Produces<OrderSummary>(...)` call fails with `CS0104`, so neither run script can show the response metadata.

Use `fakeBuilder.Produces<OrderSummary>(...)`, as the repository tests do, or fully qualify the class. Update both the embedded source here and the example page.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d6cc571) to head (e9a86a9).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #19   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines           82        82           
  Branches         3         3           
=========================================
  Hits            82        82           

☔ View full report in Codecov by Harness.
📢 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.

The image build script now generates run-actions via BuildRunActions.ps1 and removes generated artifacts in a finally block so failed builds leave no residue.
Registers the modern template overlay and adds the run-actions script so published examples can be run natively or in Docker.
DocFX renders the Examples heading automatically from the example front matter mapping, so the manual heading produced a duplicate section.
Clarifies that example headings are generated by DocFX and that INCLUDE directives are only allowed on namespace pages.
Regenerate DocFX run-actions artifacts to sync host-harness support in BuildRunActions.ps1 and add exampleId, uid, and fenceOrdinal metadata to run-actions.manifest.json.
Comment on lines +379 to +382
if ($hostProcess.HasExited -and $hostProcess.ExitCode -ne 0) {
$stdOut = $stdoutTask.GetAwaiter().GetResult()
$errOut = $stderrTask.GetAwaiter().GetResult()
throw "Host exited with code $($hostProcess.ExitCode). $stdOut $errOut"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Stopped hosts pass the check

When a host example sets probePath to an empty string, WaitForExit returns early if the app stops. This check accepts exit code zero, then reports that the host ran for the full startupDelayMs. A sample that forgets to keep the host running therefore passes. Reject any exit during the observation period, regardless of exit code.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .docfx/BuildRunActions.ps1
Line: 379-382

Comment:
**Stopped hosts pass the check**

When a host example sets `probePath` to an empty string, `WaitForExit` returns early if the app stops. This check accepts exit code zero, then reports that the host ran for the full `startupDelayMs`. A sample that forgets to keep the host running therefore passes. Reject any exit during the observation period, regardless of exit code.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Codex

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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