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

ci: fix the 32 byte inaccuracy of SDK size reports #709

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

levibostian
Copy link
Contributor

@levibostian levibostian commented Apr 22, 2024

Part of: https://linear.app/customerio/issue/MBL-155/track-the-binary-size-of-our-ios-sdk-upon-every-release

As called out in the ticket, the SDK size report comparing main branch to open PRs is inaccurate by 32 bytes. This commit fixes this so if you open a PR and not modify any code in it, the diff should show 0 bytes difference.

Testing consideration:

  • The PR should see SDK size reports generated as before. QA sample app builds created and uploaded as before.
  • We cannot fully test this until we merge into main and the main branch creates a new cache.

Notes for reviewer:

  • I fixed this issue by setting up the CI to compile a version of the APN sample app that does not modify the Version.swift file. This compiled app is used to generate SDK size report. The CI continues to compile sample apps for QA testing and it should work as previously expected.
  • Because the generate-sdk-size-report action is now compiling sample apps, I created a new action, build-sample-app, to make building a sample app re-usable.
  • "fastlane ios build" command now takes optional arguments to configure it. QA sample apps will make builds differently then builds for generating SDK size reports.

commit-id:eddb8612

Copy link

github-actions bot commented Apr 22, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • CocoaPods-FCM: spr/main/eddb8612 (1713893234)
  • APN-UIKit: spr/main/eddb8612 (1713893309)

@levibostian levibostian marked this pull request as draft April 22, 2024 16:01
@levibostian levibostian changed the base branch from spr/main/9322d401 to spr/main/6c6d1d99 April 22, 2024 16:05
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.93%. Comparing base (4e01432) to head (9895079).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #709   +/-   ##
=======================================
  Coverage   56.93%   56.93%           
=======================================
  Files         139      139           
  Lines        3869     3869           
=======================================
  Hits         2203     2203           
  Misses       1666     1666           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@levibostian levibostian force-pushed the spr/main/eddb8612 branch 3 times, most recently from 8a7d447 to b16c575 Compare April 22, 2024 17:11
Copy link

  • CocoaPods-FCM: spr/main/eddb8612 (1713805933)

Copy link

  • APN-UIKit: spr/main/eddb8612 (1713805940)

@levibostian levibostian force-pushed the spr/main/eddb8612 branch 5 times, most recently from fd70fa1 to 7ee4a11 Compare April 22, 2024 18:47
Copy link

github-actions bot commented Apr 22, 2024

SDK binary size reports 📊

SDK binary size of this PR
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  17.2%   143Ki  17.2%   143Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/autogenerated/AutoMockable.generated.swift
   4.2%  35.0Ki   4.2%  35.0Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/autogenerated/AutoMockable.generated.swift
   4.2%  34.7Ki   4.2%  34.7Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Communication/EventBusHandler.swift
   2.7%  22.8Ki   2.7%  22.8Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Migration/autogenerated/AutoMockable.generated.swift
   2.7%  22.7Ki   2.7%  22.7Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/DataPipelineImplementation.swift
   2.6%  21.8Ki   2.6%  21.8Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/autogenerated/AutoMockable.generated.swift
   2.5%  20.9Ki   2.5%  20.9Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/QueueStorage.swift
   2.3%  19.0Ki   2.3%  19.0Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/autogenerated/AutoMockable.generated.swift
   2.3%  18.9Ki   2.3%  18.9Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushAPN/autogenerated/AutoMockable.generated.swift
   2.2%  18.6Ki   2.2%  18.6Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Communication/Event.swift
   2.1%  17.1Ki   2.1%  17.1Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/EngineWeb/AnyEncodable.swift
   2.1%  17.1Ki   2.1%  17.1Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/MessageManager.swift
   1.8%  15.2Ki   1.8%  15.2Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/Type/PushNotification.swift
   1.7%  14.6Ki   1.7%  14.6Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Communication/EventMemoryStorage.swift
   1.7%  13.8Ki   1.7%  13.8Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/autogenerated/AutoDependencyInjection.generated.swift
   1.6%  13.7Ki   1.6%  13.7Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Gist.swift
   1.6%  13.5Ki   1.6%  13.5Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Communication/EventStorage.swift
   1.6%  13.4Ki   1.6%  13.4Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/MessageQueueManager.swift
   1.5%  12.9Ki   1.5%  12.9Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/Request/TrackDeliveryEventRequestBody.swift
   1.4%  11.8Ki   1.4%  11.8Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/DataPipeline.swift
   1.2%  9.65Ki   1.2%  9.65Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/JsonAdapter.swift
   1.1%  9.50Ki   1.1%  9.50Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/CustomerIOInstance.swift
   1.0%  8.63Ki   1.0%  8.63Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Utilities/URLComponents.swift
   1.0%  8.55Ki   1.0%  8.55Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Plugins/AutoTrackingScreenViews.swift
   1.0%  8.47Ki   1.0%  8.47Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/UserNotificationsFramework/Wrappers.swift
   1.0%  8.22Ki   1.0%  8.22Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Migration/DataPipelineMigrationAssistant.swift
   0.9%  7.92Ki   0.9%  7.92Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/RichPush/RichPushHttpClient.swift
   0.9%  7.77Ki   0.9%  7.77Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Queue.swift
   0.9%  7.62Ki   0.9%  7.62Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/PushHandling/PushEventHandlerProxy.swift
   0.9%  7.11Ki   0.9%  7.11Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/EngineWeb/EngineWeb.swift
   0.8%  7.06Ki   0.8%  7.06Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Type/QueueTaskMetadata.swift
   0.8%  6.84Ki   0.8%  6.84Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/Store/PushHistory.swift
   0.8%  6.34Ki   0.8%  6.34Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/ModalViewManager.swift
   0.8%  6.32Ki   0.8%  6.32Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/MessagingInAppImplementation.swift
   0.7%  6.14Ki   0.7%  6.14Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/Log.swift
   0.7%  5.70Ki   0.7%  5.70Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Migration/TrackEventMigrationType.swift
   0.7%  5.64Ki   0.7%  5.64Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Type/QueueTask.swift
   0.6%  5.39Ki   0.6%  5.39Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/autogenerated/AutoDependencyInjection.generated.swift
   0.6%  5.16Ki   0.6%  5.16Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/Response/ErrorMessageResponse.swift
   0.6%  5.15Ki   0.6%  5.15Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/KeyValueStorage.swift
   0.6%  4.86Ki   0.6%  4.86Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/GistQueueNetwork.swift
   0.6%  4.71Ki   0.6%  4.71Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/Config/MessagingPushConfigBuilder.swift
   0.5%  4.49Ki   0.5%  4.49Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Plugins/DataPipelinePublishedEvents.swift
   0.5%  4.44Ki   0.5%  4.44Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/Request/MetricRequest.swift
   0.5%  4.43Ki   0.5%  4.43Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Communication/EventBus.swift
   0.5%  4.40Ki   0.5%  4.40Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Plugins/DeviceContexualAttributes.swift
   0.5%  4.22Ki   0.5%  4.22Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/FileStorage.swift
   0.5%  3.79Ki   0.5%  3.79Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/QueueManager.swift
   0.5%  3.79Ki   0.5%  3.79Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/EngineWeb/EngineWebConfiguration.swift
   0.4%  3.75Ki   0.4%  3.75Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Module/ModuleTopLevelObject.swift
   0.4%  3.70Ki   0.4%  3.70Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/HttpRequestRunner.swift
   0.4%  3.63Ki   0.4%  3.63Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Views/GistModalViewController.swift
   0.4%  3.55Ki   0.4%  3.55Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/MessagingPush.swift
   0.4%  3.45Ki   0.4%  3.45Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/Models/Message.swift
   0.4%  3.37Ki   0.4%  3.37Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/StringExtensions.swift
   0.4%  3.34Ki   0.4%  3.34Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Config/MessagingInAppConfigBuilder.swift
   0.4%  3.32Ki   0.4%  3.32Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/Atomic.swift
   0.4%  3.22Ki   0.4%  3.22Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/RichPush/MessagingPush+RichPush.swift
   0.4%  3.10Ki   0.4%  3.10Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/StringAnyEncodable.swift
   0.4%  3.06Ki   0.4%  3.06Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/DIManager.swift
   0.4%  3.02Ki   0.4%  3.02Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/EngineWeb/EngineEventHandler.swift
   0.4%  2.98Ki   0.4%  2.98Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Plugins/Context.swift
   0.4%  2.98Ki   0.4%  2.98Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/BaseNetwork.swift
   0.3%  2.89Ki   0.3%  2.89Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/DeviceInfo.swift
   0.3%  2.88Ki   0.3%  2.88Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Task Data/DeletePushNotificationQueueTaskData.swift
   0.3%  2.84Ki   0.3%  2.84Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Task Data/IdentifyProfileQueueTaskData.swift
   0.3%  2.84Ki   0.3%  2.84Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Task Data/TrackEventQueueTaskData.swift
   0.3%  2.65Ki   0.3%  2.65Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/HttpRequestParams.swift
   0.3%  2.64Ki   0.3%  2.64Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/PushHandling/ManualPushHandling+UserNotifications.swift
   0.3%  2.61Ki   0.3%  2.61Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/PushHandling/iOSPushEventListener.swift
   0.3%  2.58Ki   0.3%  2.58Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Task Data/RegisterPushNotificationQueueTaskData.swift
   0.3%  2.55Ki   0.3%  2.55Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/HttpRequestError.swift
   0.3%  2.52Ki   0.3%  2.52Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Util/DeviceAttributesProvider.swift
   0.3%  2.34Ki   0.3%  2.34Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/RichPush/RichPushRequestHandler.swift
   0.3%  2.30Ki   0.3%  2.30Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushAPN/MessagingPushAPN.swift
   0.3%  2.29Ki   0.3%  2.29Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Config/SDKConfigBuilder.swift
   0.3%  2.25Ki   0.3%  2.25Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/MessagingPushImplementation.swift
   0.3%  2.23Ki   0.3%  2.23Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/UserNotificationsFramework/UserNotificationsFrameworkAdapter.swift
   0.3%  2.20Ki   0.3%  2.20Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/MessagingPushFCM.swift
   0.3%  2.09Ki   0.3%  2.09Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Type/QueueTaskRunResults.swift
   0.2%  1.95Ki   0.2%  1.95Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/LockManager.swift
   0.2%  1.80Ki   0.2%  1.80Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushAPN/MessagingPush+APN.swift
   0.2%  1.77Ki   0.2%  1.77Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/RichPush/RichPushDeliveryTracker.swift
   0.2%  1.71Ki   0.2%  1.71Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/autogenerated/AutoDependencyInjection.generated.swift
   0.2%  1.65Ki   0.2%  1.65Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/MessagingPush+FCM.swift
   0.2%  1.62Ki   0.2%  1.62Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/DateExtensions.swift
   0.2%  1.59Ki   0.2%  1.59Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/Models/UserQueueResponse.swift
   0.2%  1.57Ki   0.2%  1.57Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Views/GistView.swift
   0.2%  1.49Ki   0.2%  1.49Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/Request/PushMetric.swift
   0.2%  1.46Ki   0.2%  1.46Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/MessagingInApp.swift
   0.2%  1.42Ki   0.2%  1.42Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/CIOApiEndpoint.swift
   0.2%  1.42Ki   0.2%  1.42Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/autogenerated/AutoMockable.generated.swift
   0.2%  1.39Ki   0.2%  1.39Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Provider/InAppProvider.swift
   0.2%  1.37Ki   0.2%  1.37Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/PushHandling/PushClickHandler.swift
   0.2%  1.34Ki   0.2%  1.34Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Store/SdkConfig.swift
   0.2%  1.34Ki   0.2%  1.34Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/RichPush/RichPushRequest.swift
   0.2%  1.32Ki   0.2%  1.32Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/Request/InAppMetric.swift
   0.2%  1.30Ki   0.2%  1.30Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/Mocks.swift
   0.1%  1.24Ki   0.1%  1.24Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/UIKitWrapper.swift
   0.1%  1.24Ki   0.1%  1.24Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/ThreadUtil.swift
   0.1%  1.22Ki   0.1%  1.22Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/DictionaryExtension.swift
   0.1%  1.21Ki   0.1%  1.21Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Store/GlobalDataStore.swift
   0.1%  1.18Ki   0.1%  1.18Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/KeyValueStorageKey.swift
   0.1%  1.14Ki   0.1%  1.14Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Config/DataPipelineConfigOptions.swift
   0.1%  1.12Ki   0.1%  1.12Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/DeviceExtension.swift
   0.1%  1.12Ki   0.1%  1.12Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Type/Region.swift
   0.1%  1.04Ki   0.1%  1.04Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/MessagingPushFCM+PushConfigs.swift
   0.1%  1.02Ki   0.1%  1.02Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/DIGraphShared.swift
   0.1%    1024   0.1%    1024    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/AnyEncodable.swift
   0.1%     936   0.1%     936    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/UserAgentUtil.swift
   0.1%     936   0.1%     936    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushAPN/MessagingPushAPN+PushConfigs.swift
   0.1%     908   0.1%     908    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/Utilities/HTTPMethod.swift
   0.1%     880   0.1%     880    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Type/QueueTaskType.swift
   0.1%     872   0.1%     872    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/Request/EmptyRequestBody.swift
   0.1%     844   0.1%     844    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/EngineWeb/EngineRoute.swift
   0.1%     832   0.1%     832    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/CustomerIO+Events.swift
   0.1%     832   0.1%     832    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/Util/DeepLinkUtil.swift
   0.1%     820   0.1%     820    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/ArrayExtensions.swift
   0.1%     792   0.1%     792    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/Endpoints/Utilities/GistNetworkRequest.swift
   0.1%     772   0.1%     772    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Plugins/Logger.swift
   0.1%     764   0.1%     764    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Type/InAppMessage.swift
   0.1%     752   0.1%     752    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Utilities/Environment.swift
   0.1%     748   0.1%     748    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/LogManager.swift
   0.1%     652   0.1%     652    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/Type/CustomerIOParsedPushPayload.swift
   0.1%     624   0.1%     624    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/Utilities/ElapsedTimer.swift
   0.1%     612   0.1%     612    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/CustomerIO.swift
   0.1%     600   0.1%     600    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Service/DownloadFileType.swift
   0.1%     576   0.1%     576    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/UIKitExtensions.swift
   0.1%     572   0.1%     572    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/Config/MessagingPushConfigOptions.swift
   0.1%     568   0.1%     568    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/Endpoints/QueueEndpoint.swift
   0.1%     508   0.1%     508    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/Endpoints/Utilities/GistNetworkRequestError.swift
   0.1%     504   0.1%     504    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Store/ProfileStore.swift
   0.1%     496   0.1%     496    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Background Queue/Type/QueueStatus.swift
   0.1%     484   0.1%     484    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/CustomerIO+Segment.swift
   0.1%     484   0.1%     484    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/RouteManager.swift
   0.1%     480   0.1%     480    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/RingBuffer.swift
   0.1%     480   0.1%     480    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Utilities/Encodable.swift
   0.1%     468   0.1%     468    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/Endpoints/LogEndpoint.swift
   0.0%     380   0.0%     380    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Config/MessagingInAppConfigOptions.swift
   0.0%     332   0.0%     332    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Extensions/GistExtensions.swift
   0.0%     248   0.0%     248    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Utilities/Logger.swift
   0.0%     236   0.0%     236    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/Util/NotificationCenterWrapper.swift
   0.0%     228   0.0%     228    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Network/NetworkSettings.swift
   0.0%     204   0.0%     204    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/Lock.swift
   0.0%     196   0.0%     196    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/DeviceMetricsGrabber.swift
   0.0%     192   0.0%     192    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPush/PushHandling/AutomaticPushClickHandling.swift
   0.0%     164   0.0%     164    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Store/QueueInventoryMemoryStore.swift
   0.0%     128   0.0%     128    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/Timer.swift
   0.0%     120   0.0%     120    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/DataExtensions.swift
   0.0%     116   0.0%     116    /Users/runner/work/customerio-ios/customerio-ios/Sources/DataPipeline/Plugins/CustomerIODestination.swift
   0.0%      76   0.0%      76    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingInApp/Gist/Managers/UserManager.swift
   0.0%      68   0.0%      68    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/SingleScheduleTimer.swift
   0.0%      64   0.0%      64    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/DateUtil.swift
   0.0%      52   0.0%      52    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Version.swift
   0.0%      36   0.0%      36    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/Time.swift
   0.0%      20   0.0%      20    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Deprecated/CustomerIO+Tracking.swift
   0.0%       8   0.0%       8    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Extensions/ErrorExtension.swift
 100.0%   834Ki 100.0%   834Ki    TOTAL
Filtering enabled (source_filter); omitted file = 2.51Mi, vm = 2.58Mi of entries

SDK binary size diff report between this PR and the main branch
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [NEW] +19.0Ki  [NEW] +19.0Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/autogenerated/AutoMockable.generated.swift
  [NEW] +2.20Ki  [NEW] +2.20Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/MessagingPushFCM.swift
  [NEW] +1.65Ki  [NEW] +1.65Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/MessagingPush+FCM.swift
  [NEW] +1.04Ki  [NEW] +1.04Ki    /Users/runner/work/customerio-ios/customerio-ios/Sources/MessagingPushFCM/MessagingPushFCM+PushConfigs.swift
  -0.1%     -12  -0.1%     -12    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/CustomerIOInstance.swift
 -18.8%     -12 -18.8%     -12    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Version.swift
  -0.8%     -24  -0.8%     -24    /Users/runner/work/customerio-ios/customerio-ios/Sources/Common/Util/DeviceInfo.swift
  -1.1%     -92  -1.1%     -92    /Users/runner/work/customerio-ios/customerio-ios/Sources/Migration/DataPipelineMigrationAssistant.swift
  +2.9% +23.7Ki  +2.9% +23.7Ki    TOTAL
Filtering enabled (source_filter); omitted file = 2.51Mi, vm = 2.58Mi of entries

@levibostian levibostian requested a review from a team April 22, 2024 19:12
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the logic in the steps came from workflows/build-sample-apps.yml. Moved logic into this action so it can be re-used in generate-sdk-size-report.

@levibostian levibostian marked this pull request as ready for review April 22, 2024 19:17

inputs:
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 action used to take in an already built sample app. Now it builds it's own. So the inputs needed to change.

GH actions cannot reference secrets. So the only input in this action is a required secret that fastlane uses for code signing the compiled sample app.

Comment on lines +34 to +46
- name: Make a build of the sample app to generate report for
uses: ./.github/actions/build-sample-app
id: build-sample-app
with:
apn-or-fcm: 'APN'
sample-app: 'APN-UIKit'
# Pass in a hard-coded version and build number to ensure that all sample app builds that are compiled for SDK size reports are consistent.
# When we compare size reports between different builds, we want to ensure that the only difference is the SDK code that was modified in a PR.
fastlane-build-args: '{"app_version": "1.0.0", "build_number": "1"}'
# workspace credentials do not matter since we are not using this app build.
customerio-workspace-siteid: "12345"
customerio-workspace-cdp-api-key: "12345"
GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64: ${{ inputs.GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64 }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just like in workflows/build-sample-app, build the APN sample app here. But, pass in a hard-coded app version and build number which is what fixes the 32 byte inaccuracy problem.

@@ -164,8 +98,21 @@ jobs:
* ${{ matrix.sample-app }}: Build failed. See [CI job logs](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) to determine the issue and try re-building.
edit-mode: append # append new line to the existing PR comment to build a list of all sample app builds.

generate-sdk-size-reports:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved SDK size report generation out of the build-sample-apps job and into it's own job. This is for CI performance so SDK reports can be made in parallel to building sample apps.


- name: Install CLI tools used in CI script
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A lot of this code got moved into the re-usable build-sample-app action. Making this workflow shorter 🎊

Base automatically changed from spr/main/6c6d1d99 to main April 23, 2024 17:23
Part of: https://linear.app/customerio/issue/MBL-155/track-the-binary-size-of-our-ios-sdk-upon-every-release

As called out in the ticket, the SDK size report comparing main branch to open PRs is inaccurate by 32 bytes. This commit fixes this so if you open a PR and not modify any code in it, the diff should show 0 bytes difference.

Testing consideration:
* The PR should see SDK size reports generated as before. QA sample app builds created and uploaded as before.
* We cannot fully test this until we merge into main and the main branch creates a new cache.

Notes for reviewer:
* I fixed this issue by setting up the CI to compile a version of the APN sample app that does not modify the Version.swift file. This compiled app is used to generate SDK size report. The CI continues to compile sample apps for QA testing and it should work as previously expected.
* Because the generate-sdk-size-report action is now compiling sample apps, I created a new action, build-sample-app, to make building a sample app re-usable.
* "fastlane ios build" command now takes optional arguments to configure it. QA sample apps will make builds differently then builds for generating SDK size reports.

commit-id:eddb8612
@levibostian levibostian merged commit 27d48f4 into main Apr 24, 2024
11 checks passed
@levibostian levibostian deleted the spr/main/eddb8612 branch April 24, 2024 13:43
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