Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"botocore",
"bsky",
"buildx",
"cbor",
"cbranch",
"cfgv",
"cstat",
Expand Down Expand Up @@ -48,7 +49,9 @@
"ormsgpack",
"PRAW",
"psycopg",
"pyasn",
"pylint",
"pyopenssl",
"PYTHONDONTWRITEBYTECODE",
"PYTHONUNBUFFERED",
"pytokens",
Expand All @@ -66,6 +69,8 @@
"solomonstre",
"svix",
"topicv",
"txaio",
"ujson",
"Unparseable",
"unstub",
"upserted",
Expand All @@ -76,6 +81,7 @@
"vfarcic",
"Viktor",
"xrpc",
"xxhash"
"xxhash",
"zope"
]
}
6 changes: 6 additions & 0 deletions core/api_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
from ingestion.api_urls import (
register_project_routes as register_ingestion_project_routes,
)
from messaging.api_urls import register_root_routes as register_messaging_root_routes
from newsletters.api_urls import (
register_project_routes as register_newsletters_project_routes,
)
from notifications.api_urls import (
register_root_routes as register_notifications_root_routes,
)
from pipeline.api_urls import (
register_project_routes as register_pipeline_project_routes,
)
Expand All @@ -30,6 +34,8 @@

router = DefaultRouter()
register_projects_root_routes(router)
register_notifications_root_routes(router)
register_messaging_root_routes(router)

project_router = NestedSimpleRouter(router, r"projects", lookup="project")
register_projects_project_routes(project_router)
Expand Down
7 changes: 6 additions & 1 deletion core/tests/test_entrypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import os
import sys

from channels.routing import ProtocolTypeRouter

from newsletter_maker.celery import app


Expand All @@ -22,7 +24,10 @@ def test_asgi_module_sets_default_settings_and_builds_application(mocker):
"DJANGO_SETTINGS_MODULE", "newsletter_maker.settings"
)
get_app_mock.assert_called_once_with()
assert module.application == "asgi-app"
assert module.django_asgi_application == "asgi-app"
assert isinstance(module.application, ProtocolTypeRouter)
assert module.application.application_mapping["http"] == "asgi-app"
assert "websocket" in module.application.application_mapping


def test_wsgi_module_sets_default_settings_and_builds_application(mocker):
Expand Down
2 changes: 1 addition & 1 deletion deploy/argocd/newsletter-maker-staging-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ spec:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- CreateNamespace=true
2 changes: 2 additions & 0 deletions deploy/helm/newsletter-maker/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ data:
CSRF_TRUSTED_ORIGINS: {{ .Values.env.csrfTrustedOrigins | quote }}
SITE_ID: {{ .Values.env.siteId | quote }}
REDIS_URL: {{ include "newsletter-maker.redisUrl" . | quote }}
CHANNEL_LAYER_URL: {{ default (include "newsletter-maker.redisUrl" .) .Values.env.channelLayerUrl | quote }}
QDRANT_URL: {{ include "newsletter-maker.qdrantUrl" . | quote }}
MESSAGING_ENABLED: {{ .Values.env.messagingEnabled | quote }}
NEWSLETTER_API_BASE_URL: {{ .Values.env.newsletterApiBaseUrl | quote }}
EMAIL_BACKEND: {{ .Values.env.emailBackend | quote }}
DEFAULT_FROM_EMAIL: {{ .Values.env.defaultFromEmail | quote }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ spec:
bearerTokenSecret:
name: {{ include "newsletter-maker.secretName" . }}
key: METRICS_TOKEN
{{- end }}
{{- end }}
3 changes: 2 additions & 1 deletion deploy/helm/newsletter-maker/values-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
debug: "false"
allowedHosts: "staging.newsletter-maker.example.com"
csrfTrustedOrigins: "https://staging.newsletter-maker.example.com"
messagingEnabled: "true"
newsletterApiBaseUrl: "https://staging.newsletter-maker.example.com"
logLevel: INFO

Expand All @@ -23,4 +24,4 @@ networkPolicy:
serviceMonitor:
enabled: true
labels:
release: kube-prometheus-stack
release: kube-prometheus-stack
2 changes: 2 additions & 0 deletions deploy/helm/newsletter-maker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ env:
allowedHosts: "localhost,127.0.0.1"
csrfTrustedOrigins: "http://localhost,http://127.0.0.1"
siteId: "1"
channelLayerUrl: ""
messagingEnabled: "true"
newsletterApiBaseUrl: "http://newsletter-maker.local"
emailBackend: anymail.backends.resend.EmailBackend
defaultFromEmail: onboarding@resend.dev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export const Empty: Story = {
filteredContents: [],
contentClusterLookup: new Map(),
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ describe("ContentFeed", () => {
expect(screen.getByText("reference")).toBeInTheDocument()
expect(screen.getByRole("button", { name: "Upvote" })).toBeInTheDocument()
})
})
})
2 changes: 1 addition & 1 deletion frontend/src/app/(home)/_components/ContentFeed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ export function ContentFeed({
})}
</div>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export const Filtered: Story = {
sourceFilter: "rss",
duplicateStateFilter: "duplicate_related",
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ describe("DashboardFilterToolbar", () => {
expect(container.querySelector('input[name="source"]')).toHaveValue("rss")
expect(container.querySelector('input[name="days"]')).toHaveValue("30")
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ export function DashboardFilterToolbar({
</CardContent>
</Card>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export default meta

type Story = StoryObj<typeof meta>

export const Default: Story = {}
export const Default: Story = {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ describe("DashboardOverview", () => {
expect(screen.getByText("Tracked entities")).toBeInTheDocument()
expect(screen.getByText("5/2")).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ export function DashboardOverview({
))}
</section>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export default meta

type Story = StoryObj<typeof meta>

export const Default: Story = {}
export const Default: Story = {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ describe("DashboardSidebar", () => {
expect(screen.getByText("Active sources")).toBeInTheDocument()
expect(screen.getByText("Editorial queue")).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export function DashboardSidebar({
</Card>
</aside>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ export const ReviewView: Story = {
args: {
view: "review",
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ describe("HomePageContent", () => {
expect(screen.getByText("borderline_relevance")).toBeInTheDocument()
expect(screen.getByRole("button", { name: "Approve" })).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ export function HomePageContent({
)}
</AppShell>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ export const Empty: Story = {
pendingReviewItems: [],
contentMap: new Map(),
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ describe("ReviewQueueTable", () => {
expect(screen.getByRole("button", { name: "Approve" })).toBeInTheDocument()
expect(screen.getByRole("button", { name: "Reject" })).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ export function ReviewQueueTable({
</Table>
</section>
)
}
}
2 changes: 1 addition & 1 deletion frontend/src/app/(home)/_components/shared.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ describe("buildContentClusterLookup", () => {
velocityScore: 0.8,
})
})
})
})
2 changes: 1 addition & 1 deletion frontend/src/app/(home)/_components/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ export function buildContentClusterLookup(clusterDetails: TopicClusterDetail[])
}

return lookup
}
}
2 changes: 1 addition & 1 deletion frontend/src/app/(home)/page.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ export const WithFlashMessages: Story = {
errorMessage: "Filter failed",
successMessage: "Filters applied",
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ describe("SourceDiversityPanel", () => {
screen.getByText("No source-diversity snapshots exist for this project yet."),
).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ export const Empty: Story = {
statusLabel: "idle",
statusTone: "neutral",
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ describe("SourceHealthPanel", () => {
screen.getByText("No source configurations exist for this project yet."),
).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ export function SourceHealthPanel({
</CardContent>
</Card>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ export const NoSnapshots: Story = {
statusTone: "neutral",
statusLabel: "idle",
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ describe("TopicCentroidPanel", () => {
screen.getByText("No centroid snapshot history exists for this project yet."),
).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@ export function TopicCentroidPanel({
</Card>
</>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ export const Empty: Story = {
summary: createSummary({ run_count: 0, failed_run_count: 0, latest_runs: [] }),
visibleRuns: [],
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ describe("TrendTaskRunsPanel", () => {
screen.getByText("No trend task run history exists for this project yet."),
).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,4 @@ export function TrendTaskRunsPanel({
</Card>
</>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export default meta

type Story = StoryObj<typeof meta>

export const Default: Story = {}
export const Default: Story = {}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ describe("NewProjectFormCard", () => {
expect(redirectInput).toHaveAttribute("name", "redirectTo")
expect(redirectInput).toHaveAttribute("type", "hidden")
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ export function NewProjectFormCard() {
</CardContent>
</Card>
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ export const Error: Story = {
tone: "error",
children: "A project with that name already exists.",
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ describe("ProjectFlashNotice", () => {
screen.getByText("Project created. You are now the first project admin."),
).toBeInTheDocument()
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export function ProjectFlashNotice({ tone, children }: ProjectFlashNoticeProps)
<AlertDescription>{children}</AlertDescription>
</Alert>
)
}
}
2 changes: 1 addition & 1 deletion frontend/src/app/admin/projects/new/page.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ function NewProjectPagePreview({
<NewProjectFormCard />
</AppShell>
)
}
}
Loading
Loading