Skip to content

refactor(ocs): improve readability of v1 front controller#60376

Draft
joshtrichards wants to merge 1 commit into
masterfrom
jtr/refactor-ocs-v1-point
Draft

refactor(ocs): improve readability of v1 front controller#60376
joshtrichards wants to merge 1 commit into
masterfrom
jtr/refactor-ocs-v1-point

Conversation

@joshtrichards
Copy link
Copy Markdown
Member

Summary

This refactors ocs/v1.php to make the request flow easier to read without changing the endpoint's behavior. Somewhat inspired as an incremental counterpart to #60362 (and to some extent #60293).

What changed

  • Introduced local variables for request path handling and bootstrapping state
  • Made the maintenance/upgrade short-circuit more explicit
  • Grouped request handling into clearer phases:
    • app bootstrap
    • request validation
    • login / update-path handling
    • route dispatch
  • Kept the existing OCS exception-to-response mapping intact
  • Simplified the generic error path by removing unnecessary nesting

Notes

  • This is a readability-only cleanup
  • No intended behavior changes
  • /core/update remains the only bypass for the early maintenance/upgrade response

TODO

  • Test test test

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added 2. developing Work in progress ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant