Skip to content

Fix docs artifact upload paths#332

Merged
yuecideng merged 1 commit into
mainfrom
fix/docs-artifact-paths
Jun 26, 2026
Merged

Fix docs artifact upload paths#332
yuecideng merged 1 commit into
mainfrom
fix/docs-artifact-paths

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

This PR normalizes files mirrored from the published docs site before uploading the multi-version docs artifact. Recursive wget can save cache-busted URLs as literal filenames such as _static/clipboard.min.js?v=a7894cd8, and actions/upload-artifact rejects ? in artifact paths.

The fix strips URL query and fragment suffixes from mirrored filenames, replaces other artifact-invalid characters, and removes redundant query-string duplicates when the browser-addressable asset already exists.

Dependencies: none

Fixes the failed CI/CD Pipeline run that could not upload the docs site artifact.

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 .
  • pytest tests/docs -q --confcutdir=tests/docs

Strip query and fragment suffixes from files mirrored from the published docs site so GitHub artifact upload accepts the multi-version Pages artifact.
Copilot AI review requested due to automatic review settings June 26, 2026 05:02
@yuecideng yuecideng added bug Something isn't working ci labels Jun 26, 2026
@yuecideng yuecideng merged commit 04e0bc7 into main Jun 26, 2026
2 checks passed
@yuecideng yuecideng deleted the fix/docs-artifact-paths branch June 26, 2026 05:04

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 fixes GitHub Actions docs artifact uploads by normalizing filenames produced by recursive wget mirroring (e.g., assets saved with query strings like clipboard.min.js?v=...), which are rejected by actions/upload-artifact.

Changes:

  • Added normalize_artifact_paths() to strip URL query/fragment suffixes and replace GitHub-artifact-invalid characters in mirrored filenames.
  • Applied path normalization after copying/downloading published docs versions into the local multi-version build tree.
  • Added regression tests covering both renaming query-suffixed assets and deleting redundant query-string duplicates when the safe filename already exists.

Reviewed changes

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

File Description
docs/scripts/merge_published_site.py Adds and invokes artifact-path normalization during published-site merge/download flows.
tests/docs/conftest.py Re-exports the new normalization helper from the merge script for tests.
tests/docs/test_merge_published_site.py Adds regression tests for query-string filename normalization and duplicate removal.

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

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