Move draw patch into gems

What does this MR do and why?

The main improvement is replacing a custom routing patch with a new gem called action_dispatch-draw_all (following https://docs.gitlab.com/development/gems/) that provides a draw_all method. This method can automatically load route files from multiple directories, making it easier to organize routes across different editions of the application.

Previously, the system used a complex patch to handle loading routes from both the main application and enterprise-specific directories. The new approach simplifies this by:

  1. Creating a standalone gem that extends Rails routing capabilities
  2. Replacing many draw calls with draw_all calls in the route configuration
  3. Adding proper support for loading routes from multiple configured directories
  4. Removing the old custom routing patch code

The change also updates the application configuration to include enterprise route directories in the Rails routing system, and wraps some enterprise-only routes with conditional blocks to ensure they only load in the appropriate edition.

This refactoring makes the codebase cleaner, more maintainable, and provides better separation between community and enterprise features while maintaining the same functionality.

References

Screenshots or screen recordings

Output from bundle exec rails routes

Before After
master_routes.txt branch_routes4.txt

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports

Loading