Skip to content

Adding work item filters support#275

Merged
bachuv merged 4 commits intomainfrom
vabachu/work-item-filters
Apr 2, 2026
Merged

Adding work item filters support#275
bachuv merged 4 commits intomainfrom
vabachu/work-item-filters

Conversation

@bachuv
Copy link
Copy Markdown
Contributor

@bachuv bachuv commented Mar 27, 2026

Issue describing the changes in this PR

Adding work items filter support for the Java SDK.

resolves #issue_for_this_pr

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes are added to the CHANGELOG.md
  • I have added all required tests (Unit tests, E2E tests)

@bachuv bachuv requested a review from a team as a code owner March 27, 2026 16:35
Copilot AI review requested due to automatic review settings March 27, 2026 16:35
*
* @return an unmodifiable list of activity filters
*/
public List<ActivityFilter> getActivities() {
Copy link
Copy Markdown
Contributor

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

Adds work-item filtering support to the Java SDK worker so the backend can dispatch only matching orchestration/activity work items to a given DurableTaskGrpcWorker, with builder APIs for explicit or auto-generated filters.

Changes:

  • Introduces WorkItemFilter model + builder for orchestration/activity name (+ optional version) filters.
  • Extends DurableTaskGrpcWorkerBuilder to accept explicit filters or auto-generate filters from registered task types (with versioning-aware behavior for STRICT matching).
  • Updates DurableTaskGrpcWorker to send WorkItemFilters in GetWorkItemsRequest and adds unit tests + changelog entry.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
client/src/main/java/com/microsoft/durabletask/WorkItemFilter.java New public API type representing orchestration/activity work-item filters.
client/src/main/java/com/microsoft/durabletask/DurableTaskGrpcWorkerBuilder.java Adds useWorkItemFilters(...) APIs and auto-generation of filters during build().
client/src/main/java/com/microsoft/durabletask/DurableTaskGrpcWorker.java Sends filters to the sidecar via GetWorkItemsRequest.workItemFilters.
client/src/test/java/com/microsoft/durabletask/WorkItemFilterTest.java Unit tests for WorkItemFilter behavior + proto conversion.
client/src/test/java/com/microsoft/durabletask/WorkItemFilterBuilderTest.java Unit tests for builder/worker integration of explicit and auto-generated filters.
CHANGELOG.md Notes new work item filtering support in Unreleased.

YunchuWang
YunchuWang previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Member

@YunchuWang YunchuWang left a comment

Choose a reason for hiding this comment

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

LGTM. Well-structured implementation following existing SDK conventions (builder pattern, immutability, JDK 8 compat). Good test coverage with 22 tests. Two minor suggestions for future consideration: (1) add a TODO comment for EntityFilter support when entities are implemented in the Java SDK, (2) add a code comment explaining why CURRENTOROLDER version strategy intentionally omits versions in auto-generated filters. Neither is a blocker.

@bachuv bachuv requested a review from YunchuWang April 1, 2026 16:53
@bachuv bachuv merged commit 24ee90e into main Apr 2, 2026
8 checks passed
@bachuv bachuv deleted the vabachu/work-item-filters branch April 2, 2026 01:03
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