Skip to content

CCCT-2489 Add Workflow Parameter To PersonalID Continue Analytics#3770

Merged
Jignesh-dimagi merged 1 commit into
masterfrom
ccct-2489-continue-btn-analytics
Jun 23, 2026
Merged

CCCT-2489 Add Workflow Parameter To PersonalID Continue Analytics#3770
Jignesh-dimagi merged 1 commit into
masterfrom
ccct-2489-continue-btn-analytics

Conversation

@Jignesh-dimagi

@Jignesh-dimagi Jignesh-dimagi commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

CCCT-2489

Technical Summary

Adds a personalid_flow parameter to the personal_id_continue_clicked analytics event to track the origin of the Continue button press.

  • New PersonalIdWorkflow enum (CONFIGURATION / USER_PROMPT / EDIT_PROFILE, the last reserved for the future edit-profile feature), threaded through FirebaseAnalyticsUtil.reportPersonalIDContinueClicked as a required argument.
  • Config-flow fragments pass CONFIGURATION; the email screens derive the value from their existing EmailWorkFlow (existing-user prompt → USER_PROMPT, registration/recovery → CONFIGURATION).
  • Adds the previously-missing Continue event to PersonalIdPhoneVerificationFragment and PersonalIdPhotoCaptureFragment so they also report the workflow.

Safety Assurance

Safety story

What gives me confidence:

  • I ran the unit tests and reviewed the full diff.
  • The diff is narrow and analytics-only — it adds a fire-and-forget logging parameter and does not change navigation, auth, or UI behavior.
  • The new fromEmailWorkFlow mapping is covered by unit tests.

Automated test coverage

PersonalIdWorkflowTest covers the fromEmailWorkFlow mapping for all three EmailWorkFlow values (existing-user → user_prompt, registration/recovery → configuration).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jignesh-dimagi Jignesh-dimagi self-assigned this Jun 22, 2026
@Jignesh-dimagi Jignesh-dimagi added the skip-integration-tests Skip android tests. label Jun 22, 2026
@Jignesh-dimagi Jignesh-dimagi marked this pull request as ready for review June 22, 2026 11:38
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A new PersonalIdWorkflow enum is introduced with three states (CONFIGURATION, USER_PROMPT, EDIT_PROFILE), each providing a stable lowercase analyticsValue. A companion fromEmailWorkFlow method maps EmailWorkFlow values to the corresponding workflow state. A new PERSONAL_ID_WORKFLOW constant ("personalid_flow") is added to CCAnalyticsParam. The FirebaseAnalyticsUtil.reportPersonalIDContinueClicked method signature is extended to accept a PersonalIdWorkflow parameter, which is now logged as an analytics event parameter. All PersonalID fragments are updated to pass the appropriate workflow argument; two fragments (PersonalIdPhoneVerificationFragment and PersonalIdPhotoCaptureFragment) also gain a previously absent analytics call. Unit tests covering the fromEmailWorkFlow mapping are added.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • dimagi/commcare-android#3745: Adds analytics for add-email offer continue/skip paths using the same FirebaseAnalyticsUtil.reportPersonalIDContinueClicked method whose signature is changed in this PR.

Suggested labels

skip-integration-tests

Suggested reviewers

  • shubham1g5
  • OrangeAndGreen
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.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 title clearly and specifically describes the main change: adding a workflow parameter to PersonalID continue analytics tracking.
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 Pull request description includes all required template sections with comprehensive technical details, safety rationale, and test coverage explanation.

✏️ 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 ccct-2489-continue-btn-analytics

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.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.96%. Comparing base (220471e) to head (87d4bf2).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3770      +/-   ##
============================================
+ Coverage     25.94%   25.96%   +0.01%     
- Complexity     4406     4408       +2     
============================================
  Files           951      953       +2     
  Lines         57223    57366     +143     
  Branches       6817     6824       +7     
============================================
+ Hits          14849    14893      +44     
- Misses        40538    40640     +102     
+ Partials       1836     1833       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

import org.junit.Assert.assertEquals
import org.junit.Test

class PersonalIdWorkflowTest {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: flagging that these tests are not achieving much given it's testing just switch case mapping and tests like this would add to overhead of changing this mapping.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it has been added for code coverage calculation purposes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Emphasizing that I don't think increasing code coverage by addition of meannigless tests should be our target as a team.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, but I don't think it is completely meaningless in this case, as the mapping needs to be protected from unintentional modifications across the app. Additionally, if we keep skipping these helper or mapper classes, we might miss testing small pieces of logic. Therefore, there is no harm in adding this test.

@conroy-ricketts conroy-ricketts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! Just some nits

* - [USER_PROMPT]: the user is acting on a prompt surfaced outside the config flow,
* e.g. the email-collection prompt shown to a logged-in user from
* {@code StandardHomeActivity} (EmailOfferHelper.checkEmailCollection).
* - [EDIT_PROFILE]: reserved for the future edit-profile feature.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small nit: can we take the word "future" out of this just in case we forget to update it later

Suggested change
* - [EDIT_PROFILE]: reserved for the future edit-profile feature.
* - [EDIT_PROFILE]: reserved for the edit-profile feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we can modify this comment once the edit profile feature becomes available.

static final String PARAM_API_NEW_JOBS = "ccc_api_new_jobs";
public static final String PERSONAL_ID_CONTINUE_CLICKED_INFO =
"personal_id_continue_button_clicked_info";
public static final String PERSONAL_ID_WORKFLOW = "personalid_flow";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: personalid_ is redundant and we could use workflow instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There may be different workflows across the app, but since this one is for personalid, we appended it to the name.

import org.junit.Test

class PersonalIdWorkflowTest {
// --- fromEmailWorkFlow ---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: this comment does not add much value and can be deleted

@Jignesh-dimagi Jignesh-dimagi merged commit 03b2392 into master Jun 23, 2026
65 of 66 checks passed
@Jignesh-dimagi Jignesh-dimagi deleted the ccct-2489-continue-btn-analytics branch June 23, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-integration-tests Skip android tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants