Skip to content

Fix workflows for Firebase Sessions #4841

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

Merged
merged 6 commits into from
Apr 5, 2023
Merged

Conversation

mrober
Copy link
Contributor

@mrober mrober commented Apr 3, 2023

Fix workflows for Firebase Sessions

  • Use the googleServices.gradle file instead of the Google Services plugin directly
  • Remove a package level function because it was generating a public class called ApplicationInfoKt that was showing up in the api surface
  • Add AndroidManifest.xml file with versionName set to fix android tests
  • Update pinned deps

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 3, 2023

Coverage Report 1

Affected Products

  • firebase-sessions

    Overall coverage changed from ? (f1c51b5) to 48.48% (e3ad2a4) by ?.

    FilenameBase (f1c51b5)Merge (e3ad2a4)Diff
    ApplicationInfo.kt?100.00%?
    FirebaseSessions.kt?0.00%?
    FirebaseSessionsRegistrar.kt?0.00%?
    SessionCoordinator.kt?83.33%?
    SessionEvent.kt?100.00%?
    SessionEvents.kt?100.00%?
    SessionGenerator.kt?22.73%?
    SessionInitiator.kt?0.00%?
    WallClock.kt?0.00%?

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/Eh7OpQq09b.html

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-sessions:
error: Added class com.google.firebase.sessions.ApplicationInfoKt [AddedClass]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2023

Unit Test Results

12 files  12 suites   21s ⏱️
15 tests 15 ✔️ 0 💤 0
30 runs  30 ✔️ 0 💤 0

Results for commit e1d419b.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 3, 2023

Size Report 1

Affected Products

  • base

    TypeBase (f1c51b5)Merge (e3ad2a4)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?8.65 kB? (?)
  • firebase-sessions

    TypeBase (f1c51b5)Merge (e3ad2a4)Diff
    aar?34.4 kB? (?)
    apk (aggressive)?203 kB? (?)
    apk (release)?1.69 MB? (?)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/jxGiG0PXRV.html

@mrober mrober requested review from visumickey and samedson April 4, 2023 12:48
@mrober
Copy link
Contributor Author

mrober commented Apr 4, 2023

The Javadoc failure should be fixed when #4847 lands.

Comment on lines +45 to +47
implementation("com.google.firebase:firebase-common-ktx:20.3.2")
implementation("com.google.firebase:firebase-components:17.1.0")
implementation("com.google.firebase:firebase-encoders-json:18.0.1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Changes look good to me here. But curious why we choose pinned versions over a HEAD dependency! Would be a good learning for all of for future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was an effort across the whole repo to pin dep versions see go/firebase-android-cross-deps


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.firebase.sessions.test"
android:versionCode="1"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do a dynamic version code here? For eg: number of days since January 2023? I'm trying to see if we can get some dynamicity in the data that is generated especially for the ApplicationInfo proto message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see an easy way to do that inside this manifest file. Maybe we can do it programmatically for that one test later.


fun getApplicationInfo(firebaseApp: FirebaseApp): ApplicationInfo {
val packageName = firebaseApp.applicationContext.packageName
val packageInfo = firebaseApp.applicationContext.packageManager.getPackageInfo(packageName, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid such a long include, can we import the package to make it look leaner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These aren't package imports, these are getters. Like firebaseApp.getApplicationContext().getPackageManager(). I can still make it look leaner by adding another val.

@@ -47,3 +46,6 @@ dependencies {
implementation("androidx.core:core-ktx:1.9.0")
implementation("com.google.android.material:material:1.8.0")
}

extra["packageName"] = "com.google.firebase.testing.sessions"
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. Why specify the package name here and not in the manifest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is how we pass a package name to the googleServices.gradle file below.

@mrober mrober merged commit 69de793 into firebase-sessions Apr 5, 2023
@mrober mrober deleted the sessions-action branch April 5, 2023 12:57
@firebase firebase locked and limited conversation to collaborators May 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants