Skip to content

fix(docfx): remove redundant standalone cleanup step#100

Closed
Chris-Wolfgang wants to merge 4 commits into
mainfrom
fix/docfx-remove-redundant-cleanup-step
Closed

fix(docfx): remove redundant standalone cleanup step#100
Chris-Wolfgang wants to merge 4 commits into
mainfrom
fix/docfx-remove-redundant-cleanup-step

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Summary

Mirrors repo-template#342. Removes the standalone "Clean up stale root files from gh-pages" step in docfx.yaml because the deploy step already does identical cleanup in its own worktree.

Why

On every release with deploy_as_latest=true, gh-pages was receiving two commits + two Pages rebuilds:

  1. chore: clean up stale root DocFX assets before redeploy [skip ci] (standalone cleanup)
  2. docs: deploy <version> and update latest (deploy step — also re-cleaned in its fresh worktree)

The deploy step already does the exact same Get-ChildItem | Where-Object | Remove-Item cleanup at lines 360-363 of docfx.yaml (well, those line numbers were before this PR — the cleanup is now closer to the top of the deploy step). The standalone step's cleanup commit was redundant duplication, and its only meaningful behavior was to expose a partial-cleanup window — if the deploy failed after the standalone step pushed, gh-pages was stuck in cleaned-but-no-fresh-content state.

Impact

  • ✅ One commit + push per release (atomic deploy)
  • ✅ Half the pages-build-deployment rebuilds
  • ✅ Eliminates the partial-cleanup window
  • ✅ ~60 fewer lines of YAML

Why now

Caught by Copilot review on PR #95 (lines 234, 282 — both call sites of the cleanup-push). Fix lands locally rather than waiting for a template-sync wave so IEnumerable doesn't carry the redundancy between now and then.

Note about the protected-files guard

Touches .github/workflows/docfx.yaml so the Detect .NET Projects guard will fail it. Maintainer override required.

Test plan

  • Maintainer override + merge
  • Either order with repo-template#342 is fine; both end up with the same fix
  • Verify on next release that gh-pages receives one commit per deploy

Mirrors repo-template#342 — same fix into IEnumerable-Extensions's
docfx.yaml. The standalone 'Clean up stale root files from gh-pages'
step did identical cleanup logic to what the deploy step already
performs in its own worktree, just in a separate commit + push.

Removing it gives:
- One commit + push per release (not two)
- Half the pages-build-deployment rebuilds
- Atomic deploy (no partial-cleanup window)
- ~60 fewer lines of YAML

Caught by Copilot review on PR #95.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 9, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes a redundant gh-pages “stale root cleanup” step from the DocFX deployment workflow, relying on the existing cleanup that already occurs inside the single-commit deploy step to avoid double commits / double Pages rebuilds and reduce the risk of a partial-cleanup state.

Changes:

  • Deleted the standalone “Clean up stale root files from gh-pages” step.
  • Kept root cleanup behavior consolidated within the “Deploy docs to GitHub Pages” step (single worktree/repo state, single push).

Copilot AI review requested due to automatic review settings May 14, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@Chris-Wolfgang

Copy link
Copy Markdown
Owner Author

Superseded by the C1 template-drift re-sync. The canonical repo-template docfx.yaml no longer contains the redundant 'Clean up stale root files from gh-pages' step (removed upstream). PR #135 re-syncs docfx.yaml from canonical, delivering this removal. Closing as superseded; deleting the branch.

@Chris-Wolfgang Chris-Wolfgang deleted the fix/docfx-remove-redundant-cleanup-step branch May 22, 2026 15:12
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