Skip to content

Commit be1ff1b

Browse files
committed
fix: restore CPI calendar ranking and Puppeteer cache
1 parent 6cba91d commit be1ff1b

4 files changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,5 @@ jobs:
7474
--image=${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/morning-briefing/app:${{ github.sha }} \
7575
--region=${{ env.REGION }} \
7676
--platform=managed \
77+
--update-env-vars=PUPPETEER_CACHE_DIR=/app/.cache/puppeteer \
7778
--quiet

src/sources/economic-calendar.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ const MARKET_IMPACT_INDICATORS: ReadonlyMap<string, number> = new Map([
217217
// Tier 1 — Score 10
218218
["nonfarm payrolls", 10],
219219
["consumer price index", 10],
220+
// TradingView labels the headline US CPI release "Inflation Rate YoY".
221+
// Treat it as CPI so the weekend week-ahead ranking does not bury it below
222+
// lower-impact foreign GDP releases.
223+
["inflation rate yoy", 10],
220224
[" cpi", 10], // leading space avoids false matches like "recipe"
221225
["interest rate decision", 10],
222226
["fed funds rate", 10],

terraform/cloudrun.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ resource "google_cloud_run_v2_service" "morning_briefing" {
6666
value = google_storage_bucket.data.name
6767
}
6868

69+
# Keep the runtime path aligned with the Chrome cache baked into the
70+
# image. This also replaces the obsolete /home/pptruser cache setting
71+
# left on existing Cloud Run revisions.
72+
env {
73+
name = "PUPPETEER_CACHE_DIR"
74+
value = "/app/.cache/puppeteer"
75+
}
76+
6977
ports {
7078
container_port = 8080
7179
}

tests/economic-calendar.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ describe("scoreEvent", () => {
138138
expect(scoreEvent(event)).toBe(15);
139139
});
140140

141+
it("scores TradingView's US headline CPI label at 15", () => {
142+
const event = createEvent({
143+
title: "Inflation Rate YoY",
144+
country: "US",
145+
});
146+
expect(scoreEvent(event)).toBe(15);
147+
});
148+
141149
it("scores ECB Interest Rate Decision at 12 (10 * 1.2 EU weight)", () => {
142150
const event = createEvent({
143151
title: "ECB Interest Rate Decision",

0 commit comments

Comments
 (0)