Skip to content

Commit

Permalink
Fix app bundle size diff not always being compared against latest com…
Browse files Browse the repository at this point in the history
…mit (#28368)

Summary:
- Timestamp of entries in our Firebase instance sometimes get stored as number. This means that we may not always be diffing against the latest master commit.
- Size report of Android and iOS gets overwritten depending on which build finishes first.

## Changelog

[Internal] [Fixed] - App bundle size diff not always being compared against latest commit
[Internal] [Fixed] - Android and iOS app bundle size diff overwrite each other
Pull Request resolved: #28368

Test Plan:
- We are now using Firebase's own [firebase.firestore.Timestamp.now](https://firebase.google.com/docs/reference/js/firebase.firestore.Timestamp#now) to ensure that we always get a timestamp in the preferred format. This has been tested locally but can only be verified when merged to master and we start getting new data. In the meantime, I'll manually fix up all the entries in the store.
- There should be one app bundle size comment for Android and one for iOS in this PR.

Reviewed By: cpojer

Differential Revision: D20601620

Pulled By: hramos

fbshipit-source-id: 0c3e4b78a74cbd659f1957a6aa74322b016e0646
  • Loading branch information
tido64 authored and facebook-github-bot committed Mar 24, 2020
1 parent 14b423e commit d241de9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bots/datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function getBinarySizesCollection(firestore) {
function createOrUpdateDocument(collection, sha, data) {
const stampedData = {
...data,
timestamp: Date.now(),
timestamp: firebase.firestore.Timestamp.now(),
};
const docRef = collection.doc(sha);
return docRef.update(stampedData).catch(async error => {
Expand Down
4 changes: 2 additions & 2 deletions bots/report-bundle-size.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function report(target) {
'android-jsc-x86': android_getApkSize('jsc', 'x86'),
'android-jsc-x86_64': android_getApkSize('jsc', 'x86_64'),
},
'| android | hermes | arm',
'\\| android \\| hermes \\| arm',
);
break;

Expand All @@ -174,7 +174,7 @@ function report(target) {
'RNTester/build/Build/Products/Release-iphonesimulator/RNTester.app/RNTester',
),
},
'| ios | - | universal |',
'\\| ios \\| - \\| universal \\|',
);
break;

Expand Down

0 comments on commit d241de9

Please sign in to comment.