Skip to content

Refactor FXIOS-11023 [Glean] Use glean wrapper for DefaultShareTelemetry#24231

Closed
aya-en-amir wants to merge 2 commits intomozilla-mobile:mainfrom
aya-en-amir:FXIOS-11023-refactor-DefaultShareTelemetry-with-gleanwrapper
Closed

Refactor FXIOS-11023 [Glean] Use glean wrapper for DefaultShareTelemetry#24231
aya-en-amir wants to merge 2 commits intomozilla-mobile:mainfrom
aya-en-amir:FXIOS-11023-refactor-DefaultShareTelemetry-with-gleanwrapper

Conversation

@aya-en-amir
Copy link
Contributor

📜 Tickets

Jira ticket
Github issue

💡 Description

Updated DefaultShareTelemetry + unit tests to use glean wrapper.

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

@aya-en-amir aya-en-amir requested a review from a team as a code owner January 18, 2025 20:14
@DanielDervishi DanielDervishi requested review from DanielDervishi and cyndichin and removed request for FilippoZazzeroni January 20, 2025 00:06
Copy link
Contributor

@DanielDervishi DanielDervishi left a comment

Choose a reason for hiding this comment

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

Great Work Enaya!


func createSubject() -> ShareTelemetry {
return DefaultShareTelemetry()
return DefaultShareTelemetry(gleanWrapper: GleanWrapper)
Copy link
Contributor

@DanielDervishi DanielDervishi Jan 20, 2025

Choose a reason for hiding this comment

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

Suggested change
return DefaultShareTelemetry(gleanWrapper: GleanWrapper)
return DefaultShareTelemetry(gleanWrapper: gleanWrapper)

Just noticed after the fact, we should be passing in the gleanWrapper variable rather than the protocol itself :)

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 we will want to pass in the mock here

Copy link
Contributor

@cyndichin cyndichin left a comment

Choose a reason for hiding this comment

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

looks good! except the one change pointed out by @DanielDervishi. Thank you for making the updates + helping us improve our tests!

Comment on lines -22 to -26
// Due to changes allow certain custom pings to implement their own opt-out
// independent of Glean, custom pings may need to be registered manually in
// tests in order to puth them in a state in which they can collect data.
Glean.shared.registerPings(GleanMetrics.Pings.shared)
Glean.shared.resetGlean(clearStores: true)
Copy link
Contributor

Choose a reason for hiding this comment

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

🔥


func createSubject() -> ShareTelemetry {
return DefaultShareTelemetry()
return DefaultShareTelemetry(gleanWrapper: GleanWrapper)
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 we will want to pass in the mock here

@aya-en-amir aya-en-amir closed this by deleting the head repository Feb 3, 2025
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