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

feat: Sending configuration to mixpanel #1504

Merged
merged 21 commits into from
Jan 20, 2021
Merged

feat: Sending configuration to mixpanel #1504

merged 21 commits into from
Jan 20, 2021

Conversation

adamfilipow92
Copy link
Contributor

@adamfilipow92 adamfilipow92 commented Jan 14, 2021

Fixes #1503

Test Plan

How do we know the code works?

  1. Flank sending configuration to mixpanel
  2. If integration tests or unit sending configuration disabled
  3. Flag to disable sending statistics works
  4. environment-variables, paths to files anonymized (maybe something more?)

Checklist

  • Sending usage statistics to mixpanel
  • Flag to disable usage statistic
  • Disable usage statistic in tests
  • Anonymized sensitive data
  • Unit tested
  • Integration tests updated
  • respects the same analytics opt out as gcloud CLI.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2021

Timestamp: 2021-01-20 16:44:37
Buildscan url for ubuntu-workflow run 498716014
https://gradle.com/s/mibklz5ddczoc

@pawelpasterz
Copy link
Contributor

pawelpasterz commented Jan 15, 2021

I think we should not send statistics from developer environment (our, local, manual tests could spoil statistics). DIsabling for IT or UT is great but I think it won't be enough. Statistics should be only from official releases?
This is an open question.

@pawelpasterz
Copy link
Contributor

pawelpasterz commented Jan 15, 2021

I think we should not send statistics from developer environment (our, local, manual tests could spoil statistics). DIsabling for IT or UT is great but I think it won't be enough. Statistics should be only from official releases?
This is an open question.

On the second thought, it should be possible to filter local_snapshot statistics so it should not be an issue (at least I think)

@piotradamczyk5
Copy link
Contributor

I think we should not send statistics from developer environment (our, local, manual tests could spoil statistics). DIsabling for IT or UT is great but I think it won't be enough. Statistics should be only from official releases?
This is an open question.

On the second thought, it should be possible to filter local_snapshot statistics so it should not be an issue (at least I think)

we could make a flag and store it in FlankProperties 😃

@bootstraponline
Copy link
Contributor

I think the uuid opt out should also apply to mixpanel

Flank respects the same analytics opt out as gcloud CLI.

echo "DISABLED" > ~/.gsutil/analytics-uuid


private val classesForStatistics = listOf(IArgs::class, AndroidArgs::class, IosArgs::class)

private fun KClass<*>.ignoredMembersForStatistics() = findMembersWithAnnotation(IgnoreInStatistics::class)
Copy link
Contributor

Choose a reason for hiding this comment

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

please move below keysToRemove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed thanks! 👍

private val classesForStatistics = listOf(IArgs::class, AndroidArgs::class, IosArgs::class)

private fun KClass<*>.ignoredMembersForStatistics() = findMembersWithAnnotation(IgnoreInStatistics::class)
private fun KClass<*>.anonymousMembersForStatistics() = findMembersWithAnnotation(AnonymizeInStatistics::class)
Copy link
Contributor

Choose a reason for hiding this comment

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

please move below keysToAnonymize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed thanks! 👍

@piotradamczyk5
Copy link
Contributor

Please remeber to update flank.yml, flank.ios.yml, docs/index.md etc with new option

@adamfilipow92 adamfilipow92 marked this pull request as ready for review January 20, 2021 10:02
Copy link
Contributor

@jan-goral jan-goral left a comment

Choose a reason for hiding this comment

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

The implementation looks well! 👍 I have added a few suggestions but all related to one thing.

annotation class AnonymizeInStatistics

internal val keysToRemove by lazy {
classesForStatistics.map { it.ignoredMembersForStatistics() }.flatten()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
classesForStatistics.map { it.ignoredMembersForStatistics() }.flatten()
classesForStatistics.map(findMembersWithAnnotation(IgnoreInStatistics::class)).flatten()

classesForStatistics.map { it.ignoredMembersForStatistics() }.flatten()
}

private fun KClass<*>.ignoredMembersForStatistics() = findMembersWithAnnotation(IgnoreInStatistics::class)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private fun KClass<*>.ignoredMembersForStatistics() = findMembersWithAnnotation(IgnoreInStatistics::class)

@mergify mergify bot merged commit 6df778f into master Jan 20, 2021
@mergify mergify bot deleted the 1460-mix-panel-poc branch January 20, 2021 16:44
@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Mixpanel] Collect configuration statistics
5 participants