Skip to content

removes support for routes.yaml. - #30

Closed
ljonesfl wants to merge 1 commit into
developfrom
feature/remove-routes-yaml
Closed

ljonesfl wants to merge 1 commit into
developfrom
feature/remove-routes-yaml

Conversation

@ljonesfl

@ljonesfl ljonesfl commented Jan 11, 2026 •

Copy link
Copy Markdown
Member

Note

Remove legacy routing config

  • Remove routes.yaml files and routes_path from neuron.yaml configs

Bootstrap resilience

  • On DI container init failure, create and register a minimal container with SettingManager to keep app/initializers operational

Initializer hardening

  • AuthInitializer and RegistrationInitializer now check container for required services before registering filters; log and skip if unavailable

Misc

  • Update versionlog.md to 0.8.36 noting removal of routes.yaml

Written by Cursor Bugbot for commit 9e5128a. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Bug Fixes

    • Improved application initialization robustness with enhanced error handling and safety checks; ensures stable fallback behavior and prevents system crashes when certain components are unavailable.
  • Chores

    • Removed legacy routes configuration files; simplified the overall configuration structure by eliminating associated configuration paths and reducing setup complexity.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 11, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The pull request removes routes.yaml configuration support from the system and introduces defensive guard checks in service initializers. It adds a fallback container initialization mechanism in the bootstrap process for scenarios where the primary DI container creation fails.

Changes

Cohort / File(s) Summary
Routes Configuration Removal
examples/config/neuron.yaml, examples/config/routes.yaml, resources/config/neuron.yaml.example, resources/config/routes.yaml
Removes routes.yaml file entirely and deletes routes_path configuration references. Eliminates 632 lines of CMS route definitions for authentication, admin dashboards, blog management, user registration, and event calendars.
Initializer Guard Checks
resources/app/Initializers/AuthInitializer.php, resources/app/Initializers/RegistrationInitializer.php
Adds container existence guards before service resolution. Both initializers now check for required services and log warnings if missing, preventing errors in fallback container scenarios.
Bootstrap Fallback Logic
src/Bootstrap.php
Introduces fallback container initialization path that constructs a minimal PSR-11 container with only SettingManager when primary DI container creation fails. Includes error logging and null-safe handling.
Version Documentation
versionlog.md
Documents version 0.8.36 feature removal: routes.yaml support deprecated.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hop away old routes, no more YAML maze,
Guard checks keep us safe through bootstrap's haze,
Fallback containers catch what might have failed,
Cleaner configs bloom where old paths trailed! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'removes support for routes.yaml' directly and accurately describes the main objective of the pull request, which removes all routes.yaml configuration files and related support code.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

🧹 Nitpick comments (3)
versionlog.md (1)

1-2: Consider adding migration guidance to the changelog entry.

The removal of routes.yaml support is a breaking change, but the changelog entry doesn't explain the migration path or alternative approach for users upgrading from previous versions. Consider adding details about how routes should now be configured.

src/Bootstrap.php (1)

112-133: Consider adding observability for degraded application state.

The fallback container provides minimal functionality (only SettingManager), which means the application will run in a significantly degraded state. While the initializers log warnings when services are unavailable, consider adding:

  1. A registry flag or health check endpoint indicating the application is running in fallback mode
  2. More prominent logging (e.g., warning level) when falling back to minimal container
  3. Documentation about what functionality is unavailable in fallback mode

This would help operators and developers quickly identify when the application is not fully functional.

resources/app/Initializers/AuthInitializer.php (1)

64-70: Optional: Consider extracting the guard pattern to reduce duplication.

The service existence check pattern (lines 64-70 here and lines 64-71 in RegistrationInitializer.php) is duplicated. You could extract this to a helper method like:

protected function hasRequiredServices(IContainer $container, array $serviceClasses): bool
{
    foreach ($serviceClasses as $serviceClass) {
        if (!$container->has($serviceClass)) {
            return false;
        }
    }
    return true;
}

However, with only two instances, this refactoring can be deferred.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e8d3d9 and 9e5128a.

📒 Files selected for processing (8)
  • examples/config/neuron.yaml
  • examples/config/routes.yaml
  • resources/app/Initializers/AuthInitializer.php
  • resources/app/Initializers/RegistrationInitializer.php
  • resources/config/neuron.yaml.example
  • resources/config/routes.yaml
  • src/Bootstrap.php
  • versionlog.md
💤 Files with no reviewable changes (4)
  • examples/config/neuron.yaml
  • resources/config/neuron.yaml.example
  • examples/config/routes.yaml
  • resources/config/routes.yaml
🧰 Additional context used
🧬 Code graph analysis (2)
resources/app/Initializers/AuthInitializer.php (3)
src/Cms/Auth/SessionManager.php (1)
  • has (143-147)
src/Cms/Services/Auth/Authentication.php (1)
  • Authentication (20-386)
src/Cms/Services/Auth/CsrfToken.php (1)
  • CsrfToken (17-83)
resources/app/Initializers/RegistrationInitializer.php (3)
src/Cms/Services/Auth/Authentication.php (1)
  • Authentication (20-386)
src/Cms/Services/Auth/EmailVerifier.php (1)
  • EmailVerifier (24-257)
src/Cms/Services/Member/RegistrationService.php (1)
  • RegistrationService (24-321)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Cursor Bugbot
  • GitHub Check: build-test (mysql)
  • GitHub Check: build-test (postgres)
  • GitHub Check: build-test (sqlite)
🔇 Additional comments (3)
resources/app/Initializers/RegistrationInitializer.php (1)

64-71: LGTM! Guard checks align with fallback container strategy.

The service existence checks are well-implemented and handle fallback container scenarios gracefully. The warning log message clearly indicates why registration is being skipped.

resources/app/Initializers/AuthInitializer.php (1)

64-70: LGTM! Consistent guard pattern.

The service existence checks follow the same defensive pattern as RegistrationInitializer and appropriately handle fallback container scenarios.

src/Bootstrap.php (1)

116-124: PHP-DI is already declared as a dependency ("php-di/php-di": "^7.1" in composer.json). No action needed.

@codecov

codecov Bot commented Jan 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Bootstrap.php 0.00% 9 Missing ⚠️
Flag Coverage Δ Complexity Δ
cms 73.49% <0.00%> (-0.09%) 2099.00 <0.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ Complexity Δ
src/Bootstrap.php 68.51% <0.00%> (-13.71%) 0.00 <0.00> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ljonesfl ljonesfl closed this Jan 11, 2026
@ljonesfl
ljonesfl deleted the feature/remove-routes-yaml branch January 11, 2026 21:41
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.

1 participant