Skip to content

Remove unused school deletion endpoint#930

Merged
zetter-rpf merged 1 commit into
mainfrom
remove-unused-destroy
Jul 21, 2026
Merged

Remove unused school deletion endpoint#930
zetter-rpf merged 1 commit into
mainfrom
remove-unused-destroy

Conversation

@zetter-rpf

Copy link
Copy Markdown
Contributor

Status

This isn't accessible from the UI so is a risk if it is used because it might lead to unexpected behaviour.

I also searched our logs and have no record of schools being destroyed.

This isn't accessible from the UI so is a risk if it is used because it might lead to unexpected behaviour.

I also searched our logs and have no record of schools being destroyed.
@cla-bot cla-bot Bot added the cla-signed label Jul 21, 2026
@zetter-rpf
zetter-rpf marked this pull request as ready for review July 21, 2026 07:57
Copilot AI review requested due to automatic review settings July 21, 2026 07:57
@zetter-rpf zetter-rpf changed the title Remove school deletion endpoint Remove unused school deletion endpoint Jul 21, 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.

Pull request overview

Removes the ability for API consumers to delete (DELETE) schools, eliminating an unused but potentially risky endpoint from the Rails API surface.

Changes:

  • Removed DELETE /api/schools/:id route and the corresponding Api::SchoolsController#destroy action.
  • Removed the School::Delete operation and its associated request/unit specs.
  • Updated cancancan abilities to no longer grant school owners :destroy on School.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
spec/models/ability_spec.rb Updates authorization expectations for school owners (but should also assert :destroy is no longer allowed).
spec/features/school/deleting_a_school_spec.rb Removes request spec coverage for the deleted endpoint.
spec/concepts/school/delete_spec.rb Removes unit spec coverage for the deleted School::Delete operation.
lib/concepts/school/operations/delete.rb Removes the School::Delete operation implementation.
config/routes.rb Removes destroy from API schools routes, disabling DELETE /api/schools/:id.
app/models/ability.rb Removes :destroy permission on School for school owners.
app/controllers/api/schools_controller.rb Removes the destroy action that previously deleted schools.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/models/ability_spec.rb
@github-actions

Copy link
Copy Markdown

Test coverage

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

@raspberrypiherokubot
raspberrypiherokubot temporarily deployed to editor-api-p-remove-unu-hul6q6 July 21, 2026 08:03 Inactive

@jamiebenstead jamiebenstead 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! Nice spot

@zetter-rpf
zetter-rpf merged commit 904c8e9 into main Jul 21, 2026
7 checks passed
@zetter-rpf
zetter-rpf deleted the remove-unused-destroy branch July 21, 2026 15:35
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