Repository navigation
[access] refactor(profile-fields): split ProfileFieldService definitions, own values, visibility, search and LDAP sync into named steps - #1079
Open
rubenvdlinde wants to merge 2 commits into
Conversation
…es and definitions before the split Assisted-by: ClaudeCode:claude-opus-5-5
…values, visibility, search and LDAP sync into named steps Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
requested review from
WilcoLouwerse,
bbrands02 and
rjzondervan
as code owners
November 11, 2026 18:50
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.
What changed
Seven
ProfileFieldServiceunits read as named steps; every public signature is unchanged.validateDefinition→validKey→definitionFrom(label, then type, source and visibility checked in the original order, viavalidLabelandoneOf) →withCheckedLdapAttribute.saveOwnValues→definitionsByKey→cleanOwnValues(every value is still checked before anything is written; read-only fields are still skipped) → writes.cleanValues→valueItems,cleanItem,itemText, with the same messages.visibleFieldsForkeeps its guards and hands the widget definitions and the viewer'scanSeecheck to a newProfileFieldListing, a small final run object built for this one listing (fieldsByPerson,fieldsOf).findMatchingUserIds→searchableDefinitions;scopeAllowsgives the same answer for every scope / viewer / owner with two checks instead of three.syncLdapFieldskeeps its guards, thensyncFromLdap(ldapFieldValues), still counting the fields synced before a directory failure.Allowed and refused outcomes are unchanged: the same people and fields are visible to the same viewers, the same searches match, and the same saves and definitions are refused with the same messages.
Characterisation tests
tests/Unit/Service/ProfileFieldServiceAccessGoldenTest.phpwas committed first, against the old code, and passes before and after: the normalised definition and the LDAP variant, every invalid definition with its message and check order; saved own values (cleaned, de-duplicated, read-only skipped, cleared) and every refused save leaving the stored value in place; visible fields for a group member, another group, a person without groups, an anonymous viewer and no people; the search across group-only, everyone, LDAP, hidden-from-widget and mirrored standard fields with private and federated scopes; every scope case; and every LDAP sync outcome including a mid-sync directory failure. Mutation check: letting every scope through on the old code turned the scope and search goldens red; restored before committing.What ran
vendor/bin/phpunit -c phpunit.xml --no-coverage tests/Unit: 2778 tests OK (13 skipped, as on development).vendor/bin/phpcsandvendor/bin/phpstan analyseon the touched lib files: clean.vendor/bin/phpmdonProfileFieldService: one new finding,TooManyMethods(30 methods against a limit of 25), the cost of turning long methods into named private steps;composer phpmdis already red on development for other classes.Figures (touched files
lib/Service/ProfileFieldService.php,lib/Service/ProfileFieldListing.php)ProfileFieldListingdepends on nothing in the app; onlyProfileFieldServicedepends on it. App-wide: unit complexity 4.02 → 4.10, unit size 3.40 → 3.42.Maintainability floor: compare against development holds.
AI-assisted: prepared with Claude Code (claude-opus-5-5); reviewed by a maintainer before merge.
Generated by Claude Code