Skip to content

[CI] Run API-docs stub regeneration on Linux via Mono#144

Closed
mattleibow wants to merge 1 commit into
mainfrom
dev/linux-mdoc-regenerate-stubs
Closed

[CI] Run API-docs stub regeneration on Linux via Mono#144
mattleibow wants to merge 1 commit into
mainfrom
dev/linux-mdoc-regenerate-stubs

Conversation

@mattleibow

Copy link
Copy Markdown
Collaborator

What

Flip the regenerate-stubs job in auto-api-docs-writer from windows-latest to ubuntu-latest, running mdoc.exe under Mono.

This was the last non-Linux job across the SkiaSharp + SkiaSharp-API-docs doc pipeline. With this change the entire two-repo pipeline runs on Linux, matching the local Docker image and the SkiaSharp-side CI.

Why Windows was no longer needed

The job only used Windows because mdoc.exe is a .NET Framework tool. But:

  • mdoc.exe runs fine under Mono, and SkiaSharp's docs.cake already invokes it via mono.
  • The managed GTK# reference assemblies mdoc needs are supplied from NuGet by the cake comparer (passed to mdoc as --lib paths), so no system GTK# install is required. The Windows GTK# 2 MSI download/install was redundant.

So Mono is the only extra dependency.

Changes

  • regenerate-stubs: windows-latestubuntu-latest
  • Install mono-complete (apt) instead of the GTK# 2 MSI download/install
  • Drop the now-redundant dotnet tool restore and docs-download-output steps
  • Call the shared scripts/infra/docs/generate-api-docs.sh entry point instead of dotnet cake --target=update-docs
  • Use global.json for the .NET SDK and Linux-style nuget cache paths
  • Recompiled .lock.yml via gh aw compile

Merge order

⚠️ Depends on the companion SkiaSharp PR that adds scripts/infra/docs/generate-api-docs.sh (the Linux-everywhere doc-generation infra). That PR must merge first, otherwise the checked-out SkiaSharp tree won't have the script.

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

The `regenerate-stubs` job in auto-api-docs-writer ran on `windows-latest`
solely because mdoc.exe is a .NET Framework tool. That was the last
non-Linux job across the SkiaSharp + SkiaSharp-API-docs pipeline, leaving
this one workflow on a different OS than everything else that builds the
docs — different paths, different toolchain, harder to reproduce locally.

mdoc.exe runs fine under Mono, and SkiaSharp's docs.cake already invokes it
through `mono`, so the job does not actually need Windows. The managed GTK#
reference assemblies mdoc needs are supplied from NuGet by the cake comparer
(passed to mdoc as `--lib` paths), so no system GTK# install is required —
Mono is the only extra dependency.

Changes:
  - regenerate-stubs: windows-latest -> ubuntu-latest
  - install mono-complete (apt) instead of the GTK# 2 MSI download/install
  - drop the now-redundant `dotnet tool restore` and `docs-download-output`
    steps; call the shared `scripts/infra/docs/generate-api-docs.sh` entry
    point instead of `dotnet cake --target=update-docs`
  - use global.json for the .NET SDK and Linux-style nuget cache paths
  - recompiled the .lock.yml via `gh aw compile` (frontmatter hash updated)

This makes the entire two-repo doc-generation pipeline Linux-only, matching
the local Docker image and the SkiaSharp-side CI.

Note: depends on the companion SkiaSharp PR that adds
scripts/infra/docs/generate-api-docs.sh; that PR must merge first.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 5bcb571:

✅ Validation status: passed

File Status Preview URL Details
.github/workflows/auto-api-docs-writer.lock.yml ✅Succeeded
.github/workflows/auto-api-docs-writer.md ✅Succeeded

For more details, please refer to the build report.

@github-actions github-actions Bot closed this Jun 20, 2026
@github-actions github-actions Bot deleted the dev/linux-mdoc-regenerate-stubs branch June 20, 2026 00:08
mattleibow added a commit that referenced this pull request Jun 23, 2026
[CI] Run API-docs stub regeneration on Linux via Mono (#147)

Two related changes to the auto-api-docs-writer workflow: flip the
regenerate-stubs job to Linux, and stop the writer from running on pull
requests.

~~ Move regenerate-stubs from Windows to Linux ~~

This job was the last non-Linux job across the SkiaSharp + SkiaSharp-API-docs
doc pipeline; with it flipped, the entire two-repo pipeline runs on Linux,
matching the local Docker image and the SkiaSharp-side CI.

The job only used Windows because mdoc.exe is a .NET Framework tool, but that
requirement no longer holds:

  * mdoc.exe runs fine under Mono, and SkiaSharp's docs.cake already invokes it
    via `mono`.
  * The managed GTK# reference assemblies mdoc needs come from NuGet via the
    cake comparer (passed as --lib paths), so no system GTK# install is
    required — the Windows GTK# 2 MSI download/install was redundant.

So Mono (mono-complete via apt) is the only added dependency. The job now calls
the shared scripts/infra/docs/generate-api-docs.sh entry point instead of
`dotnet cake --target=update-docs`, uses global.json for the SDK and Linux-style
nuget cache paths, and drops the now-redundant `dotnet tool restore` and
docs-download-output steps.

Proven locally end-to-end on Linux (Docker, dotnet10 + mono-complete) against
this repo's stub tree: it correctly pruned the orphaned net6-only type files
(ActionHelper, FloatFloatActionHelper) and added the newer [Nullable]
attributes, and two consecutive runs produced byte-identical output
(hash ec15190a) — so the job is both correct and idempotent on Linux.

Prerequisite: the companion mono/SkiaSharp#4200, which adds
scripts/infra/docs/generate-api-docs.sh, has merged to main, so the checked-out
SkiaSharp tree now has the script.

~~ Drop the pull_request trigger ~~

The writer is a full agentic workflow: it regenerates stubs, fills placeholders
with AI, and opens a PR via gh-aw safe-outputs. When a PR edits this workflow,
the writer fires on that PR and then fails, because safe-outputs refuses to
create a PR that touches protected workflow files
(protect_top_level_dot_folders: true) — surfacing as a red safe_outputs check on
this very PR. Removing the pull_request trigger stops the writer running on PRs;
push:[main] still validates workflow edits after they land, and
workflow_dispatch + schedule are unaffected.

Recompiled .lock.yml via `gh aw compile` for both commits.

Supersedes #144, which gh-aw's recreate_ref:true auto-closed when a run was
dispatched on its branch; moved to the dedicated ci/linux-mdoc-regenerate-stubs
branch so the agentic placeholder-fill PRs reusing dev/linux-mdoc-regenerate-stubs
(e.g. #145) can't collide with it.

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant