Skip to content

Redirect the legacy transaction guide - #147

Merged
GeorgianDusk merged 3 commits into
mainfrom
agent/seo-phase1-redirect
Sep 4, 2026
Merged

Redirect the legacy transaction guide#147
GeorgianDusk merged 3 commits into
mainfrom
agent/seo-phase1-redirect

Conversation

@GeorgianDusk

@GeorgianDusk GeorgianDusk commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an Astro static-build fallback from the legacy /learn/transactions/ route to the canonical DuskDS transaction-model guide
  • validate the generated fallback page itself: instant redirect, noindex, and canonical destination
  • document that the production HTTP redirect is owned by Cloudflare, since this repository uses Astro static output without an adapter

Production redirect

Deployed and enabled the Cloudflare Bulk Redirect list docs_legacy_redirects through rule docs_legacy_redirects_301.

Configured entries:

  • https://docs.dusk.network/learn/transactions
  • https://docs.dusk.network/learn/transactions/

Canonical target:

  • https://docs.dusk.network/learn/deep-dive/duskds-tx-models/

Both entries use HTTP 301 and preserve query strings. Live GET verification confirms:

  • the trailing-slash legacy URL redirects directly to the canonical URL
  • the no-slash URL is first normalized to the slash form by the zone's pre-existing Single Redirect rule, then redirects to the canonical URL
  • query strings survive the redirect path

The Cloudflare list contains both exact source variants. Cloudflare executes Single Redirects before Bulk Redirects, which explains the additional normalization hop for the no-slash request.

Validation

  • npm run verify passed
  • documentation build and link validation passed
  • all 4 machine-file tests passed
  • git diff --check passed
  • generated dist/learn/transactions/index.html contains the expected instant redirect, noindex, and canonical destination
  • GitHub Actions Build docs and validate links passed for 84283b7d5fcad11d76544d3c94fde4f7c7d6a650
  • production Cloudflare Bulk Redirect list is active with 2 entries

@GeorgianDusk
GeorgianDusk requested a review from HDauven September 3, 2026 12:04
@GeorgianDusk
GeorgianDusk marked this pull request as ready for review September 3, 2026 12:04
@GeorgianDusk
GeorgianDusk requested a lite review from Copilot September 3, 2026 12:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The redirect and its regression test currently cover only /learn/transactions and not the trailing-slash legacy route referenced in the PR description (/learn/transactions/).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the docs site’s redirect configuration to permanently route the legacy transactions guide URL to the canonical DuskDS transaction-models guide, and adds a regression test to prevent accidental removal of that redirect.

Changes:

  • Add a redirect from /learn/transactions to /learn/deep-dive/duskds-tx-models in astro.config.js.
  • Add a machine-file regression test that asserts the redirect mapping exists in the Astro config.
File summaries
File Description
astro.config.js Adds the legacy transactions redirect entry to the site redirect map.
test/machine-files.test.mjs Adds a regression test that checks the redirect is present in configuration.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread astro.config.js
Comment thread test/machine-files.test.mjs
@GeorgianDusk
GeorgianDusk requested review from Neotamandua and removed request for HDauven September 3, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The redirect/test currently assert a non-trailing-slash destination, which conflicts with the trailing-slash canonical target described in the PR and can introduce canonical/normalization inconsistencies.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

test/machine-files.test.mjs:57

  • The fallback page's canonical link is asserted without a trailing slash, but the canonical URL for this doc appears to be the trailing-slash form (.../duskds-tx-models/). Updating the assertion keeps the test consistent with the intended canonical URL.
  assert.match(
    redirectPage,
    /<link rel="canonical" href="https:\/\/docs\.dusk\.network\/learn\/deep-dive\/duskds-tx-models">/,
  );
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread astro.config.js Outdated
Comment thread test/machine-files.test.mjs
@GeorgianDusk
GeorgianDusk requested a lite review from Copilot September 3, 2026 13:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are small, consistent with the described Cloudflare-owned production redirect approach, and add a concrete build-output validation test.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

test/machine-files.test.mjs:52

  • The meta-refresh assertion is tightly coupled to a single HTML serialization (attribute order + double quotes + no whitespace). Since this is generated output, minor Astro/minifier changes could make the test fail without changing the redirect behavior; prefer a more tolerant regex that validates semantics.

This issue also appears on line 53 of the same file.

test/machine-files.test.mjs:57

  • The noindex and canonical assertions also depend on exact quoting/attribute formatting in the generated HTML. Using a slightly more flexible regex (like the existing sitemap assertion does) reduces false failures while still validating the page is noindex and points to the intended canonical URL.
  assert.match(redirectPage, /<meta name="robots" content="noindex">/);
  assert.match(
    redirectPage,
    /<link rel="canonical" href="https:\/\/docs\.dusk\.network\/learn\/deep-dive\/duskds-tx-models\/">/,
  );
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@GeorgianDusk
GeorgianDusk removed the request for review from HDauven September 3, 2026 13:37
@GeorgianDusk
GeorgianDusk merged commit ba6b217 into main Sep 4, 2026
2 checks passed
@GeorgianDusk
GeorgianDusk deleted the agent/seo-phase1-redirect branch September 4, 2026 06:57
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.

3 participants