Skip to content

Fix nested release docs paths#334

Merged
yuecideng merged 1 commit into
mainfrom
fix/docs-version-flatten
Jun 26, 2026
Merged

Fix nested release docs paths#334
yuecideng merged 1 commit into
mainfrom
fix/docs-version-flatten

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

This PR fixes the release docs disappearing from the published version selector after the docs artifact upload fix.

Root cause from the successful main run 28218982772:

  • recursive wget -nH preserved the GitHub Pages repository path and produced docs/build/html/EmbodiChain/v0.2.2
  • wget returned exit 8 after downloading usable pages, so the previous script returned before promoting that nested directory
  • generate_versions_json.py only scans top-level v* directories, so it generated a manifest with only main

This PR flattens repo-prefixed release directories from restored cache and partially downloaded wget output before versions.json is generated.

Dependencies: none

Fixes the live docs issue where v0.2.2 is deployed under /EmbodiChain/EmbodiChain/v0.2.2/ instead of /EmbodiChain/v0.2.2/.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Screenshots

N/A

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

Verification

  • black .
  • black --check docs/scripts/merge_published_site.py tests/docs/conftest.py tests/docs/test_merge_published_site.py
  • pytest tests/docs -q --confcutdir=tests/docs

Copilot AI review requested due to automatic review settings June 26, 2026 05:43
@yuecideng yuecideng added bug Something isn't working ci labels Jun 26, 2026

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

This PR updates the docs site merge script to handle GitHub Pages “repo-prefixed” nested version directories (e.g., build/html/EmbodiChain/v0.2.2) so release versions are discovered and included in versions.json after cache restore / wget downloads.

Changes:

  • Add flatten_nested_version_dirs() to promote nested v* directories to the build root and clean up empty directories.
  • Adjust _download_version_wget() to attempt to use partially downloaded content even when wget exits non-zero (e.g., exit 8), including flattening + normalization.
  • Add tests covering cache-restored nested directories and the wget non-zero exit salvage behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
docs/scripts/merge_published_site.py Adds nested version directory flattening, reuses cleanup helper, and updates wget handling to proceed on partial downloads.
tests/docs/conftest.py Exposes flatten_nested_version_dirs from the script module for tests.
tests/docs/test_merge_published_site.py Adds regression tests for flattening nested cached versions and salvaging wget exit 8 output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +155 to +163
for candidate in candidates:
target = build_dir / candidate.name
if target.exists():
shutil.rmtree(candidate)
changes.append((candidate, None))
else:
candidate.rename(target)
changes.append((candidate, target))

Comment on lines 191 to 193
if result.returncode != 0:
print(f"wget failed for {url} (exit {result.returncode})", file=sys.stderr)
return

Promote repo-prefixed version directories restored from cache or partially downloaded by wget so versions.json discovers release docs at the top-level path.
@yuecideng yuecideng force-pushed the fix/docs-version-flatten branch from ff089ff to 968aada Compare June 26, 2026 06:00
@yuecideng yuecideng merged commit 982c6cb into main Jun 26, 2026
4 of 5 checks passed
@yuecideng yuecideng deleted the fix/docs-version-flatten branch June 26, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants