Skip to content

refactor: pass the Learn Fastly service ID at the call sites - #3804

Open
ChristopherChudzicki wants to merge 1 commit into
mainfrom
fix/fastly-pass-learn-service-id-explicitly
Open

refactor: pass the Learn Fastly service ID at the call sites#3804
ChristopherChudzicki wants to merge 1 commit into
mainfrom
fix/fastly-pass-learn-service-id-explicitly

Conversation

@ChristopherChudzicki

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

Refs https://github.com/mitodl/hq/issues/12381

Description (What does it do?)

Naming clarity only: passes settings.MIT_LEARN_FASTLY_SERVICE_ID explicitly at the three call sites, so it's visible at the point of enqueue that an MITxOnline signal purges MIT Learn's Fastly service and not our own.

Originally part of #3794, split out because a two-argument Celery message raises TypeError on a worker still running the one-argument task. #3794 keeps the message single-argument and falls back to the setting, which is safe in both rolling-deploy directions; this PR adds the argument back once every worker accepts it.

Warning

Do not merge until #3794 is fully released — web and celery.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

OpenAPI Changes

Show/hide changes
## Changes for v0.yaml:
No changes detected

## Changes for v1.yaml:
No changes detected

## Changes for v2.yaml:
No changes detected

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

ChristopherChudzicki added a commit that referenced this pull request Jul 30, 2026
Keeps the enqueued Celery message a single positional argument so a
rolling deploy is safe in both directions: an old webapp's one-arg
message runs on a new worker and still purges via the fallback, and a
new webapp's one-arg message runs on an old worker unchanged. Passing
service_id explicitly from the call sites is #3804, once every worker
accepts the argument.

Also drives cms/signals_test.py through Wagtail's real publish rather
than calling the receiver directly, so the page_published.connect()
wiring is covered.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChristopherChudzicki
ChristopherChudzicki force-pushed the fix/fastly-learn-service-id-env-var branch from 36fcddc to 221cae9 Compare July 30, 2026 14:57
@ChristopherChudzicki
ChristopherChudzicki force-pushed the fix/fastly-pass-learn-service-id-explicitly branch from fa59fc5 to ecb236f Compare July 30, 2026 14:57
Base automatically changed from fix/fastly-learn-service-id-env-var to main July 31, 2026 13:13
Now that every worker accepts service_id, pass it explicitly so a purge's
target is visible where it is enqueued -- an MITxOnline signal purging
MIT Learn's Fastly service is surprising enough to name at the call site.

Requires the parent PR to be fully deployed first: a two-argument message
raises TypeError on a worker whose task still takes one argument.

Also log the two skip branches at error rather than warning level. Sentry
raises an issue from ERROR and above -- main.sentry constructs
LoggingIntegration without an event_level, so it keeps the sentry_sdk
default -- which makes a warning a breadcrumb and nothing more. An unset
service ID or auth token disables cache invalidation outright, and logging
it as a warning is why it stayed unnoticed. Still skips rather than raises:
this task runs on every course, run, and program save, and dev and CI have
no Fastly credentials at all, so raising would turn a config gap into
retry storms on routine edits.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChristopherChudzicki
ChristopherChudzicki force-pushed the fix/fastly-pass-learn-service-id-explicitly branch from ecb236f to abdb522 Compare July 31, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant