Conversation
* Add a new `refactorMergedChangeRequests` configuration (off by default) allowing merged change requests to have their page references refactored when the concerned page is renamed or moved, without altering their content or status * Wire the new option into ChangeRequestConfiguration/DefaultChangeRequestConfiguration and the admin configuration page * Update DocumentRenamedListener to only refactor merged change requests when the option is enabled, skipping the filtering pass over the change requests entirely when the option is enabled * Add a regression test locking in that the status of a merged change request is preserved when its file changes are refactored * Add/extend a Docker integration test covering the refactoring of a merged change request, including a page creation, a page deletion, a live edit performed after the merge, and validation of the resulting diff Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Description
Adds a new admin configuration option,
refactorMergedChangeRequests(disabled by default), that allows page-reference refactoring (rename/move) to also apply to already merged change requests, extending the CRAPP-168 work which currently excludes them.ChangeRequestConfiguration#isMergedChangeRequestRefactoringEnabled()(new default method,false) /DefaultChangeRequestConfigurationreads it from therefactorMergedChangeRequestsproperty.DocumentRenamedListenernow only excludesMERGEDchange requests from refactoring when the option is disabled.ConfigurationClass.xml,Configuration.xml, translations).Clarifications
DefaultChangeRequestStorageManager#refactorTargetEntity) only clones the file change with a new target reference (XWikiDocument#cloneRename); it never touches the change request's content, so enabling this option cannot alter what a merged change request recorded.statusis preserved through the refactor:ChangeRequest#cloneWithoutFileChanges()copiesstatusverbatim, and the sole production caller wraps the call betweenChangeRequestRefactoringEvent/ChangeRequestRefactoredEvent, which preventsFileChangeUpdatedListenerfrom recomputing the status while it runs.falseto preserve existing behavior; nothing changes unless an admin opts in.Executed Tests
mvn -B -ntp -T 1C install(full reactor: api, discussions, default, notifications, ui, replication, xip) — green.mvn -B -ntp -Pintegration-tests,docker test-compileonapplication-changerequest-test-docker— compiles, 0 Checkstyle violations, license check green. The new/extendedRefactoringChangeRequestIT#refactoringMergedChangeRequestWhenConfigurationEnabledwas statically verified only (not run against a live Docker instance).DefaultChangeRequestStorageManagerTest#refactorTargetEntityPreservesStatusOfMergedChangeRequest, verified to actually catch a regression by temporarily breakingcloneWithoutFileChanges()and confirming the test failed, then reverting.mvn -B -ntp xar:verifyonapplication-changerequest-ui— green.Expected merging strategy
Prefers squash: Yes
Generated with Claude Code