Skip to content

Commit eac0cbf

Browse files
committed
Fix #14596: Remove pocket-mode
1 parent 6facfc9 commit eac0cbf

File tree

230 files changed

+136
-12282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+136
-12282
lines changed

.github/workflows/fluent_linter.yml

-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ on:
33
push:
44
paths:
55
- "l10n/en/**.ftl"
6-
- "l10n-pocket/en/**.ftl"
76
- ".github/l10n/*"
87
- ".github/workflows/fluent_linter.yml"
98
branches:
109
- main
1110
pull_request:
1211
paths:
1312
- "l10n/en/**.ftl"
14-
- "l10n-pocket/en/**.ftl"
1513
- ".github/l10n/*"
1614
- ".github/workflows/fluent_linter.yml"
1715
branches:
@@ -33,7 +31,3 @@ jobs:
3331
- name: Lint mozilla.org files
3432
run: |
3533
moz-fluent-lint l10n/en --config .github/l10n/linter_config.yml
36-
- name: Lint Pocket files
37-
if: always() # This step should run even if the previous one fails
38-
run: |
39-
moz-fluent-lint l10n-pocket/en --config .github/l10n/linter_config.yml

.github/workflows/integration_tests.yml

-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ on:
1717
mozorg_service_hostname:
1818
description: The root URL of the Mozorg service to run tests against
1919
required: true
20-
pocket_service_hostname:
21-
description: The root URL of the Pocket service to run tests against
22-
required: true
2320
jobs:
2421
notify-of-test-run-start:
2522
runs-on: ubuntu-latest
@@ -64,7 +61,6 @@ jobs:
6461

6562
env:
6663
BASE_URL: ${{ github.event.inputs.mozorg_service_hostname }}
67-
BASE_POCKET_URL: ${{ github.event.inputs.pocket_service_hostname }}
6864
BROWSER_NAME: ${{ matrix.BROWSER_NAME }}
6965
CI_JOB_ID: ${{ github.run_id }}
7066
DRIVER: ${{ matrix.DRIVER }}

.github/workflows/send_mozorg_fluent_strings_to_l10n_org.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
- uses: actions/checkout@v4
2222
- name: Run PR-opening script
2323
shell: bash
24-
run: SITE_MODE=Mozorg FLUENT_REPO_AUTH=${{ secrets.FLUENT_REPO_AUTH }} bin/open-ftl-pr.sh
24+
run: FLUENT_REPO_AUTH=${{ secrets.FLUENT_REPO_AUTH }} bin/open-ftl-pr.sh

.github/workflows/send_pocket_fluent_strings_to_l10n_org.yml

-24
This file was deleted.

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ repos:
7474
hooks:
7575
- id: fluent_linter
7676
files: \.ftl$
77-
args: [--config, .github/l10n/linter_config.yml, l10n/en/, l10n/en-US/, l10n-pocket/en/]
77+
args: [--config, .github/l10n/linter_config.yml, l10n/en/, l10n/en-US/]
7878
- repo: https://github.com/pre-commit/mirrors-prettier
7979
rev: v3.1.0
8080
hooks:

Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ COPY manage.py LICENSE newrelic.ini ./
8787
COPY ./docker ./docker
8888
COPY ./bedrock ./bedrock
8989
COPY ./l10n ./l10n
90-
COPY ./l10n-pocket ./l10n-pocket
9190
COPY ./media ./media
9291

9392

Makefile

+1-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ DC_CI = "bin/docker-compose.sh"
22
DC = $(shell which docker) compose
33
DOCKER = $(shell which docker)
44
TEST_DOMAIN = www.mozilla.org
5-
POCKET_MODE = Pocket
65

76
# Check if 'uv' exists and set the command accordingly
87
ifneq (, $(shell which uv 2>/dev/null))
@@ -71,20 +70,12 @@ pull: .env
7170

7271
rebuild: clean build
7372

74-
# Run in Mozorg-only mode, using Bedrock to serve ONLY Mozorg pages
7573
run: .docker-build-pull
7674
${DC} up assets app
7775

7876
run-prod: .docker-build-pull
7977
${DC} up release-local
8078

81-
# Run in Pocket-only mode, using Bedrock to serve ONLY Pocket pages _at the root path_
82-
run-pocket: .docker-build-pull
83-
-SITE_MODE=${POCKET_MODE} ${DC} up assets app
84-
85-
run-pocket-prod: .docker-build-pull
86-
-SITE_MODE=${POCKET_MODE} ${DC} up release-local
87-
8879
stop:
8980
${DC} stop
9081

@@ -213,4 +204,4 @@ install-custom-git-hooks:
213204
uninstall-custom-git-hooks:
214205
rm .git/hooks/post-merge
215206

216-
.PHONY: all clean build pull docs livedocs build-docs lint run stop kill run-shell shell test test-image rebuild build-ci test-ci fresh-data djshell run-prod run-pocket run-pocket-prod build-prod test-cdn compile-requirements check-requirements install-local-python-deps preflight clean-local-deps install-custom-git-hooks uninstall-custom-git-hooks run-local-task-queue
207+
.PHONY: all clean build pull docs livedocs build-docs lint run stop kill run-shell shell test test-image rebuild build-ci test-ci fresh-data djshell run-prod build-prod test-cdn compile-requirements check-requirements install-local-python-deps preflight clean-local-deps install-custom-git-hooks uninstall-custom-git-hooks run-local-task-queue

bedrock/base/i18n.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ def normalize_language(language):
7070
if not language:
7171
return None
7272

73-
if settings.IS_POCKET_MODE:
74-
lang_code = language.lower()
75-
else:
76-
lang_code = language
73+
lang_code = language
7774

7875
if lang_code in settings.LANGUAGE_URL_MAP_WITH_FALLBACKS:
7976
return settings.LANGUAGE_URL_MAP_WITH_FALLBACKS[lang_code]

bedrock/base/tests/test_i18n.py

-76
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from lib.l10n_utils import translation
2121

2222

23-
@override_settings(IS_MOZORG_MODE=True, IS_POCKET_MODE=False)
2423
@pytest.mark.parametrize(
2524
"lang_code, expected",
2625
(
@@ -68,81 +67,6 @@ def test_normalize_language_mozorg_mode(lang_code, expected):
6867
assert normalize_language(lang_code) == expected
6968

7069

71-
@override_settings(
72-
IS_MOZORG_MODE=False,
73-
IS_POCKET_MODE=True,
74-
LANGUAGE_URL_MAP_WITH_FALLBACKS={
75-
# patch in what we set in settings.__init__
76-
"de": "de",
77-
"en": "en",
78-
"es": "es",
79-
"es-la": "es-la",
80-
"fr-ca": "fr-ca",
81-
"fr": "fr",
82-
"it": "it",
83-
"ja": "ja",
84-
"ko": "ko",
85-
"nl": "nl",
86-
"pl": "pl",
87-
"pt-br": "pt-br",
88-
"pt": "pt",
89-
"ru": "ru",
90-
"zh-cn": "zh-cn",
91-
"zh-tw": "zh-tw",
92-
},
93-
)
94-
@pytest.mark.parametrize(
95-
"lang_code, expected",
96-
(
97-
(None, None),
98-
("", None), # General normalization
99-
("de", "de"),
100-
("de-DE", "de"),
101-
("DE", "de"),
102-
("en", "en"),
103-
("en-US", "en"),
104-
("EN", "en"),
105-
("es", "es"),
106-
("ES", "es"),
107-
("es-la", "es-la"),
108-
("es-LA", "es-la"),
109-
("ES-LA", "es-la"),
110-
("fr-ca", "fr-ca"),
111-
("fr-CA", "fr-ca"),
112-
("FR-CA", "fr-ca"),
113-
("fr", "fr"),
114-
("FR", "fr"),
115-
("it", "it"),
116-
("IT", "it"),
117-
("ja", "ja"),
118-
("JA", "ja"),
119-
("ko", "ko"),
120-
("KO", "ko"),
121-
("nl", "nl"),
122-
("NL", "nl"),
123-
("pl", "pl"),
124-
("PL", "pl"),
125-
("pt-br", "pt-br"),
126-
("pt-BR", "pt-br"),
127-
("PT-BR", "pt-br"),
128-
("pt", "pt"),
129-
("PT", "pt"),
130-
("pt-PT", "pt"),
131-
("PT-PT", "pt"),
132-
("ru", "ru"),
133-
("RU", "ru"),
134-
("zh-cn", "zh-cn"),
135-
("zh-CN", "zh-cn"),
136-
("ZH-CN", "zh-cn"),
137-
("zh-tw", "zh-tw"),
138-
("zh-TW", "zh-tw"),
139-
("ZH-TW", "zh-tw"),
140-
),
141-
)
142-
def test_normalize_language_pocket_mode(lang_code, expected):
143-
assert normalize_language(lang_code) == expected
144-
145-
14670
@pytest.mark.parametrize(
14771
"path, expected",
14872
(

bedrock/cms/tests/test_decorators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from bedrock.cms.decorators import prefer_cms
1212
from bedrock.cms.tests import decorator_test_views
1313
from bedrock.mozorg.util import page
14-
from bedrock.urls.mozorg_mode import urlpatterns as mozorg_urlpatterns
14+
from bedrock.urls import urlpatterns as mozorg_urlpatterns
1515

1616
from .factories import SimpleRichTextPageFactory
1717

bedrock/legal_docs/models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def get_doc(self, doc_name, locale):
7575
doc = self.get(name=doc_name, locale=locale)
7676

7777
all_locales = list(self.filter(name=doc_name).values_list("locale", flat=True))
78-
if "en" in all_locales and settings.IS_MOZORG_MODE:
79-
# legal-docs now uses "en" but the Mozorg site needs en-US. (Pocket needs "en")
78+
if "en" in all_locales:
79+
# legal-docs now uses "en" but the Mozorg site needs en-US.
8080
all_locales[all_locales.index("en")] = "en-US"
8181

8282
# filter locales not active on the site

bedrock/legal_docs/tests/test_base.py

-13
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def test_legal_doc_exists(self):
3131
self.assertEqual(doc["content"], "You're not wrong Walter...")
3232
self.assertEqual(doc["active_locales"], ["en-US"])
3333

34-
@override_settings(IS_MOZORG_MODE=True)
3534
def test_legal_doc_exists_en_locale__mozorg_mode(self):
3635
"""Should return the content of the "en" file and say the active locale is "en-US" if in Mozorg Mode"""
3736
LegalDoc.objects.create(
@@ -43,18 +42,6 @@ def test_legal_doc_exists_en_locale__mozorg_mode(self):
4342
self.assertEqual(doc["content"], "You're not wrong Walter...")
4443
self.assertEqual(doc["active_locales"], ["en-US"])
4544

46-
@override_settings(IS_MOZORG_MODE=False, PROD_LANGUAGES=["en", "de", "hi-IN"])
47-
def test_legal_doc_exists_en_locale__pocket_mode(self):
48-
"""Should return the content of the "en" file and say the active locale is "en" if in Pocket Mode"""
49-
LegalDoc.objects.create(
50-
name="the_dude_exists",
51-
locale="en",
52-
content="You're not wrong Walter...",
53-
)
54-
doc = views.load_legal_doc("the_dude_exists", "en")
55-
self.assertEqual(doc["content"], "You're not wrong Walter...")
56-
self.assertEqual(doc["active_locales"], ["en"])
57-
5845
def test_legal_doc_exists_snake_case_convert(self):
5946
"""Should return the content of the file if it exists in snake case."""
6047
LegalDoc.objects.create(

bedrock/legal_docs/views.py

+4-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
from django.conf import settings
65
from django.http import Http404
76
from django.views.generic import TemplateView
87

@@ -55,16 +54,10 @@ def get_legal_doc(self):
5554

5655
def render_to_response(self, context, **response_kwargs):
5756
response_kwargs.setdefault("content_type", self.content_type)
58-
_ftl_files = []
59-
if settings.IS_MOZORG_MODE:
60-
_ftl_files = [
61-
"mozorg/about/legal",
62-
"privacy/index",
63-
]
64-
elif settings.IS_POCKET_MODE:
65-
_ftl_files = [
66-
"pocket/legal",
67-
]
57+
_ftl_files = [
58+
"mozorg/about/legal",
59+
"privacy/index",
60+
]
6861
return l10n_utils.render(
6962
self.request,
7063
self.get_template_names()[0],

bedrock/pocket/__init__.py

-3
This file was deleted.

bedrock/pocket/forms.py

-24
This file was deleted.

bedrock/pocket/templates/pocket/404.html

-31
This file was deleted.

bedrock/pocket/templates/pocket/500.html

-30
This file was deleted.

0 commit comments

Comments
 (0)