Skip to content

🔩 Guard documentation moves with redirect autofixes - #44

Draft
JFWooten4 wants to merge 1 commit into
automation/pr-autofixfrom
minuette-redirect-guard
Draft

JFWooten4 wants to merge 1 commit into
automation/pr-autofixfrom
minuette-redirect-guard

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Summary

Stacked on stellar#2767 (automation/pr-autofix). This PR does not change that parent branch or its existing description.

  • Detect removed and renamed documentation pages during PR checks and verify preservation of their former URLs.
  • Generate narrowly scoped permanent Nginx redirects only when a moved page has an unambiguous live destination. Flag unsupported slugs, missing successors, broken targets, and redirect loops for manual review.
  • Add a human-readable comment beside every generated rule explaining why the old URL is preserved and linking to the originating PR, following Remove OZ token example pages, link to OZ docs stellar/stellar-docs#2705 (comment).
  • Integrate redirect changes into the existing read-only prepare / privileged apply autofix flow. The privileged step independently regenerates the Nginx patch from the trusted default-branch checker and requires an exact match before accepting it; it does not run PR-provided checker code.
  • Add a standalone PR-time redirect regression check and six unit/integration tests.

Regression

This covers the missing old SDEX liquidity URL after stellar#1637 (stellar#2854). The regression reproduces a failed check before a redirect is added and passes once the equivalent fix from stellar#2858 is in place. The autofixer preserves the original URL through a permanent rewrite to the Fundamentals destination.

Validation

python3 -m unittest discover -s tests -p test_doc_redirects.py — six tests passed locally. Also verified this commit is one commit ahead of, with five actual changed files relative to, the parent branch.

PR-autofix bot commits remain contingent on the parent workflow's PR_AUTOFIX_TOKEN and maintainer edit permissions.

Write PR descriptions automatically.

Guard moved and removed documentation routes, generate contextual permanent Nginx redirects only for unambiguous moves, and prevent untrusted redirect patches from bypassing privileged validation. Add SDEX regression tests and read-only PR checks.

Co-authored-by: ChatGPT 6 <noreply@openai.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