Shopify / maintenance_tasks

A Rails engine for queueing and managing data migrations.
MIT License
936 stars 72 forks source link

Ensure `Rack::MethodOverride` #992

Open ChanChar opened 4 months ago

ChanChar commented 4 months ago

Similar to https://github.com/Shopify/maintenance_tasks/issues/926, Rails API mode doesn't include the middleware that converts POST to PUT calls leading to Routing Errors.

Possible solutions:

  1. Create a custom controller and set the parent to that.
  2. Generator checks for all required middleware and adds them to the application.

References https://github.com/Shopify/sidekick-server/issues/728

etiennebarrie commented 4 months ago

I don't think we can fix only our controller, middlewares are global to the application, right?

Maybe we could just change all the PUTs to be POSTs. We don't really pass in data, I don't think it even fits the semantics of HTTP.

ChanChar commented 4 months ago

middlewares are global to the application

true, i was thinking if there's a way to check for existing middleware within the app, the library could fast-fail.

Maybe we could just change all the PUTs to be POSTs

That works too :)

etiennebarrie commented 3 months ago

Would you be interested in contributing these changes?

github-actions[bot] commented 1 week ago

This issue has been marked as stale because it has not been commented on in two months. Please reply in order to keep the issue open. Otherwise, it will close in 14 days. Thank you for contributing!