Skip to content

Conversation

@pm-dimagi
Copy link
Contributor

@pm-dimagi pm-dimagi commented May 13, 2025

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

  • Do we need to enhance the manual QA test coverage ? If yes, the "QA Note" label is set correctly
  • Does the PR introduce any major changes worth communicating ? If yes, the "Release Note" label is set and a "Release Note" is specified in PR description.
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

Release Note: Adds two new Xpath methods closest-point-on-polygon and is-point-inside-polygon

@coderabbitai
Copy link

coderabbitai bot commented May 13, 2025

📝 Walkthrough

Walkthrough

Two new class names, "org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc" and "org.javarosa.xpath.expr.XPathIsPointInsidePolygonFunc", were added to the completeHistoryOfExternalizableClasses list in the FormStorageTest class. These changes are annotated as being introduced in version 2.55. No other modifications to logic, control flow, or error handling were made.

Suggested labels

skip-integration-tests

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3636000 and b759f1f.

📒 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

Comment on lines 362 to 363
, "org.javarosa.xpath.expr.XPathClosestPointOnPolygonFunc"
, "org.javarosa.xpath.expr.XPathIsPointInsidePolygonFunc"
Copy link

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_FILES

Length 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"
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shubham1g5 shubham1g5 added the skip-integration-tests Skip android tests. label May 13, 2025
@pm-dimagi pm-dimagi requested a review from shubham1g5 May 13, 2025 20:13
@shubham1g5 shubham1g5 changed the title -updated formStorageTest file with latest xcode functions -updated formStorageTest file with latest Xpath functions May 14, 2025
@shubham1g5 shubham1g5 added this to the 2.57 milestone May 14, 2025
@shubham1g5 shubham1g5 merged commit f0ea8d7 into master May 14, 2025
5 of 7 checks passed
@shubham1g5 shubham1g5 deleted the pm_formStorageTest branch May 14, 2025 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants