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

Functions migration to Kotlin #5351

Merged
merged 13 commits into from
Aug 30, 2024
Merged

Functions migration to Kotlin #5351

merged 13 commits into from
Aug 30, 2024

Conversation

emilypgoogle
Copy link
Collaborator

@emilypgoogle emilypgoogle commented Sep 21, 2023

done with automated tooling, to investigate the viability of quick migrations pre API changes.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 21, 2023

Unit Test Results

20 files   -      948  20 suites   - 948   31s ⏱️ - 34m 55s
23 tests  -   5 300  23 ✔️  -   5 279  0 💤  - 21  0 ±0 
68 runs   - 10 663  68 ✔️  - 10 621  0 💤  - 42  0 ±0 

Results for commit 2cefd77. ± Comparison against base commit 456f431.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 21, 2023

Coverage Report 1

Affected Products

  • firebase-functions

    Overall coverage changed from 33.84% (456f431) to 34.62% (5a85986) by +0.77%.

    14 individual files with coverage change

    FilenameBase (456f431)Merge (5a85986)Diff
    ContextProvider.kt?0.00%?
    FirebaseContextProvider.kt?27.78%?
    FirebaseFunctions.kt?25.00%?
    FirebaseFunctionsException.kt?0.00%?
    FunctionsComponent.kt?100.00%?
    FunctionsComponent_MainModule_Companion_BindProjectIdFactory.java?0.00%?
    FunctionsMultiResourceComponent.kt?100.00%?
    FunctionsRegistrar.kt?100.00%?
    HttpsCallableContext.kt?0.00%?
    HttpsCallableOptions.kt?55.56%?
    HttpsCallableReference.kt?52.00%?
    HttpsCallableResult.kt?0.00%?
    HttpsCallOptions.kt?52.63%?
    Serializer.kt?5.15%?

Test Logs

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

Copy link
Collaborator Author

@emilypgoogle emilypgoogle left a comment

Choose a reason for hiding this comment

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

Left some comments on notable issues

Copy link
Member

@daymxn daymxn left a comment

Choose a reason for hiding this comment

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

Some key things I was seeing to look out for:

  • package-private members
  • public properties (that had public getters or setters) need @JvmField to prevent a breaking change

Copy link
Member

@thatfiredev thatfiredev left a comment

Choose a reason for hiding this comment

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

I added some of my thoughts/suggestions/wishes for the API surface.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 20, 2023

Size Report 1

Affected Products

  • firebase-functions

    TypeBase (456f431)Merge (5a85986)Diff
    aar50.1 kB65.8 kB+15.7 kB (+31.3%)
    apk (aggressive)439 kB440 kB+740 B (+0.2%)
    apk (release)5.43 MB5.44 MB+14.3 kB (+0.3%)

Test Logs

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

@emilypgoogle emilypgoogle requested a review from daymxn October 30, 2023 16:46
Copy link
Member

@daymxn daymxn left a comment

Choose a reason for hiding this comment

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

The test failures are valid (esp the unit tests for functions). I'll see if I can't personally take a look later

@emilypgoogle
Copy link
Collaborator Author

The test failures are valid (esp the unit tests for functions). I'll see if I can't personally take a look later

Took a look and I can't repro the unit/integ test failures locally, wondering what's causing the failure in CI

@firebase firebase deleted a comment from google-oss-bot Jan 9, 2024
@emilypgoogle emilypgoogle changed the title Functions migration to Kotlin (excluding Dagger affected classes) Functions migration to Kotlin Jan 11, 2024
Copy link
Contributor

github-actions bot commented Jan 11, 2024

buildSrc Test Results

37 tests   37 ✔️  1m 4s ⏱️
  8 suites    0 💤
  8 files      0

Results for commit fac44a6.

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-functions:
error: Added method com.google.firebase.functions.FirebaseFunctions.call(String,Object,com.google.firebase.functions.HttpsCallOptions) [AddedMethod]
error: Added method com.google.firebase.functions.FirebaseFunctions.call(java.net.URL,Object,com.google.firebase.functions.HttpsCallOptions) [AddedMethod]
error: Method com.google.firebase.functions.FirebaseFunctions.getHttpsCallable has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.FirebaseFunctions.getHttpsCallable has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.FirebaseFunctions.getHttpsCallableFromUrl has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.FirebaseFunctions.getHttpsCallableFromUrl has added 'final' qualifier [AddedFinal]
error: Added method com.google.firebase.functions.FirebaseFunctions.getURL(String) [AddedMethod]
error: Method com.google.firebase.functions.FirebaseFunctions.useEmulator has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.FirebaseFunctions.useFunctionsEmulator has added 'final' qualifier [AddedFinal]
error: Added field com.google.firebase.functions.FirebaseFunctions.Companion [AddedField]
error: Added class com.google.firebase.functions.FirebaseFunctions.Companion [AddedClass]
error: Added method com.google.firebase.functions.FirebaseFunctionsException.fromResponse(com.google.firebase.functions.FirebaseFunctionsException.Code,String,com.google.firebase.functions.Serializer) [AddedMethod]
error: Method com.google.firebase.functions.FirebaseFunctionsException.getCode has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.FirebaseFunctionsException.getDetails has added 'final' qualifier [AddedFinal]
error: Added field com.google.firebase.functions.FirebaseFunctionsException.Companion [AddedField]
error: Added method com.google.firebase.functions.FirebaseFunctionsException.Code.fromHttpStatus(int) [AddedMethod]
error: Added method com.google.firebase.functions.FirebaseFunctionsException.Code.fromValue(int) [AddedMethod]
error: Added field com.google.firebase.functions.FirebaseFunctionsException.Code.Companion [AddedField]
error: Added class com.google.firebase.functions.FirebaseFunctionsException.Code.Companion [AddedClass]
error: Added class com.google.firebase.functions.FirebaseFunctionsException.Companion [AddedClass]
error: Added class com.google.firebase.functions.HttpsCallOptions [AddedClass]
error: Method com.google.firebase.functions.HttpsCallableOptions.getLimitedUseAppCheckTokens has added 'final' qualifier [AddedFinal]
error: Added field com.google.firebase.functions.HttpsCallableOptions.limitedUseAppCheckTokens [AddedField]
error: Class com.google.firebase.functions.HttpsCallableOptions.Builder added 'final' qualifier [AddedFinal]
error: Constructor com.google.firebase.functions.HttpsCallableOptions.Builder has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.HttpsCallableOptions.Builder.build has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.HttpsCallableOptions.Builder.getLimitedUseAppCheckTokens has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.HttpsCallableOptions.Builder.setLimitedUseAppCheckTokens has added 'final' qualifier [AddedFinal]
error: Added field com.google.firebase.functions.HttpsCallableOptions.Builder.limitedUseAppCheckTokens [AddedField]
error: Method com.google.firebase.functions.HttpsCallableReference.call has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.HttpsCallableReference.call has added 'final' qualifier [AddedFinal]
error: Added method com.google.firebase.functions.HttpsCallableReference.getOptions() [AddedMethod]
error: Method com.google.firebase.functions.HttpsCallableReference.getTimeout has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.HttpsCallableReference.setTimeout has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.HttpsCallableReference.withTimeout has added 'final' qualifier [AddedFinal]
error: Method com.google.firebase.functions.HttpsCallableResult.getData has added 'final' qualifier [AddedFinal]
error: Added class com.google.firebase.functions.Serializer [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.

@emilypgoogle emilypgoogle requested a review from daymxn January 11, 2024 21:19
@firebase firebase deleted a comment from google-oss-bot Jan 11, 2024
@firebase firebase deleted a comment from google-oss-bot Jan 11, 2024
@firebase firebase deleted a comment from google-oss-bot Jan 11, 2024
@firebase firebase deleted a comment from google-oss-bot Jan 11, 2024
@firebase firebase deleted a comment from google-oss-bot Jan 11, 2024
@emilypgoogle emilypgoogle changed the base branch from functions-kotlin to master January 12, 2024 22:29
@emilypgoogle emilypgoogle changed the base branch from master to functions-kotlin January 12, 2024 22:30
Copy link
Member

@daymxn daymxn left a comment

Choose a reason for hiding this comment

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

So long as the smoke test is a flake, LGTM

@emilypgoogle emilypgoogle changed the base branch from functions-kotlin to main July 25, 2024 15:59
Copy link
Contributor

github-actions bot commented Jul 25, 2024

Release note changes

The following release notes were modified. Please ensure they look correct.

Release Notes
firebase-functions
### {{functions_client}} version 21.1.0 {: #functions-client_v21-1-0}

* {{changed}} Migrated to Kotlin

#### {{functions_client}} Kotlin extensions version 21.1.0 {: #functions-client-ktx_v21-1-0}

The Kotlin extensions library transitively includes the updated
`firebase-functions` library. The Kotlin extensions library has no additional
updates.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jul 25, 2024

Startup Time Report 1

Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS.

Notes

Startup Times

  • fire-fn

    DeviceStatisticsDistributions
    oriole-32
    Percentile456f4315a85986DiffSignificant (?)
    p1065.6 ±6 μs90.6 ±9 μs+25.0 μs (+38.0%)MAYBE
    p2569.1 ±6 μs96.8 ±12 μs+27.7 μs (+40.1%)MAYBE
    p5074.3 ±7 μs106 ±20 μs+31.7 μs (+42.7%)NO
    p7586.0 ±11 μs127 ±32 μs+40.7 μs (+47.3%)NO
    p90103 ±20 μs174 ±73 μs+71.0 μs (+68.7%)NO

    20 test runs in comparison
    CommitTest Runs
    456f431
    • 2024-08-28_17:19:53.175739_LYWf
    • 2024-08-28_17:19:53.175786_hkvx
    • 2024-08-28_17:19:53.175797_fwfr
    • 2024-08-28_17:19:53.175804_luSc
    • 2024-08-28_17:19:53.175813_caiM
    • 2024-08-28_17:19:53.175820_qgKR
    • 2024-08-28_17:19:53.175828_samf
    • 2024-08-28_17:19:53.175846_bcaY
    • 2024-08-28_17:19:53.175854_ZsFR
    • 2024-08-28_17:19:53.175862_wiak
    5a85986
    • 2024-08-30_21:06:41.399054_QuCJ
    • 2024-08-30_21:06:41.399101_jFFC
    • 2024-08-30_21:06:41.399114_biqn
    • 2024-08-30_21:06:41.399123_ASiL
    • 2024-08-30_21:06:41.399132_RtQz
    • 2024-08-30_21:06:41.399140_exnt
    • 2024-08-30_21:06:41.399148_hZiK
    • 2024-08-30_21:06:41.399162_QXQd
    • 2024-08-30_21:06:41.399170_uqWu
    • 2024-08-30_21:06:41.399178_OIFc
    redfin-30
    Percentile456f4315a85986DiffSignificant (?)
    p10133 ±15 μs169 ±20 μs+36.4 μs (+27.4%)NO
    p25140 ±16 μs177 ±21 μs+37.7 μs (+27.0%)NO
    p50150 ±19 μs188 ±24 μs+37.9 μs (+25.4%)NO
    p75165 ±23 μs202 ±27 μs+37.8 μs (+23.0%)NO
    p90190 ±35 μs228 ±32 μs+37.2 μs (+19.5%)NO

    20 test runs in comparison
    CommitTest Runs
    456f431
    • 2024-08-28_17:19:53.175739_LYWf
    • 2024-08-28_17:19:53.175786_hkvx
    • 2024-08-28_17:19:53.175797_fwfr
    • 2024-08-28_17:19:53.175804_luSc
    • 2024-08-28_17:19:53.175813_caiM
    • 2024-08-28_17:19:53.175820_qgKR
    • 2024-08-28_17:19:53.175828_samf
    • 2024-08-28_17:19:53.175846_bcaY
    • 2024-08-28_17:19:53.175854_ZsFR
    • 2024-08-28_17:19:53.175862_wiak
    5a85986
    • 2024-08-30_21:06:41.399054_QuCJ
    • 2024-08-30_21:06:41.399101_jFFC
    • 2024-08-30_21:06:41.399114_biqn
    • 2024-08-30_21:06:41.399123_ASiL
    • 2024-08-30_21:06:41.399132_RtQz
    • 2024-08-30_21:06:41.399140_exnt
    • 2024-08-30_21:06:41.399148_hZiK
    • 2024-08-30_21:06:41.399162_QXQd
    • 2024-08-30_21:06:41.399170_uqWu
    • 2024-08-30_21:06:41.399178_OIFc
  • timeToInitialDisplay

    DeviceStatisticsDistributions
    oriole-32
    Percentile456f4315a85986DiffSignificant (?)
    p10198 ±2 ms204 ±4 ms+5.20 ms (+2.6%)NO
    p25204 ±2 ms209 ±5 ms+4.59 ms (+2.3%)NO
    p50211 ±2 ms216 ±5 ms+5.15 ms (+2.4%)NO
    p75220 ±2 ms225 ±5 ms+5.04 ms (+2.3%)NO
    p90227 ±2 ms237 ±9 ms+9.84 ms (+4.3%)NO

    20 test runs in comparison
    CommitTest Runs
    456f431
    • 2024-08-28_17:19:53.175739_LYWf
    • 2024-08-28_17:19:53.175786_hkvx
    • 2024-08-28_17:19:53.175797_fwfr
    • 2024-08-28_17:19:53.175804_luSc
    • 2024-08-28_17:19:53.175813_caiM
    • 2024-08-28_17:19:53.175820_qgKR
    • 2024-08-28_17:19:53.175828_samf
    • 2024-08-28_17:19:53.175846_bcaY
    • 2024-08-28_17:19:53.175854_ZsFR
    • 2024-08-28_17:19:53.175862_wiak
    5a85986
    • 2024-08-30_21:06:41.399054_QuCJ
    • 2024-08-30_21:06:41.399101_jFFC
    • 2024-08-30_21:06:41.399114_biqn
    • 2024-08-30_21:06:41.399123_ASiL
    • 2024-08-30_21:06:41.399132_RtQz
    • 2024-08-30_21:06:41.399140_exnt
    • 2024-08-30_21:06:41.399148_hZiK
    • 2024-08-30_21:06:41.399162_QXQd
    • 2024-08-30_21:06:41.399170_uqWu
    • 2024-08-30_21:06:41.399178_OIFc
    redfin-30
    Percentile456f4315a85986DiffSignificant (?)
    p10244 ±6 ms262 ±5 ms+18.9 ms (+7.7%)MAYBE
    p25249 ±6 ms268 ±3 ms+19.4 ms (+7.8%)MAYBE
    p50257 ±8 ms275 ±3 ms+17.9 ms (+7.0%)NO
    p75266 ±11 ms285 ±4 ms+19.0 ms (+7.2%)NO
    p90277 ±17 ms300 ±6 ms+22.6 ms (+8.1%)NO

    20 test runs in comparison
    CommitTest Runs
    456f431
    • 2024-08-28_17:19:53.175739_LYWf
    • 2024-08-28_17:19:53.175786_hkvx
    • 2024-08-28_17:19:53.175797_fwfr
    • 2024-08-28_17:19:53.175804_luSc
    • 2024-08-28_17:19:53.175813_caiM
    • 2024-08-28_17:19:53.175820_qgKR
    • 2024-08-28_17:19:53.175828_samf
    • 2024-08-28_17:19:53.175846_bcaY
    • 2024-08-28_17:19:53.175854_ZsFR
    • 2024-08-28_17:19:53.175862_wiak
    5a85986
    • 2024-08-30_21:06:41.399054_QuCJ
    • 2024-08-30_21:06:41.399101_jFFC
    • 2024-08-30_21:06:41.399114_biqn
    • 2024-08-30_21:06:41.399123_ASiL
    • 2024-08-30_21:06:41.399132_RtQz
    • 2024-08-30_21:06:41.399140_exnt
    • 2024-08-30_21:06:41.399148_hZiK
    • 2024-08-30_21:06:41.399162_QXQd
    • 2024-08-30_21:06:41.399170_uqWu
    • 2024-08-30_21:06:41.399178_OIFc

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

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-functions:
error: Removed method com.google.firebase.functions.FirebaseFunctions.call(String,Object,com.google.firebase.functions.HttpsCallOptions) [RemovedMethod]
error: Removed method com.google.firebase.functions.FirebaseFunctions.call(java.net.URL,Object,com.google.firebase.functions.HttpsCallOptions) [RemovedMethod]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.getHttpsCallable [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.getHttpsCallable [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg2 in com.google.firebase.functions.FirebaseFunctions.getHttpsCallable [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.getHttpsCallableFromUrl [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.getHttpsCallableFromUrl [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg2 in com.google.firebase.functions.FirebaseFunctions.getHttpsCallableFromUrl [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.getInstance [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.getInstance [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.getInstance [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg2 in com.google.firebase.functions.FirebaseFunctions.getInstance [ParameterNameChange]
error: Removed method com.google.firebase.functions.FirebaseFunctions.getURL(String) [RemovedMethod]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.useEmulator [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg2 in com.google.firebase.functions.FirebaseFunctions.useEmulator [ParameterNameChange]
error: Attempted to remove parameter name from parameter arg1 in com.google.firebase.functions.FirebaseFunctions.useFunctionsEmulator [ParameterNameChange]
error: Removed field com.google.firebase.functions.FirebaseFunctions.Companion [RemovedField]
error: Removed class com.google.firebase.functions.FirebaseFunctions.Companion [RemovedClass]

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.

@emilypgoogle emilypgoogle merged commit adab25c into main Aug 30, 2024
33 checks passed
@emilypgoogle emilypgoogle deleted the ep/functions-kotlin branch August 30, 2024 21:43
@firebase firebase locked and limited conversation to collaborators Sep 30, 2024
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.

4 participants