Skip to content

Remove support for dynamic search#1537

Merged
MartinRiese merged 1 commit into
masterfrom
riese/rm_dynamicSearch
May 7, 2026
Merged

Remove support for dynamic search#1537
MartinRiese merged 1 commit into
masterfrom
riese/rm_dynamicSearch

Conversation

@MartinRiese

@MartinRiese MartinRiese commented May 6, 2026

Copy link
Copy Markdown
Contributor

Product Description

Commcare HQ does not set the dynamic search flag anymore. It has been removed in this PR: dimagi/commcare-hq#37634. Formplayer should behave the same way as
if the flag is set to false.

Technical Summary

https://dimagi.atlassian.net/browse/USH-6541

Safety Assurance

Safety story

Automated test coverage

QA Plan

Special deploy instructions

  • This PR can be deployed after merge with no further considerations.

Rollback instructions

  • This PR can be reverted after deploy with no further considerations.

Review

  • The set of people pinged as reviewers is appropriate for the level of risk of the change.

Summary by CodeRabbit

  • Refactor
    • Removed the dynamic search capability from query management.
    • Replaced with default search functionality in remote query processing.
    • Updated related data models and parsing logic to align with the new search approach.

This esentially rolls back #1358
@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown

Walkthrough

This PR replaces the dynamicSearch field with defaultSearch across the codebase. Changes include removing the dynamicSearch field from QueryScreen and RemoteQueryDatum, updating the RemoteQueryDatum constructor signature, removing related getter methods, updating serialization logic, and adjusting parser and test references.

Changes

Dynamic Search to Default Search Migration

Layer / File(s) Summary
Data Model
src/main/java/org/commcare/suite/model/RemoteQueryDatum.java
dynamicSearch field removed; constructor reordered to replace dynamicSearch parameter with defaultSearch, repositioning title and description parameters. Getter method getDynamicSearch() removed. Serialization in readExternal() and writeExternal() no longer handles dynamicSearch.
Parser Integration
src/main/java/org/commcare/xml/SessionDatumParser.java
XML parsing updated to read default_search instead of dynamic_search. RemoteQueryDatum constructor call updated to pass defaultSearch instead of dynamicSearch with adjusted parameter order.
Screen & Session Managers
src/cli/java/org/commcare/util/screen/QueryScreen.java, src/main/java/org/commcare/session/RemoteQuerySessionManager.java
QueryScreen replaces dynamicSearch field with defaultSearch and removes getDynamicSearch() getter. RemoteQuerySessionManager removes the getDynamicSearch() delegation method.
Tests & Configuration
src/test/java/org/commcare/backend/suite/model/test/CaseClaimModelTests.java, src/test/resources/case_claim_example/suite.xml
Test assertion checking getDynamicSearch() removed. Suite XML configuration attribute dynamic_search="true" removed from the query element.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

A rabbit hops through code with glee, 🐰
Swapping search flags, one, two, three!
Dynamic's gone, default's here to stay,
Defaults leading the constructors' way!
Clean refactor, simple and spry,
CommCare queries flying high!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'Remove support for dynamic search' directly and clearly summarizes the main change: removal of dynamicSearch functionality across multiple files and the public API.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch riese/rm_dynamicSearch

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MartinRiese
MartinRiese marked this pull request as ready for review May 6, 2026 17:35
@MartinRiese
MartinRiese requested review from esoergel and shubham1g5 May 6, 2026 18:19
@MartinRiese

Copy link
Copy Markdown
Contributor Author

@shubham1g5 how is the formplayer test supposed to work? Is that just for when you do not have a formplayer change? And I can ignore it here?

@shubham1g5

Copy link
Copy Markdown
Contributor

how is the formplayer test supposed to work? Is that just for when you do not have a formplayer change? And I can ignore it here?

Think it checks this change against master for FP, but given you have added FP changes in a different PR and tests are passing there, good to ignore this.

FYI @dannyroberts in case you have thoughts on how to improve this for such changes.

@MartinRiese
MartinRiese merged commit b8e3a7d into master May 7, 2026
6 of 7 checks passed
@MartinRiese
MartinRiese deleted the riese/rm_dynamicSearch branch May 7, 2026 16:14
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.

2 participants