Repository navigation
Remove Blocks opt-in and registration code - #1049
Conversation
Remove POST /api/subscriptions, the Turnstile and Pardot services, their config and env vars. Stop using scratch_enabled: remove it from school responses, school updates and seeds. The column is ignored for now and will be dropped in a follow-up. Keep the school update endpoint for future feature controls. It accepts no fields for now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The obsolete functionality is removed consistently, with safe column handling and updated endpoint coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Removes obsolete Blocks subscription and school opt-in functionality while preparing scratch_enabled for a safe database removal.
Changes:
- Removes the subscriptions endpoint, Pardot/Turnstile integrations, configuration, and tests.
- Removes
scratch_enabledfrom APIs and seed tasks and marks the column ignored. - Retains school updates as an authorized no-op endpoint.
| File | Description |
|---|---|
.env.example |
Removes obsolete integration variables. |
config/application.rb |
Removes Pardot and Turnstile configuration. |
config/routes.rb |
Removes the subscriptions route. |
app/controllers/api/subscriptions_controller.rb |
Deletes the retired endpoint. |
app/services/subscriptions/turnstile_verifier.rb |
Deletes Turnstile integration. |
app/services/subscriptions/pardot_form_handler_submitter.rb |
Deletes Pardot integration. |
app/controllers/api/schools_controller.rb |
Makes school updates accept no settings. |
app/models/school.rb |
Ignores the pending-removal column. |
app/views/api/schools/_school.json.jbuilder |
Removes scratch_enabled from responses. |
lib/tasks/test_seeds.rake |
Stops setting the removed option. |
lib/tasks/for_education.rake |
Stops setting the removed option. |
spec/requests/api/subscriptions_spec.rb |
Removes retired endpoint coverage. |
spec/services/subscriptions/turnstile_verifier_spec.rb |
Removes retired service coverage. |
spec/services/subscriptions/pardot_form_handler_submitter_spec.rb |
Removes retired service coverage. |
spec/lib/test_seeds_spec.rb |
Removes the obsolete seed assertion. |
spec/features/school/updating_a_school_spec.rb |
Covers no-op update behavior. |
spec/features/my_school/showing_my_school_spec.rb |
Updates the expected school response. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
POST /api/subscriptions, the Turnstile and Pardot services, and their specs - Removes CLOUDFLARE_TURNSTILE_SECRET_KEY and PARDOT_SUBSCRIPTION_URL from config and .env.example - Removes scratch_enabled from school responses, school updates and seed tasks - Adds ignored_columns for scratch_enabled so the column can be safely dropped in a follow-up - Keeps PUT /api/schools/:id. It accepts no fields for now, and a comment explains how to add a new setting ## Why The Blocks opt-in and registration form have been removed from editor-standalone, so this code, its secrets and its external services are no longer used. ## Notes - PUT /api/schools/:id now returns 200 and changes nothing (previously 400 when params were missing) - Dropping the column, removing the env vars and retiring the Turnstile widget and Pardot form are tracked in #<follow-up issue> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Test coverage93.86% line coverage reported by SimpleCov. |
mwtrew
left a comment
There was a problem hiding this comment.
Looks good! As a minor nitpick I think the comments are a bit verbose and probably not needed (I know Claude loves adding them though)
Thanks @mwtrew , I'll be able to remove some of the comments in the next PR |
…r-api into 1839-remove-retired-blocks-API-code-and-config-part-one
Part of #1839
Follow up work needed https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1882
What
POST /api/subscriptions, the Turnstile and Pardot services, and their specsCLOUDFLARE_TURNSTILE_SECRET_KEYandPARDOT_SUBSCRIPTION_URLfrom config and.env.examplescratch_enabledfrom school responses, school updates and seed tasksignored_columnsforscratch_enabledso the column can be safely dropped in a follow-upPUT /api/schools/:id. It accepts no fields for now, and a comment explains how to add a new settingWhy
The Blocks opt-in and registration form have been removed from editor-standalone, so this code, its secrets and its external services are no longer used.
Notes
PUT /api/schools/:idnow returns 200 and changes nothing (previously 400 when params were missing)🤖 Generated with Claude Code