Skip to content

[docs-site] Skip PR staging previews for non-site file changes - #4321

Merged
mattleibow merged 1 commit into
mainfrom
dev/site-skip-noncontent-pr-previews
Jul 2, 2026
Merged

mattleibow merged 1 commit into
mainfrom
dev/site-skip-noncontent-pr-previews

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Problem

The Pages - Deploy workflow builds a full ~470 MB staging preview (DocFX + 3 WASM apps) for every PR — there is no path filter. In practice most open PRs change tests/, native/, scripts/, benchmarks/ or .github/ — none of which alter the rendered site — yet each still produced a preview. The previews accumulated to 5.6 GB on the docs-live branch and pushed the aggregate GitHub Pages artifact past the 1 GB limit, which broke the Pages - Go Live! deploy (upload-size warning → timeout).

I analysed the 11 staging previews that existed at the time: 0 of 11 touched rendered docs, release notes, /ai/, or gallery samples; 4 of 11 changed nothing on the site at all.

Change

Add a conservative paths-ignore exclude to the pull_request trigger. This is deliberately fail-safe — paths-ignore skips the run only if EVERY changed file matches the list, so anything we did not anticipate still gets a full preview. We start with the exclude (not a positive paths: allow-list) precisely so a missed path fails toward building, not toward skipping.

Only paths verified to never feed any site output are excluded:

  • tests/**, benchmarks/** — not built for the site
  • documentation/dev/** — not in the DocFX content root (docfx.json renders documentation/docfx/** only)
  • non-WASM native/* platforms (ios, macos, tvos, tizen, android, linux*, windows, winui*, maccatalyst, nanoserver) — the galleries are WASM only; the WASM native libs come from native/wasm/**, scripts/infra/native/{wasm,shared}/** and externals/skia
  • repo meta docs: README.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md
  • .agents/**, cgmanifest.json

Not excluded (so they still build a preview): documentation/docfx/** (incl. release notes), documentation/site/** (landing + /ai/), samples/**, binding/**, source/**, native/wasm/**, scripts/infra/native/{wasm,shared}/**, externals/skia, and .github/workflows/build-site.yml.

push: main is intentionally not filtered, so the live site always redeploys.

Safety notes

  • Not a required check — Build Site is not in branch protection (license/cla and SkiaSharp (Public) are), so a skipped run cannot block a merge.
  • Replaying the 11 recent PRs against this list: only the tests-only PR (Document threading test purpose and intentional non-disposal #4106) would have skipped its preview; every other PR still builds because it also touches a non-excluded path. That is the intended cautious behaviour for a first pass.

Follow-ups (not in this PR)

  • Widen the exclude (e.g. specific scripts/** subtrees, other root metadata) once we are comfortable.
  • Optionally slim previews: ~52 % of each 470 MB folder is the 3 WASM apps; docs-only PRs could skip the gallery/fiddle builds and stage just /docs/.
  • Make the stale-sweep size-aware (cap the number of live previews), since the 90-day window alone can't prevent a size pileup from many active PRs.

The Pages Deploy workflow builds a full ~470 MB staging preview (DocFX +
3 WASM apps) for every PR, with no path filter. Recent open PRs were mostly
tests/native/CI/benchmark changes that cannot alter the rendered site, yet
each still produced a preview — the previews accumulated to 5.6 GB and pushed
the aggregate Pages artifact over the 1 GB limit, breaking the Go Live deploy.

Add a conservative paths-ignore EXCLUDE to the pull_request trigger. It is
fail-safe: the full build still runs unless EVERY changed file matches the
list, so anything not anticipated still gets a preview. Only paths verified to
never feed any site output are excluded:

- tests/**, benchmarks/**            (not built for the site)
- documentation/dev/**               (not in the docfx content root)
- native/<non-wasm platforms>/**     (galleries are WASM only; WASM native
                                      comes from native/wasm + externals/skia)
- repo meta docs (README, CONTRIBUTING, CODE_OF_CONDUCT, SECURITY)
- .agents/**, cgmanifest.json

Pushes to main are intentionally NOT filtered, so the live site always
redeploys. binding/**, source/**, samples/**, documentation/{docfx,site}/**,
native/wasm/**, scripts/infra/native/{wasm,shared}/** and externals/skia are
NOT excluded, so anything that can change /docs/, the release notes, /ai/, or
the gallery/fiddle apps still builds a preview.

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4321

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4321"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4321/packages --name skiasharp-pr-4321
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4321

@mattleibow
mattleibow merged commit 7356c75 into main Jul 2, 2026
3 checks passed
@mattleibow
mattleibow deleted the dev/site-skip-noncontent-pr-previews branch July 2, 2026 19:33
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been deployed and is available at:

🔗 View Staging Site
🔗 View Staging Docs
🔗 View Staging Gallery (Blazor)
🔗 View Staging Gallery (Uno Platform)
🔗 View Staging SkiaFiddle

This preview will be updated automatically when you push new commits to this PR.


This comment is automatically updated by the documentation staging workflow.

mattleibow pushed a commit that referenced this pull request Jul 3, 2026
Brings in the 7 commits that landed on main after this sync branch was
originally cut (yesterday's automated main-tip run):
- e00fa55 [skia-sync] Merge upstream chrome/m151 bug fixes (#4312)
- a1ecb75 docs: regenerate API diffs and polish release notes (#4322)
- 1c49b4a Remove unnecessary 'unsafe' modifier from GRContextOptions (#3991)
- 2d15749 Update docs submodule to latest main (#4304)
- 7356c75 [docs-site] Skip PR staging previews for non-site file changes (#4321)
- a95cc35 [docs-site] Add 'Moving faster with AI' dashboard to the AI page (#4318)
- 72ce599 [infra] Remove obsolete skiasharp-docker registry auth (#4310)

Conflicts resolved:
- cgmanifest.json: took origin/main (will be overwritten by
  update-versions.ps1 in the next commit with the new sync SHAs).
- externals/skia: took ours (90a2d04943 is a descendant of 98877992a5
  from PR #4312 via the corresponding submodule merge PR #278).
- docs submodule pointer: took origin/main (b64a0266c from PR #4304).

Co-authored-by: Copilot <[email protected]>
@mattleibow mattleibow added this to the 4.151.0-preview.2 milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant