Repository navigation
refactor: services name no ui type; the pages convert between them - #702
Draft
PiquelChips wants to merge 5 commits into
Draft
PiquelChips wants to merge 5 commits into
PiquelChips wants to merge 5 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
PiquelChips
force-pushed
the
refactor/544-decision-standings
branch
from
November 22, 2026 14:20
5cb0e22 to
0cca714
Compare
The admin service converted ui's Grace into its GracePeriod. GracePeriod now names its periods, and the console's web module converts the form's choice, so the service names no ui type.
The picture service fetched with ui's PICTURE_TYPES. The constant moves to sourceorigin-common, beside PictureId, and the profile form uses it from there.
AdminError, FederationError and OAuthError held ui's QueryError, which is serde_urlencoded's error; they name it directly. FederationError no longer maps itself to the sign-in page's CallbackError: the callback that redirects there does.
…compile Also say which code outside the pages may still name sourceorigin-ui: what redirects to a page or renders one, and the security layer's preference and notice cookies.
PiquelChips
force-pushed
the
refactor/544-services-independent-of-ui
branch
from
November 22, 2026 14:44
e8e4d6c to
0386cdd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #544. Stacked on #686 (
refactor/544-decision-standings, the tip of the #677 → #681 → #686 stack). Its base is that branch.The owner's chosen direction is that
sourceorigin-uiuses the services' and common's types, never the other way round. Some service code named ui types anyway:GracePeriod: From<Grace>sat inadmin/types. NowGracePeriodhas named periods (NONE,HOUR,DAY,WEEK,MONTH), built by aconst fnthat fails to compile when a period is outside 0 to 30 days. The conversion from the rotation form's choice lives inweb/developers, next toFrom<ClientDraft> for ClientSettings. The console and the dashboard both call it.AdminError::Link,FederationError::PageAddressandOAuthError::PageAddressheld ui'sQueryError, which only re-exportsserde_urlencoded::ser::Error. They now name that type directly. Same type, same messages.FederationError::callback_errormapped the domain error to the sign-in page'sCallbackError. That mapping now sits inFederationApplication::refused, the handler that redirects to the page. It has the same arms, anderror.rsnames no ui type.PICTURE_TYPESmoves from ui tosourceorigin_common, next toPictureId. The picture service fetches with it, and the profile form'sacceptuses it.handle::MAX_LENGTHalready works this way.The conventions and the architecture overview now state the direction. They also say which code outside
src/webmay still name ui: code that redirects to a page or renders one. A redirect to a page writes that page's query. Federation's callback and the OIDC flows writeLoginQuery, and the dashboard handoff writesHandoffQuery. The security layer renders its error page and keeps the preference and notice cookies,assetsserves ui's files and the email deliverer renders emails. Configuration readsPolicies::PATHS, which sourceorigin.dev also serves.Why
CallbackErrorandLoginQuerystay in ui: they are the sign-in page's query, and the conventions put a page's query in ui. Federation's callback writes that query because it redirects to the page. Taking ui out of federation entirely would mean moving the callback route intosrc/web, which is a large move of the sign-in flow for little gain.API change to
sourceorigin-common: addspub const PICTURE_TYPES. Nothing is removed.Tests moved:
rotation_choices_are_the_periods_they_namemoves fromadmin/types/tests.rstoweb/developers/tests.rswith the conversion it tests. It is unchanged.Unchanged: every string, serde attribute and error message is moved as it was. The grace periods are the same minutes (the moved test checks each choice against its parsed text). The callback's
matchhas the same arms as before.PICTURE_TYPESis the same string.Checks:
cargo clippy --all-targets -D warningsfor common, ui and auth-service, with and without--all-featuresjust test -pfor common and uijust db testcargo docand the doc tests for common and uicargo semver-checks -p sourceorigin-commonjust rust unusedjust docsNote
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)