-
Notifications
You must be signed in to change notification settings - Fork 305
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
Add MAESTRO_CLI_NO_ANALYTICS
flag
#1848
Conversation
a27be00
to
5e2e8e7
Compare
@@ -73,6 +77,13 @@ object Analytics { | |||
fun maybeAskToEnableAnalytics() { | |||
if (hasRunBefore) return | |||
|
|||
// Fix for https://github.com/mobile-dev-inc/maestro/issues/1846 | |||
if (CiUtils.getCiProvider() != null) { |
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.
Let's maybe give DISABLE_ANALYTICS_ENV_VAR false by default if its CI?
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.
We only need analytics if user is sourcing from CLI
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.
Are you sure? We set uuid
to name of the CI service if we're running on CI:
maestro/maestro-cli/src/main/java/maestro/cli/analytics/Analytics.kt
Lines 191 to 193 in 21ae6eb
private fun generateUUID(): String { | |
return CiUtils.getCiProvider() ?: UUID.randomUUID().toString() | |
} |
which then gets uploaded to our backend:
uuid = uuid ?: generateUUID(), |
I think it can be useful knowledge to know what CI service is most used*, so we would have some data if we will have to build integrations with CIs in the future.
*A problem here may be that we don't have UUIDs of specific CI installations. We would need to have separate "UUID" and "CI" values in the AnalyticsReport.
maestro/maestro-cli/src/main/java/maestro/cli/analytics/Analytics.kt
Lines 204 to 220 in 21ae6eb
// AnalyticsReport must match equivalent monorepo model in: | |
// mobile.dev/api/models/src/main/java/models/maestro/AnalyticsReport.kt | |
@JsonIgnoreProperties(ignoreUnknown = true) | |
data class AnalyticsReport( | |
@JsonProperty("deviceUuid") val uuid: String, | |
@JsonProperty("freshInstall") val freshInstall: Boolean, | |
@JsonProperty("version") val cliVersion: String, | |
@JsonProperty("os") val os: String, | |
@JsonProperty("osArch") val osArch: String, | |
@JsonProperty("osVersion") val osVersion: String, | |
@JsonProperty("javaVersion") val javaVersion: String?, | |
@JsonProperty("xcodeVersion") val xcodeVersion: String?, | |
@JsonProperty("flutterVersion") val flutterVersion: String?, | |
@JsonProperty("flutterChannel") val flutterChannel: String?, | |
@JsonProperty("androidVersions") val androidVersions: List<String>, | |
@JsonProperty("iosVersions") val iosVersions: List<String>, | |
) |
Otherwise analytics from various runs on CI get merged together.
Make sure to run ./maestro-ios-xctest-runner/build-maestro-ios-runner.sh with every swift change |
fix #1846