Repository: mdn/kuma

Issue:
Remove old Firefox Accounts documentation
@clouserw commented on [Wed Jul 01 2020](https://github.com/mdn/sprints/issues/3459)

# Request type
<!-- Select the appropriate option -->
- [ ] Please close this issue, I accidentally submitted it without adding any details
- [ ] New documentation
- [x] Correction or update

# Details

https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Firefox_Accounts

This page (and sub-pages) are about Firefox Accounts and are created from[ some outdated documentation](https://mozilla.github.io/application-services/docs/accounts/welcome.html) that we'll be removing soon.  Please remove these pages from MDN.  If possible, please redirect requests to our new documentation: https://mozilla.github.io/ecosystem-platform/docs/welcome

Thank you

/cc @rfk

---

@chrisdavidmills commented on [Thu Jul 02 2020](https://github.com/mdn/sprints/issues/3459#issuecomment-652873931)

Sure thing @clouserw ! I've moved these pages to the MDN archive already: https://wiki.developer.mozilla.org/en-US/docs/Archive/Mozilla/Firefox/Accounts

@escattone, please can you hard redirect the above page and all its children to https://mozilla.github.io/ecosystem-platform/docs/welcome ?

Thanks.

---

@escattone commented on [Thu Jul 02 2020](https://github.com/mdn/sprints/issues/3459#issuecomment-653098217)

Will do Dr. Mills! (aka @chrisdavidmills). I'll post a comment here when that's done.




Discussion:

Resolving patch:
diff --git a/kuma/redirects/redirects.py b/kuma/redirects/redirects.py
--- a/kuma/redirects/redirects.py
+++ b/kuma/redirects/redirects.py
@@ -1157,11 +1157,27 @@ def locale_redirect(pattern, to, prepend_locale=True, **kwargs):
     )
 ]
 
+firefox_accounts_redirectpatterns = [
+    external_redirect(
+        r"(?:docs/)?Mozilla/Firefox_Accounts_OAuth_Dashboard(?:/|$)",
+        "https://mozilla.github.io/ecosystem-platform/docs/welcome",
+    ),
+    external_redirect(
+        r"(?:docs/)?Mozilla/(?:Tech/)?Firefox_Accounts(?:/|$)",
+        "https://mozilla.github.io/ecosystem-platform/docs/welcome",
+    ),
+    external_redirect(
+        r"(?:docs/)?Archive/Mozilla/Firefox/Accounts(?:/|$)",
+        "https://mozilla.github.io/ecosystem-platform/docs/welcome",
+    ),
+]
+
 redirectpatterns = (
     scl3_redirectpatterns
     + zone_redirectpatterns
     + marionette_redirectpatterns
     + webextensions_redirectpatterns
+    + firefox_accounts_redirectpatterns
     + [
         locale_redirect(
             r"^fellowship", "/docs/Archive/2015_MDN_Fellowship_Program", permanent=True


Test patch:
diff --git a/tests/headless/map_301.py b/tests/headless/map_301.py
--- a/tests/headless/map_301.py
+++ b/tests/headless/map_301.py
@@ -939,3 +939,22 @@
         )
     )
 )
+
+FIREFOX_ACCOUNTS_URLS = list(
+    flatten(
+        (
+            url_test(
+                "{/en-US,}/{docs/,}Mozilla/Firefox_Accounts_OAuth_Dashboard{/,}",
+                "https://mozilla.github.io/ecosystem-platform/docs/welcome",
+            ),
+            url_test(
+                "{/en-US,/pl,}/{docs/,}Mozilla/{Tech/,}Firefox_Accounts{/Introduction,/Atttached_APIs,/WebExtensions,}",
+                "https://mozilla.github.io/ecosystem-platform/docs/welcome",
+            ),
+            url_test(
+                "{/en-US,/pl,}/{docs/,}Archive/Mozilla/Firefox/Accounts{/Introduction,/Atttached_APIs,/WebExtensions,}",
+                "https://mozilla.github.io/ecosystem-platform/docs/welcome",
+            ),
+        )
+    )
+)
diff --git a/tests/headless/test_redirects.py b/tests/headless/test_redirects.py
--- a/tests/headless/test_redirects.py
+++ b/tests/headless/test_redirects.py
@@ -4,6 +4,7 @@
 
 from .map_301 import (
     DEFAULT_SAMPLES_URLS,
+    FIREFOX_ACCOUNTS_URLS,
     GITHUB_IO_URLS,
     LEGACY_URLS,
     MARIONETTE_URLS,
@@ -103,3 +104,13 @@ def test_marionette_redirects(url, base_url):
 def test_webext_redirects(url, base_url):
     url["base_url"] = base_url
     assert_valid_url(**url)
+
+
+@pytest.mark.headless
+@pytest.mark.nondestructive
+@pytest.mark.parametrize(
+    "url", FIREFOX_ACCOUNTS_URLS, ids=[item["url"] for item in FIREFOX_ACCOUNTS_URLS]
+)
+def test_firefox_accounts_redirects(url, base_url):
+    url["base_url"] = base_url
+    assert_valid_url(**url)