Repository navigation
[#1173] Check the references of every managed attribute type of an add and every modification of a modify, not only the first - #1175
Merged
vharseko merged 1 commit intoOct 5, 2026
Conversation
…ribute type of an add and every modification of a modify, not only the first Both pre-operation hooks of the Referential Integrity plugin returned after their first check, because they compared its result code with SUCCESS, while a reference that passes yields continueOperationProcessing(), whose result code is null. An add only had the references of the first managed attribute type checked, even when the entry did not hold that attribute, and a modify only those of its first modification of a managed attribute.
maximthomas
approved these changes
Oct 5, 2026
maximthomas
left a comment
Contributor
There was a problem hiding this comment.
praise: The fix changes exactly the two conditions that caused #1173, and the new tests fail without it.
doPreOperation(PreOperationModifyOperation)at:1093anddoPreOperation(PreOperationAddOperation)at:1127now return only on!result.continueProcessing(). That matchesisIntegrityMaintained(List<Attribute>, …), which already compared againstcontinueOperationProcessing(), theDEFAULT_RESULTwhose result code is null (PluginResult.java:360).missingReferenceNextToAnotherputs each ofmanagerandseeAlsoin both positions. Without the fix, the add rows whose missing reference sits in the second attribute type checked fail, and so do modify rows 1-2, whichever order the plugin iterates in. CI ran the class on Linux and all 69 tests passed.
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.
Fixes #1173
Problem
With
check-references: true, the Referential Integrity plugin checks references in its twodoPreOperationhooks, and both returned after their first check:A reference that passes yields
PluginResult.PreOperation.continueOperationProcessing(), whose result code isnull, notSUCCESS, so the condition also held for a check that passed. As a result:Fix
Both hooks now return early only when processing must stop (
!result.continueProcessing()).isIntegrityMaintained(List<Attribute>, …)already worked that way: it compares withcontinueOperationProcessing().Tests
ReferentialIntegrityPluginTestCase, withcheck-referencesonmanagerandseeAlsobelowdc=example,dc=com, and the data providermissingReferenceNextToAnother: a missing reference in one attribute, next to a valid reference in the other attribute or alone. Both attributes take both places, because the order in which the plugin checks attribute types is an implementation detail.testEnforceIntegrityAddChecksEveryAttributeType: adding an entry with a missing reference in either attribute is refused withCONSTRAINT_VIOLATION.testEnforceIntegrityModifyChecksEveryModification: a modify request whose second modification adds a missing reference is refused. Its first modification replaces the other managed attribute with a valid reference, or, in the rows without one, replacesdescription, which the plugin does not manage.The plugin configuration these tests share moved into a helper,
enableCheckReferences.Without the fix, 4 of the 69 tests fail with
expected [Constraint Violation] but found [Success]:[seeAlso, manager]and[seeAlso, null], because the plugin checksmanagerfirst;[manager, seeAlso]and[seeAlso, manager].The two modify rows without a valid reference passed even before the fix, since an unmanaged first modification was already skipped; they guard that case. With the fix the class passes 69/69.
Found while working on #1172 (PR #1174), whose test has to check
continueProcessing()for the same reason.