Skip to content

feat!: own the admin namespace base and resolve it once - #41

Merged
tyrsson merged 2 commits into
1.0.xfrom
feat/component-name-standard
Sep 29, 2026
Merged

tyrsson merged 2 commits into
1.0.xfrom
feat/component-name-standard

Conversation

@tyrsson

@tyrsson tyrsson commented Sep 29, 2026

Copy link
Copy Markdown
Member

Foundation PR 2 of 2 — depends on webware-core's feat/component-name-standard. Merge that first, then this, then cut a release of both.

Why

The admin base was a core constant, written into config by this component and read back by everyone through two keys (admin_route_segment, admin_route_name_prefix) for what is really one namespace. A component that reached for the module half instead of the composed pair produced names no route answers — that is the acl seed defect.

What

The base now lives here, where it belongs:

  • ADMIN_NAME = 'admin' — the default.
  • ADMIN_NAME_KEY = 'admin_name' — the single override key, replacing the two.
  • getAdminName() — resolves the base (config value, else ADMIN_NAME). Components that publish admin routes already require this package, so they consult this instead of restating it.
  • getAdminNamePrefix() / getAdminSegment() — admin. and admin, which is what this component's own routes use. No double prefix, no special case.

ConfigProvider now publishes admin_name as its default config, and the dashboard route is named admin.dashboard.read and mounted at /admin (the webware. vendor segment is gone from route names fleet-wide).

Verification

mago fmt / format --check / lint / analyze / guard clean; composer test 15 tests / 27 assertions OK; composer test-integration 11 tests / 17 assertions OK.

Verified against core's branch by temporarily pointing vendor/webware/webware-core at the sibling clone, because this package resolves core from a released tag — that local symlink was reverted afterwards and is not part of this change.

Breaking

admin_route_segment / admin_route_name_prefix are replaced by the single admin_name; getAdminRouteSegment() / getAdminRouteNamePrefix() are replaced by getAdminSegment() / getAdminNamePrefix(); COMPONENT_NAME is declared here.

The admin base was a core constant written into config by this component and
read back by everyone: `admin_route_segment` and `admin_route_name_prefix`
were two values for one namespace, and a component that reached for the
module half instead of the composed pair produced names no route answers.

The base now lives here, where it belongs: ADMIN_NAME with one override key
(admin_name), resolved by getAdminName(). Components that publish admin
routes require this package already, so they consult this value instead of
restating it. This component's own routes are that namespace itself —
getAdminSegment() `admin` and getAdminNamePrefix() `admin.` — so there is no
double prefix to special-case.

Route names lose the `webware.` vendor segment in the process: the dashboard
is `admin.dashboard.read` on `/admin`.

BREAKING CHANGE: admin_route_segment/admin_route_name_prefix are replaced by
admin_name; getAdminRouteSegment()/getAdminRouteNamePrefix() are replaced by
getAdminSegment()/getAdminNamePrefix(); COMPONENT_NAME is declared here.

Signed-off-by: Joey Smith <jsmith@webinertia.net>
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Codecov's patch gate flagged 13 uncovered lines in this branch: the three new
accessors had no tests, and neither factory had one at all.

The accessors are covered for the default, a configured override, and the
fallback for a value that is not a usable string. The factories are asserted
behaviourally rather than through reflection: the route factory registers
/webware.admin's successor at the resolved path and name, and the URL factory
passes the resolved prefix to the helper, so a mis-composed namespace fails
the test instead of hiding in private state.

Signed-off-by: Joey Smith <jsmith@webinertia.net>
@tyrsson
tyrsson merged commit 3c94b38 into 1.0.x Sep 29, 2026
12 checks passed
@tyrsson
tyrsson deleted the feat/component-name-standard branch September 29, 2026 22:14
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