Skip to content

Commit 224fd5a

Browse files
authored
Merge pull request #46 from webstackdev/feature/messaging
Messaging and notification feature
2 parents ba81e0d + 63506e8 commit 224fd5a

300 files changed

Lines changed: 5381 additions & 315 deletions

File tree

Some content is hidden

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

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"botocore",
66
"bsky",
77
"buildx",
8+
"cbor",
89
"cbranch",
910
"cfgv",
1011
"cstat",
@@ -48,7 +49,9 @@
4849
"ormsgpack",
4950
"PRAW",
5051
"psycopg",
52+
"pyasn",
5153
"pylint",
54+
"pyopenssl",
5255
"PYTHONDONTWRITEBYTECODE",
5356
"PYTHONUNBUFFERED",
5457
"pytokens",
@@ -66,6 +69,8 @@
6669
"solomonstre",
6770
"svix",
6871
"topicv",
72+
"txaio",
73+
"ujson",
6974
"Unparseable",
7075
"unstub",
7176
"upserted",
@@ -76,6 +81,7 @@
7681
"vfarcic",
7782
"Viktor",
7883
"xrpc",
79-
"xxhash"
84+
"xxhash",
85+
"zope"
8086
]
8187
}

core/api_urls.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
from ingestion.api_urls import (
1212
register_project_routes as register_ingestion_project_routes,
1313
)
14+
from messaging.api_urls import register_root_routes as register_messaging_root_routes
1415
from newsletters.api_urls import (
1516
register_project_routes as register_newsletters_project_routes,
1617
)
18+
from notifications.api_urls import (
19+
register_root_routes as register_notifications_root_routes,
20+
)
1721
from pipeline.api_urls import (
1822
register_project_routes as register_pipeline_project_routes,
1923
)
@@ -30,6 +34,8 @@
3034

3135
router = DefaultRouter()
3236
register_projects_root_routes(router)
37+
register_notifications_root_routes(router)
38+
register_messaging_root_routes(router)
3339

3440
project_router = NestedSimpleRouter(router, r"projects", lookup="project")
3541
register_projects_project_routes(project_router)

core/tests/test_entrypoints.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import os
33
import sys
44

5+
from channels.routing import ProtocolTypeRouter
6+
57
from newsletter_maker.celery import app
68

79

@@ -22,7 +24,10 @@ def test_asgi_module_sets_default_settings_and_builds_application(mocker):
2224
"DJANGO_SETTINGS_MODULE", "newsletter_maker.settings"
2325
)
2426
get_app_mock.assert_called_once_with()
25-
assert module.application == "asgi-app"
27+
assert module.django_asgi_application == "asgi-app"
28+
assert isinstance(module.application, ProtocolTypeRouter)
29+
assert module.application.application_mapping["http"] == "asgi-app"
30+
assert "websocket" in module.application.application_mapping
2631

2732

2833
def test_wsgi_module_sets_default_settings_and_builds_application(mocker):

deploy/argocd/newsletter-maker-staging-application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ spec:
2020
prune: true
2121
selfHeal: true
2222
syncOptions:
23-
- CreateNamespace=true
23+
- CreateNamespace=true

deploy/helm/newsletter-maker/templates/configmap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ data:
1010
CSRF_TRUSTED_ORIGINS: {{ .Values.env.csrfTrustedOrigins | quote }}
1111
SITE_ID: {{ .Values.env.siteId | quote }}
1212
REDIS_URL: {{ include "newsletter-maker.redisUrl" . | quote }}
13+
CHANNEL_LAYER_URL: {{ default (include "newsletter-maker.redisUrl" .) .Values.env.channelLayerUrl | quote }}
1314
QDRANT_URL: {{ include "newsletter-maker.qdrantUrl" . | quote }}
15+
MESSAGING_ENABLED: {{ .Values.env.messagingEnabled | quote }}
1416
NEWSLETTER_API_BASE_URL: {{ .Values.env.newsletterApiBaseUrl | quote }}
1517
EMAIL_BACKEND: {{ .Values.env.emailBackend | quote }}
1618
DEFAULT_FROM_EMAIL: {{ .Values.env.defaultFromEmail | quote }}

deploy/helm/newsletter-maker/templates/service-monitor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ spec:
2020
bearerTokenSecret:
2121
name: {{ include "newsletter-maker.secretName" . }}
2222
key: METRICS_TOKEN
23-
{{- end }}
23+
{{- end }}

deploy/helm/newsletter-maker/values-staging.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
debug: "false"
88
allowedHosts: "staging.newsletter-maker.example.com"
99
csrfTrustedOrigins: "https://staging.newsletter-maker.example.com"
10+
messagingEnabled: "true"
1011
newsletterApiBaseUrl: "https://staging.newsletter-maker.example.com"
1112
logLevel: INFO
1213

@@ -23,4 +24,4 @@ networkPolicy:
2324
serviceMonitor:
2425
enabled: true
2526
labels:
26-
release: kube-prometheus-stack
27+
release: kube-prometheus-stack

deploy/helm/newsletter-maker/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
allowedHosts: "localhost,127.0.0.1"
1212
csrfTrustedOrigins: "http://localhost,http://127.0.0.1"
1313
siteId: "1"
14+
channelLayerUrl: ""
15+
messagingEnabled: "true"
1416
newsletterApiBaseUrl: "http://newsletter-maker.local"
1517
emailBackend: anymail.backends.resend.EmailBackend
1618
defaultFromEmail: onboarding@resend.dev

frontend/src/app/(home)/_components/ContentFeed/index.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ export const Empty: Story = {
3838
filteredContents: [],
3939
contentClusterLookup: new Map(),
4040
},
41-
}
41+
}

frontend/src/app/(home)/_components/ContentFeed/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ describe("ContentFeed", () => {
4343
expect(screen.getByText("reference")).toBeInTheDocument()
4444
expect(screen.getByRole("button", { name: "Upvote" })).toBeInTheDocument()
4545
})
46-
})
46+
})

0 commit comments

Comments
 (0)