Skip to content

Remove Blocks opt-in and registration code - #1049

Merged
jamiebenstead merged 3 commits into
mainfrom
1839-remove-retired-blocks-API-code-and-config-part-one
Oct 7, 2026
Merged

jamiebenstead merged 3 commits into
mainfrom
1839-remove-retired-blocks-API-code-and-config-part-one

Conversation

@jamiebenstead

@jamiebenstead jamiebenstead commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1839
Follow up work needed https://github.com/RaspberryPiFoundation/digital-editor-issues/issues/1882

What

  • Removes 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 #

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 10:24
@cla-bot cla-bot Bot added the cla-signed label Oct 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_enabled from 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.

Comment thread app/controllers/api/schools_controller.rb Outdated
@jamiebenstead jamiebenstead changed the title Part of #1839 ## What - Removes 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) Remove Blocks opt-in and registration code Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Test coverage

93.86% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/37623685093

@jamiebenstead jamiebenstead reopened this Oct 7, 2026
@raspberrypiherokubot
raspberrypiherokubot temporarily deployed to editor-api-p-1839-remov-no7w45 October 7, 2026 10:52 Inactive

@mwtrew mwtrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@jamiebenstead

Copy link
Copy Markdown
Contributor Author

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
@jamiebenstead
jamiebenstead merged commit 51a7a15 into main Oct 7, 2026
9 checks passed
@jamiebenstead
jamiebenstead deleted the 1839-remove-retired-blocks-API-code-and-config-part-one branch October 7, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants