Skip to content
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

chore(analytics): Allow analytics to be configured per env #21975

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ilmotta
Copy link
Contributor

@ilmotta ilmotta commented Jan 22, 2025

Fixes #21974

Summary

Allows MixPanel to be configured per environment. The hardcoded MixPanel app ID and token are removed from the code (see the parent issue for more details). The token can be exploited and that's by design in analytics tools https://developer.mixpanel.com/reference/project-token, but we are being too kind at the same time, so I'm removing that from code ;)

Areas that may be impacted

  • Analytics

Steps to test

I will test this PR myself.

  • Enable usage data during onboarding and from settings.
  • Check the events are published to the correct MixPanel project.

Note: to test the correct values are set-up in Jenkins for release builds we need to generate a release build. That's the reason I committed a change to the VERSION file with the PR number, as I believe this is the recommendation from infra team.

status: ready

@ilmotta ilmotta added the infra label Jan 22, 2025
@ilmotta ilmotta self-assigned this Jan 22, 2025
@ilmotta ilmotta requested review from siddarthkay and a team January 22, 2025 15:27
@ilmotta ilmotta force-pushed the ilmotta/configure-mixpanel-per-env branch from 7d89cf6 to 61bf682 Compare January 22, 2025 15:28
@status-im-auto
Copy link
Member

status-im-auto commented Jan 22, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 61bf682 #3 2025-01-22 15:34:15 ~5 min tests 📄log
✔️ 61bf682 #3 2025-01-22 15:38:11 ~9 min android-e2e 🤖apk 📲
✔️ 61bf682 #3 2025-01-22 15:39:06 ~10 min android 🤖apk 📲
✔️ 61bf682 #3 2025-01-22 15:41:07 ~12 min ios 📱ipa 📲

@ilmotta
Copy link
Contributor Author

ilmotta commented Jan 22, 2025

Thanks for the swift reviews guys!


@siddarthkay I tagged you as a reviewer to help us configure the vars in Jenkins. The shadow-cljs code already allows passing the vars to the initialization code in status-go, so I believe it's just a matter of passing down the vars from Jenkins. The parent issue has the details about what we expect to be configured #21974 in Jenkins. When the time is appropriate for you, could you help us by adding the vars to Jenkins? Thanks!

@status-im-auto
Copy link
Member

75% of end-end tests have passed

Total executed tests: 8
Failed tests: 2
Expected to fail tests: 0
Passed tests: 6
Not executed tests: 2
IDs of not executed tests: 741554,741555 
IDs of failed tests: 740490,702843 

Not executed tests (2)

Click to expand
  • Rerun not executed tests
  • Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestWalletOneDevice:

    1. test_wallet_balance_mainnet, id: 740490

    Device 1: Find `Button` by `accessibility id`: `network-dropdown`
    Device 1: Tap on found: Button

    critical/test_wallet.py:260: in test_wallet_balance_mainnet
        self.errors.verify_no_errors()
    base_test_case.py:176: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     For the Ether the wrong value 0.0062 is shown, expected 0.0052 in total
    E    For the Status the wrong value 13.0 is shown, expected 10.0 in total
    E    For the Ether the wrong value 0.0011 is shown, expected 0.0001 on Optimism
    E    For the Status the wrong value 3.0 is shown, expected 0 on Optimism
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 1: Find EmojisNumber by xpath: //*[starts-with(@text,'Message AFTER edit 2 (Edited)')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-2']/android.widget.TextView[2]
    Device 1: Element EmojisNumber text is equal to 1

    critical/chats/test_public_chat_browsing.py:380: in test_community_message_edit
        self.errors.verify_no_errors()
    base_test_case.py:176: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message is not edited
    



    Device sessions

    Passed tests (6)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    2. test_wallet_send_eth, id: 727229

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    @ilmotta
    Copy link
    Contributor Author

    ilmotta commented Feb 3, 2025

    @siddarthkay, please let me know when you have set up the CI with the vars MIXPANEL_APP_ID and MIXPANEL_TOKEN so I can proceed with testing this PR. Thank you 🦾

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    Status: E2E Tests
    Development

    Successfully merging this pull request may close these issues.

    Segregate centralized analytics per environment
    6 participants