Skip to content

Cover the rest of the legacy paths - #193

Merged
neuromechanist merged 1 commit into
mainfrom
feat/legacy-path-coverage
Jul 26, 2026
Merged

neuromechanist merged 1 commit into
mainfrom
feat/legacy-path-coverage

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Extends the legacy rewrite (#190 §2) past /dataexplorer/detail. Follow-up to #192.

The gap

getLegacyRedirect matched exactly one path. After cutover everything else on the legacy site would 404 on the new apex — including /dataexplorer itself, likely the second-most-linked legacy URL after dataset pages.

I probed the live legacy origin to find what actually exists rather than guessing:

/dataexplorer 200   /resources 200   /tools 200   /members 200
/groups 200         /citations 200   /about 200   /support 302   /login 200

Three outcomes, by whether the new site has a counterpart

legacy path goes to status why
/dataexplorer/detail?dataset_id=X /dataset/X 301 direct equivalent; the citation target
/dataexplorer, /dataexplorer/* /discover 301 direct successor
/resources /tools /members /groups /citations ww1 302 no counterpart — content exists only on legacy
/about /support /login not touched — exist on both; the new site's own pages serve them

That last row is the one worth checking against src/pages/: redirecting them would hide current content behind the retired version. I verified the overlap by listing the new site's routes rather than assuming.

302 for the ww1-bound ones is deliberate. ww1 is temporary (the live notice retires it 30 September). A cached permanent redirect would outlive the host it points at, with no way to reach the clients holding it — the hazard from #183, which is also why the ww1 bounce in #192 is a 302.

Explicit list, not a catch-all

LEGACY_ONLY_PREFIXES is enumerated rather than "anything the new site doesn't route". A catch-all would sweep up genuine 404s and any future route added here before its page lands, turning a clear error into a confusing round trip to a legacy site that also lacks the path.

Testing

903 passing (19 new), typecheck / lint / build clean.

Covers each outcome, subpath matching, prefix-collision rejection (/toolsmith and /resources-new must not match), the both-sites paths staying untouched, and the ww1-referrer rule now applying across every legacy path rather than only dataset detail.

Verified against a running server:

/dataexplorer/detail?dataset_id=ds007964   301 -> /dataset/ds007964
/dataexplorer                              301 -> /discover
/dataexplorer/browse?tag=eeg               301 -> /discover
/resources                                 302 -> https://ww1.nemar.org/resources
/tools/matlab                              302 -> https://ww1.nemar.org/tools/matlab
/about, /support, /discover                200
/toolsmith                                 404   (correctly not swept to legacy)

with Referer: ww1.nemar.org
/dataexplorer                              302 -> https://ww1.nemar.org/dataexplorer
/resources                                 302 -> https://ww1.nemar.org/resources

Still pending, not blocked by this

The ww1-bound redirects only become useful once the legacy server serves ww1.nemar.org — today it 302s every non-apex hostname back to nemar.org, and its pages emit <base href="https://nemar.org/…">. Request sent to the SDSC admin (Apache ServerAlias + HUBzero $live_site). This PR is safe to land meanwhile: those paths don't exist on this build, so the rules are unreachable until the apex moves.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: ab8e372
Status: ✅  Deploy successful!
Preview URL: https://549e2772.nemar-website.pages.dev
Branch Preview URL: https://feat-legacy-path-coverage.nemar-website.pages.dev

View logs

@neuromechanist
neuromechanist merged commit 412b146 into main Jul 26, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the feat/legacy-path-coverage branch July 26, 2026 00:34
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