Skip to content

Conversation

@akhil-testsigma
Copy link
Contributor

@akhil-testsigma akhil-testsigma commented Dec 17, 2025

Publish this addon as public

Addon Name: Mock Geo Location
Jarvis Link: https://jarvis.testsigma.com/ui/tenants/2817/addons
Jira : https://testsigma.atlassian.net/browse/TP-2024
Removed chrome version dependency in the addon

Summary by CodeRabbit

  • Chores

    • Project version updated to 1.0.10
    • commons-lang3 dependency upgraded to 3.17.0
  • Bug Fixes

    • Improved error handling in geolocation override functionality
    • Enhanced geolocation override mechanism stability

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

This PR updates the MockGeoLocationAction class to refactor DevTools geolocation override implementation from direct Emulation API calls to a Map-based Command payload approach. It also increments the project version to 1.0.10 and updates the commons-lang3 dependency to 3.17.0.

Changes

Cohort / File(s) Change Summary
Dependency and Version Updates
mock_geo_location/pom.xml
Project version incremented from 1.0.9 to 1.0.10; commons-lang3 dependency updated from 3.14.0 to 3.17.0
Geolocation Override Refactoring
mock_geo_location/src/main/java/com/testsigma/addons/web/MockGeoLocationAction.java
Refactored geolocation override to use Map-based payload with generic Command instead of direct Emulation API; removed Optional usage for geolocation fields; changed error handling from getStackTrace(e) to ExceptionUtils.getMessage(e); updated imports accordingly

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that the Map structure (latitude, longitude, accuracy) matches the expected DevTools Emulation.setGeolocationOverride API format
  • Confirm error handling message change does not inadvertently lose important diagnostic information
  • Ensure geolocation override functionality is preserved after the refactoring

Possibly related PRs

Suggested reviewers

  • Ganesh-Testsigma
  • vigneshtestsigma

Poem

🐰 A map and command replace the old way,
Coordinates bundled, no Optional's delay!
Commons-lang strengthened, the version climbs high,
Geolocation polished beneath the dev sky! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing Chrome version dependency from the Mock Geo Location addon by replacing Chrome DevTools Emulation API with a generic Command-based approach.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/TP-2024-Removed-chrome-version-dependency-in-the-addon

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.

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: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f6d6b7c and 4355f84.

📒 Files selected for processing (2)
  • mock_geo_location/pom.xml (2 hunks)
  • mock_geo_location/src/main/java/com/testsigma/addons/web/MockGeoLocationAction.java (2 hunks)
🔇 Additional comments (4)
mock_geo_location/pom.xml (1)

9-9: LGTM! Version bump is appropriate.

The minor version increment from 1.0.9 to 1.0.10 is appropriate for the changes described in the PR objectives.

mock_geo_location/src/main/java/com/testsigma/addons/web/MockGeoLocationAction.java (3)

12-12: LGTM - Imports support the version-independent approach.

The addition of Command, HashMap, and Map imports aligns with the refactoring from typed DevTools API to a raw CDP command approach, which helps achieve Chrome version independence.

Also applies to: 17-18


91-91: Good improvement - concise user-facing error messages.

Changing from getStackTrace(e) to getMessage(e) for the user-facing error message is appropriate. The full stack trace remains available in the logs (line 90) for debugging, while users receive a cleaner, more actionable error message.


81-86: The Command API usage and CDP protocol implementation are correct.

All verification checks passed:

  • The Command constructor correctly accepts a String command name and Map<String, Object> of parameters
  • Parameter keys ("latitude", "longitude", "accuracy") match the Chrome DevTools Protocol specification
  • The empty diamond operator is appropriate since this CDP command does not send a response
  • The refactoring approach properly trades version-specific type safety for runtime flexibility across CDP protocol versions

<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
<version>3.17.0</version>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Upgrade commons-lang3 to 3.18.0 or later to address CVE-2025-48924.

Version 3.17.0 is available on Maven Central, but commons-lang3 3.0 before 3.18.0 is affected by CVE-2025-48924, where the ClassUtils.getClass(...) method can throw StackOverflowError on very long inputs. Upgrade to version 3.18.0 or later, which fixes the issue. Consider updating to 3.20.0 for the latest stable release.

🤖 Prompt for AI Agents
In mock_geo_location/pom.xml around line 67 the project pins commons-lang3 to
3.17.0 which is vulnerable to CVE-2025-48924; update the dependency version to
3.18.0 or later (recommend 3.20.0) in the pom, ensure any other occurrences or
parent/dependencyManagement entries are updated consistently, run mvn -U clean
verify to refresh the lock/state and build to confirm no regressions, and commit
the version bump.

@akhil-testsigma akhil-testsigma merged commit d22206f into dev Dec 17, 2025
2 checks passed
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