Skip to content

Skip redundant SHA-256 hashing and GCS existence check in getOrUploadApk - #102

Merged
liutikas merged 1 commit into
mainfrom
skipapkhash
Nov 17, 2026
Merged

liutikas merged 1 commit into
mainfrom
skipapkhash

Conversation

@liutikas

Copy link
Copy Markdown
Member

Previously, when getOrUploadApk missed GCS, calling apkStore.uploadApk(name, bytes) re-computed SHA-256 over the full APK byte array (even though sha256 was already known from TestRunConfig) and queried googleCloudApi.existingFilePath() a second time before uploading.

  • Add ApkStore.getOrUploadApk(name, sha256, bytes) that checks GCS existence once using the provided sha256 and uploads directly via putApk on a miss.
  • Route TestRunnerServiceImpl.getOrUploadApk and TestScheduler.PendingApk through ApkStore.getOrUploadApk.
  • Track existingFilePath queries in FakeGoogleCloudApi and add unit tests in ApkStoreTest and TestRunnerServiceImplTest.

Test: ./gradlew :lib:ktlintCheck :lib:test

Previously, when getOrUploadApk missed GCS, calling apkStore.uploadApk(name, bytes) re-computed SHA-256 over the full APK byte array (even though sha256 was already known from TestRunConfig) and queried googleCloudApi.existingFilePath() a second time before uploading.

- Add ApkStore.getOrUploadApk(name, sha256, bytes) that checks GCS existence once using the provided sha256 and uploads directly via putApk on a miss.
- Route TestRunnerServiceImpl.getOrUploadApk and TestScheduler.PendingApk through ApkStore.getOrUploadApk.
- Track existingFilePath queries in FakeGoogleCloudApi and add unit tests in ApkStoreTest and TestRunnerServiceImplTest.

Test: ./gradlew :lib:ktlintCheck :lib:test
@liutikas
liutikas requested a review from rnakade November 17, 2026 21:22
@liutikas
liutikas merged commit a7d669d into main Nov 17, 2026
9 of 10 checks passed
@liutikas
liutikas deleted the skipapkhash branch November 17, 2026 22:50
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.

2 participants