Skip to content

[#73889] Clean up Backlogs module naming and namespacing#22829

Merged
myabc merged 10 commits intodevfrom
code-maintenance/73889-backlogs-module-naming-namespacing
Apr 20, 2026
Merged

[#73889] Clean up Backlogs module naming and namespacing#22829
myabc merged 10 commits intodevfrom
code-maintenance/73889-backlogs-module-naming-namespacing

Conversation

@myabc
Copy link
Copy Markdown
Contributor

@myabc myabc commented Apr 20, 2026

Note

This PR is based on #22791. Please review/merge that PR first.

Ticket

https://community.openproject.org/wp/73889

What are you trying to accomplish?

Follow-up to #72661. Finishes the Backlogs naming/namespacing cleanup:

  • Drops the Redmine-era Rb* / rb_* prefix from the remaining controller and helper.
  • Moves the remaining Backlogs controllers and helpers under the Backlogs:: module (BacklogsSettingsControllerBacklogs::SettingsController, RbCommonHelperBacklogs::CommonHelper, BurndownChartsHelperBacklogs::BurndownChartHelper).
  • Replaces RbApplicationController with Backlogs::BaseController, matching the <Module>::BaseController convention used across Boards, Calendar, TeamPlanner, Gantt, Avatars, etc.
  • renames agile_sprint_* controller param helpers to sprint_* for consistency
  • adds a routing spec for /admin/backlogs

Route paths and helper names are unchanged.

What approach did you choose and why?

Four focused commits, each green in isolation. Legacy top-level models (Story, Task, Sprint, Backlog, Burndown) are intentionally left alone — they're removed in OP #71254.

Merge checklist

  • Added/updated tests

@myabc myabc changed the title Code maintenance/73889 backlogs module naming namespacing [#73889] Clean up Backlogs module naming and namespacing Apr 20, 2026
@myabc myabc requested a review from Copilot April 20, 2026 10:14
@myabc myabc added ruby Pull requests that update Ruby code maintenance labels Apr 20, 2026
@myabc myabc added this to the 17.4.x milestone Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR continues the Backlogs module cleanup by aligning naming/namespacing across controllers, helpers, and specs, and by introducing a namespaced admin settings endpoint and view.

Changes:

  • Rename/namespace Backlogs helpers (RbCommonHelperBacklogs::CommonHelper, BurndownChartsHelperBacklogs::BurndownChartHelper) and update consumers/specs.
  • Introduce Backlogs::BaseController and move Backlogs controllers to inherit from it instead of the legacy RbApplicationController.
  • Rename the admin settings controller to Backlogs::SettingsController, update its route, and add a new admin settings view.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
modules/backlogs/spec/views/backlogs/burndown_chart/show_spec.rb Update view spec to extend the renamed/namespaced burndown chart helper.
modules/backlogs/spec/helpers/backlogs/common_helper_spec.rb Update helper spec to target Backlogs::CommonHelper.
modules/backlogs/spec/controllers/backlogs/settings_controller_spec.rb Update controller spec to target Backlogs::SettingsController.
modules/backlogs/lib/open_project/backlogs/hooks/layout_hook.rb Update hook to include the renamed/namespaced common helper.
modules/backlogs/config/routes.rb Point admin backlogs settings route at backlogs/settings.
modules/backlogs/app/views/backlogs/settings/show.html.erb Add admin Backlogs settings page (Primer header + blankslate).
modules/backlogs/app/helpers/backlogs/common_helper.rb Move common helper into Backlogs::CommonHelper namespace.
modules/backlogs/app/helpers/backlogs/burndown_chart_helper.rb Move burndown helper into Backlogs::BurndownChartHelper namespace.
modules/backlogs/app/controllers/backlogs/*.rb Switch controllers to inherit from Backlogs::BaseController; adjust helper loading and controller namespacing.

Comment thread modules/backlogs/config/routes.rb
Comment thread modules/backlogs/config/routes.rb
@myabc myabc force-pushed the code-maintenance/73889-backlogs-module-naming-namespacing branch 2 times, most recently from 93e98ef to c01dfea Compare April 20, 2026 11:05
@myabc myabc requested a review from Copilot April 20, 2026 11:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.

Comment thread modules/backlogs/app/helpers/backlogs/burndown_chart_helper.rb Outdated
Comment thread modules/backlogs/lib/open_project/backlogs/hooks/layout_hook.rb Outdated
@myabc myabc force-pushed the code-maintenance/73889-backlogs-module-naming-namespacing branch from fc256d7 to 66c0b0c Compare April 20, 2026 11:21
@myabc myabc marked this pull request as ready for review April 20, 2026 11:51
@myabc myabc force-pushed the code-maintenance/73889-backlogs-module-naming-namespacing branch from 3ca8292 to 1037de4 Compare April 20, 2026 13:57
@myabc myabc force-pushed the code-maintenance/72661-consolidate-backlogs-routes branch from 4436dc7 to d02622e Compare April 20, 2026 13:58
@myabc myabc force-pushed the code-maintenance/73889-backlogs-module-naming-namespacing branch from 1037de4 to 34310b4 Compare April 20, 2026 13:59
@myabc myabc force-pushed the code-maintenance/72661-consolidate-backlogs-routes branch from d02622e to bb79537 Compare April 20, 2026 14:04
@myabc myabc force-pushed the code-maintenance/73889-backlogs-module-naming-namespacing branch from 34310b4 to e42e257 Compare April 20, 2026 14:06
@myabc myabc requested review from Copilot and ulferts April 20, 2026 14:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.

Comment thread lib_static/redmine/i18n.rb Outdated
Comment thread config/initializers/menus.rb Outdated
Comment on lines +105 to +110
def format_date_range(dates)
return nil if dates.all?(&:nil?)

from, to = dates.map { |date| tag.time(datetime: date.iso8601) { format_date(date) } if date }
safe_join([from, "–", to], " ") # &ndash; and &nbsp;
end
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

(This could also be a View Component) / @HDinger

@myabc myabc force-pushed the code-maintenance/73889-backlogs-module-naming-namespacing branch from e42e257 to 08f2c88 Compare April 20, 2026 14:37
Copy link
Copy Markdown
Contributor

@ulferts ulferts left a comment

Choose a reason for hiding this comment

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

All good

Comment thread config/initializers/menus.rb Outdated
Base automatically changed from code-maintenance/72661-consolidate-backlogs-routes to dev April 20, 2026 15:48
myabc added 10 commits April 20, 2026 17:29
Matches the `<Module>::BaseController` convention used in `Boards`,
`Calendar`, `TeamPlanner`, `Gantt`, and other module engines.

https://community.openproject.org/wp/73889
Moves `BacklogsSettingsController` under the `Backlogs::` module as
`Backlogs::SettingsController`. Keeps the `admin_backlogs_settings`
route name so `redirect_to_backlogs_settings` callers keep working.

https://community.openproject.org/wp/73889
Places the helper next to `format_date` and `format_time` so other
modules can reuse it. Adds YARD docs.
Drops the `agile_` prefix from `agile_sprint_params`,
`edit_agile_sprint_params`, and `converted_agile_sprint_params`. The
controller already sits under `Backlogs::` as `SprintsController`, so
the prefix was historical noise from before the namespacing.
The chart payload is serialized with `to_json` at render time, so
pre-escaping day labels would (theoretically) add an extra layer of
backslashes.
Registers the admin menu entry from OpenProject::Backlogs::Engine
and removes the duplicate initializer entry.

Adds an engine spec for the admin menu target.
@myabc myabc force-pushed the code-maintenance/73889-backlogs-module-naming-namespacing branch from 0b1c77e to 031d9f3 Compare April 20, 2026 16:29
@myabc myabc merged commit ba41c89 into dev Apr 20, 2026
16 of 17 checks passed
@myabc myabc deleted the code-maintenance/73889-backlogs-module-naming-namespacing branch April 20, 2026 16:54
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

maintenance ruby Pull requests that update Ruby code

Development

Successfully merging this pull request may close these issues.

3 participants