Automattic / Automattic-Tracks-Android

Client library for tracking user events for later analysis
GNU General Public License v2.0
27 stars 13 forks source link

Remove CrashLoggingDataProvider.releaseName #204

Closed crazytonyli closed 3 months ago

crazytonyli commented 3 months ago

The same change was made to the iOS Tracks library in https://github.com/Automattic/Automattic-Tracks-iOS/pull/267. The gist is we'd want to use the default release name, whose format is <app-id>@<version>+<build>.

See pdnsEh-1mT-p2 and p1710798607285959-slack-C6H8C3G23

oguzkocer commented 3 months ago

@crazytonyli Since this library doesn't have major/minor releases, I suggest updating the clients before merging this to avoid breaking any of the clients.

crazytonyli commented 3 months ago

@oguzkocer Thanks for the heads up! I'll look into updating the apps now.

crazytonyli commented 3 months ago

@oguzkocer I have updated the apps. See the linked PR above ⏫

Since this library doesn't have major/minor releases

Do you mean the library releases don't follow semantic versioning? Once this PR is merged, should I publish the new release as 4.0.0 or 3.5.1?

wzieba commented 3 months ago

Or maybe even easier way: keep val releaseName: String but make it nullable. Then update WooCommerce Android logic to:

override val releaseName: String? = if (buildConfig.debug) {
        DEBUG_RELEASE_NAME
    } else {
        // delegate preparing release name to Sentry SDK
        null
    }
oguzkocer commented 3 months ago

Do you mean the library releases don't follow semantic versioning? Once this PR is merged, should I publish the new release as 4.0.0 or 3.5.1?

Unfortunately we don't follow semantic versioning as closely as we should. I'd tag this as 4.0.0 because we know it has breaking changes. Btw, if it didn't, it'd be 3.6.0 since the z in x.y.z is reserved for patches/hotfixes.

oguzkocer commented 3 months ago

Or maybe even easier way: keep val releaseName: String but make it nullable.

@wzieba I am not a fan of overloading the meaning of null value like this in a library. If we want to make it optional, let's use a sealed class, so we can tell how it'll be handled without having to look up the implementation. Something like:

sealed class SentryReleaseName {
    class SetByApplication(val releaseName: String): SentryReleaseName()
    data object SetByTracksLibrary : SentryReleaseName()
}
wzieba commented 3 months ago

Sure, good idea @oguzkocer 👍 We have a similar approach with PerformanceMonitoringConfig

https://github.com/Automattic/Automattic-Tracks-Android/blob/7f6f941f2454ec8d97523ee9e90b6ae8fd74dad6/AutomatticTracks/src/main/java/com/automattic/android/tracks/crashlogging/CrashLoggingDataProvider.kt#L83-L104

wzieba commented 3 months ago

One thing I'd change to this suggestion is to make it SDK-agnostic, as the rest of the crashlogging module, I mean SentryReleaseName -> ReleaseName or CrashLoggingReleaseName

crazytonyli commented 3 months ago

@wzieba Good catch regarding the PR releases.

In WooCommerce Android we have this logic [...] which prevents from adding multiple "PR releases", as it is in WordPress/Jetpack app

I noticed the WC iOS app has PR releases in Sentry too. Would it be okay to make the Android app do the same?

Screenshot 2024-03-21 at 11 17 41 AM
wzieba commented 3 months ago

I noticed the WC iOS app has PR releases in Sentry too. Would it be okay to make the Android app do the same?

I'm not sure. What I'd like to keep is to not create releases for PRs, but keep them all in artificial "debug" release as the logic from WC Android goes. The PR releases don't seem to have any value for product teams, and they just clutter the dashboard. I'd vote more to keep this kind of logic in clients instead:

image
wzieba commented 3 months ago

I've prepared the suggestion in form of PR, #206 WDYT @crazytonyli ?

wzieba commented 3 months ago

@oguzkocer

Unfortunately we don't follow semantic versioning as closely as we should.

That's true 😕. I think binary compatibility validator could help us in this matter for crashlogging package at least, by raising awareness of the API contract. I added #207 to track it.

crazytonyli commented 3 months ago

The PR releases don't seem to have any value for product teams, and they just clutter the dashboard.

I agree. Finding crash report is probably the only value in the PR releases. And having one release for all PRs is sufficient for finding crash reports.

I don't really have a strong opinion on either approach. But I do feel like there is value in keeping it consistent across all apps on both platforms.

206 looks good to me. What do you think rebasing that PR with the trunk branch and I'll close this one?

wzieba commented 3 months ago

But I do feel like there is value in keeping it consistent across all apps on both platforms.

Good idea 👍 I'll come up with a PR to iOS Tracks.

https://github.com/Automattic/Automattic-Tracks-Android/pull/206 looks good to me. What do you think rebasing that PR with the trunk branch and I'll close this one?

Sure thing, thanks!

crazytonyli commented 3 months ago

Closing in favor of #206.