Skip to content

Conversation

@tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jan 5, 2026

What is this pull request for?

Replace all HTTP status code symbols with numeric codes to avoid Rack 3.1+ deprecation warnings.

Rack 3.1 renamed :unprocessable_entity to :unprocessable_content, which causes deprecation warnings. Since AlchemyCMS supports Rails 7.1+ (which can use Rack 2.x, 3.0, or 3.1+), using numeric codes ensures compatibility across all Rack versions without warnings.

For consistency, all status code symbols have been replaced:

  • :unprocessable_entity → 422
  • :created → 201
  • :accepted → 202
  • :unauthorized → 401
  • :moved_permanently → 301
  • :ok → 200

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

Rack 3.1 renamed :unprocessable_entity to :unprocessable_content,
which causes deprecation warnings. Since AlchemyCMS supports Rails
7.1+ (which can use Rack 2.x, 3.0, or 3.1+), using numeric codes
ensures compatibility across all Rack versions without warnings.

For consistency, all HTTP status code symbols have been replaced
with their numeric equivalents:
- :unprocessable_entity → 422
- :created → 201
- :accepted → 202
- :unauthorized → 401
- :moved_permanently → 301
- :ok → 200
@tvdeyen tvdeyen requested a review from a team as a code owner January 5, 2026 16:29
@tvdeyen tvdeyen added this to the 8.1 milestone Jan 5, 2026
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.25%. Comparing base (d1721ca) to head (af921d3).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3555   +/-   ##
=======================================
  Coverage   97.25%   97.25%           
=======================================
  Files         291      291           
  Lines        7682     7682           
=======================================
  Hits         7471     7471           
  Misses        211      211           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

For readability I do prefer the symbols, but I'm not dying on that hill.

@tvdeyen
Copy link
Member Author

tvdeyen commented Jan 7, 2026

For readability I do prefer the symbols, but I'm not dying on that hill.

Yea, but needing to remember the symbol instead of the well known numbers? Unnecessary complexity imo

@tvdeyen tvdeyen merged commit 7ecc5d3 into main Jan 7, 2026
19 checks passed
@tvdeyen tvdeyen deleted the use-numeric-http-status-codes branch January 7, 2026 15:25
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.

3 participants