Skip to content

Conversation

@rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Jan 5, 2026

Going to tackle error handling and unhappy path stuff next. More refactoring to be done as well.

Going to tackle error handling and unhappy path stuff next. More refactoring to be done as well.
Copilot AI review requested due to automatic review settings January 5, 2026 21:27
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Copyright Validation Results
Total: 9 | Passed: 9 | Failed: 0 | Skipped: 0 | at: 2026-01-05 21:27:39 UTC | commit: 9d6f67b

✅ Valid Files

  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/ContentExclusionUtil.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteEvalFilter.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteFilter.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteOpticFilter.java
  • marklogic-client-api/src/main/java/com/marklogic/client/impl/XmlFactories.java
  • marklogic-client-api/src/main/java/com/marklogic/client/io/DOMHandle.java
  • marklogic-client-api/src/test/java/com/marklogic/client/datamovement/filter/AbstractIncrementalWriteTest.java
  • marklogic-client-api/src/test/java/com/marklogic/client/datamovement/filter/ApplyExclusionsToIncrementalWriteTest.java
  • marklogic-client-api/src/test/java/com/marklogic/client/datamovement/filter/IncrementalWriteTest.java

✅ All files have valid copyright headers!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces XML exclusion support for the IncrementalWriteFilter, extending the existing JSON exclusion functionality. The implementation allows users to specify XPath expressions to exclude specific XML elements from hash calculations during incremental writes.

Key changes:

  • Added xmlExclusions parameter throughout the IncrementalWriteFilter class hierarchy
  • Implemented XML exclusion logic using XPath expressions in ContentExclusionUtil
  • Refactored test structure by extracting common test setup into AbstractIncrementalWriteTest

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
IncrementalWriteTest.java Refactored to extend AbstractIncrementalWriteTest and removed JSON exclusion test
ApplyExclusionsToIncrementalWriteTest.java New test class containing both JSON and XML exclusion tests
AbstractIncrementalWriteTest.java New base class providing shared test setup and utilities
DOMHandle.java Updated to use centralized XmlFactories for XPath processor creation
XmlFactories.java Added factory methods for XPathFactory and TransformerFactory
IncrementalWriteOpticFilter.java Updated constructor to accept xmlExclusions parameter
IncrementalWriteFilter.java Added xmlExclusions support and XML processing logic
IncrementalWriteEvalFilter.java Updated constructor to accept xmlExclusions parameter
ContentExclusionUtil.java Implemented XML exclusion functionality with XPath support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* @return the modified XML content with specified elements removed
* @throws Exception if the XML content cannot be parsed or serialized
*/
static String applyXmlExclusions(String uri, String xmlContent, String... xpathExpressions) throws Exception {
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing generic Exception reduces clarity for API consumers. Consider creating a specific exception type or throwing more specific exceptions like XPathExpressionException or TransformerException to help callers handle errors appropriately.

Copilot uses AI. Check for mistakes.
@rjrudin rjrudin merged commit 86f5aa7 into develop Jan 5, 2026
3 checks passed
@rjrudin rjrudin deleted the feature/26427-exclusions-xml branch January 5, 2026 22:54
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.

3 participants