-
-
Notifications
You must be signed in to change notification settings - Fork 45
-updated formStorageTest file with latest Xpath functions #3103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughTwo new class names, "org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc" and "org.javarosa.xpath.expr.XPathIsPointInsidePolygonFunc", were added to the Suggested labels
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/unit-tests/src/org/commcare/android/tests/processing/FormStorageTest.java(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Lint Code Base
| , "org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc" | ||
| , "org.javarosa.xpath.expr.XPathIsPointInsidePolygonFunc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify PrototypeFactory migration entries for the new XPath functions.
The two newly added class names
"org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc",
"org.javarosa.xpath.expr.XPathIsPointInsidePolygonFunc"must exactly match the definitions in CommCare Core, and AndroidPrototypeFactory.getMigratedClassNames() needs to include migration logic for both. If these mappings aren’t present, testAllExternalizablesInPrototypeFactory will fail at runtime.
Please run the following script to confirm that AndroidPrototypeFactory has entries for these classes:
This will ensure that both function classes are properly registered for deserialization migration.
🏁 Script executed:
#!/bin/bash
# Verify that AndroidPrototypeFactory migration mappings exist for the two new XPath functions
# Locate the factory implementation
FACTORY_FILES=$(fd AndroidPrototypeFactory.java)
echo "Checking in: $FACTORY_FILES"
# Search for each new function class name
rg -Hn "XPathClosestPointOnPolygonFunc" $FACTORY_FILES
rg -Hn "XPathIsPointInsidePolygonFunc" $FACTORY_FILESLength of output: 449
Add missing migration entries for new XPath functions in AndroidPrototypeFactory
Our verification found no registrations for the two new function classes in AndroidPrototypeFactory.java (checked in app/src/org/commcare/models/AndroidPrototypeFactory.java). You’ll need to update the migration logic in getMigratedClassNames() to include both:
• app/src/org/commcare/models/AndroidPrototypeFactory.java
// inside getMigratedClassNames()
migrated.add("org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc");
migrated.add("org.javarosa.xpath.expr.XPathIsPointInsidePolygonFunc");Without these entries, testAllExternalizablesInPrototypeFactory will fail at runtime. Please add and verify both mappings.
🤖 Prompt for AI Agents (early access)
In app/src/org/commcare/models/AndroidPrototypeFactory.java around the
getMigratedClassNames() method, add migration entries for the two new XPath
function classes "org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc" and
"org.javarosa.xpath.expr.XPathIsPointInsidePolygonFunc". Specifically, include
lines that add these class names to the migrated set to ensure they are properly
registered for deserialization migration. This will prevent runtime failures in
the testAllExternalizablesInPrototypeFactory test.
| // Added in 2.55 | ||
| , "org.javarosa.core.model.FormIndex" | ||
| , "org.commcare.models.database.InterruptedFormState" | ||
| , "org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they should be added to the bottom in 2.57 section and not in 2.55.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Product Description
Fixed formstoragetest case with changing the new Xpath function name
cross-request: dimagi/commcare-core#1455
Technical Summary
Feature Flag
Safety Assurance
Safety story
I have tested this locally on my device
Automated test coverage
We have covered the test cases to test these functions
QA Plan
Labels and Review
Release Note: Adds two new Xpath methods closest-point-on-polygon and is-point-inside-polygon