ASAPP - iOS

© 2023 ASAPP Inc, all rights reserved.

Organization

.
├── SDK             Chat SDK
├── fastlane        fastlane configuration files
├── package         Directory containing docs, the built framework, and example projects that is delivered to partners
├── scripts         Utility scripts

Running the test app locally

Pre-requisites

Program Version
Xcode 14.3.1

Steps

  1. Open SDK/ASAPP.xcworkspace
  2. Select ASAPPTest from the schemes dropdown menu (near the stop button in the upper-left hand corner)
  3. Select the device or simulator you’d like to to test on using the dropdown menu next to the scheme you just selected. We run snapshot tests on the latest iPhone SE to ensure we handle small screens properly.
  4. Press the play button to build and run the application

Development, QA, and release process

We develop, test, and build using Xcode 14.3.1

Loosely following GitFlow, develop is the default branch. We merge develop into staging to prepare a release candidate. Once a release candidate has been approved, staging will be merged into master.

staging is built automatically by CircleCI using fastlane and distributed using Firebase. The build number is automatically incremented. The version string is updated based on the pull request title.

  1. Make a pull request from develop to staging. We follow SemVer to define our versions. To increment the patch, minor, or major versions, include “patch”, “minor”, or “major”, respectively, in the pull request title. If none of these keywords are present in the title, the version will not be incremented. Do not squash when merging.
  2. On every commit to staging, our CircleCI workflow will check and update the version string, run tests, check that the public API is fully documented, and hold the release candidate for approval. Notifications will be sent to #chat-sdk-ios-builds in Slack.
  3. Unpause the rc-approval job to distribute a release candidate via Firebase.
  4. Wait for QA approval. If changes need to be made, push changes or merge a pull request into staging again.
  5. Update the changelog by following the conventional format and using the command below to generate a list of changes. Verify the list by comparing against https://github.com/asappinc/chat-sdk-ios/compare/X.Y.Z…staging.
    bash git log X.Y.Z..staging --pretty=oneline | perl -ne '{ while ($_ =~ /(\w+)[-](\d+)(.*)/g) { print "[$1-$2$3 \n"; } }' | sort | uniq
  6. Unpause the release-approval CircleCI job to archive the framework, tag the commit, create a GitHub release, and merge to master. If there are conflicts, the channel will be notified.
  7. Prepare the release announcement message according to convention (search for “iOS SDK” in #annc-release).
  8. Wait for https://github.com/asappinc/chat-sdk-ios-demo/commits/master to be automatically updated or, if there were breaking changes, update it manually.
  9. Download ASAPP.iOS.Framework.X.Y.Z.zip from either the CircleCI job or the GitHub release and double-check that the folder structure is correct and that the example projects work.
  10. Upload the archive to Google Drive.
  11. Post the release announcement message in #annc-release and alert the relevant deployment managers.

Generating API reference pages from documentation comments

Pre-requisites

Program Version
ruby 2.7.6
bundler 2.1.4
jazzy 0.9.3

Running jazzy

You may need to run bundle update as above.

scripts/generate_docs.sh

The reference website can be found at package/docs/swift/index.html.

Running tests

Pre-requisites

  1. brew install carthage
  2. cd SDK && carthage bootstrap --use-xcframeworks --platform iOS

Steps

  1. Select either All Tests or Fast Tests
  2. Select the latest iPhone SE as target device
  3. Run tests

Sending data to SonarQube

Note that because we run our macOS jobs on circleci.com, we cannot access SonarQube from CircleCI. Therefore, we must run sonar-scanner locally while connected to the VPN.

Pre-requisites

    See

    See the pre-requisites for “Running tests” above
    • Install sonar-scanner at the root of this project in a directory named sonarsource such that the path to sonar-scanner is sonarsource/bin/sonar-scanner
    • Connect to the VPN
    • Log in to https://sonarqube.asapp.dev via Okta

Steps

  1. Select the “All Tests” scheme
  2. Select the latest iPhone SE as the target device
  3. Run tests
  4. A few minutes after the tests have completed, linting and test coverage data will have been sent to SonarQube.

Running the Objective-C example project

  1. Open Xcode 14.3.1
  2. Archive the Aggregate scheme for a Generic iOS Device. The framework will be updated automatically.
  3. Open and run the example Objective-C project at /package/Objective-C Example/ASAPPChatDemoObjc.xcodeproj