Skip to content

Commit

Permalink
Fix commit of Google Play track edit being omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
slmlt committed Apr 16, 2024
1 parent 5bab5f3 commit c7412e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal interface TrackManager {

data class BaseConfig(
val releaseStatus: ReleaseStatus? = null,
val userFraction: Double?,
val userFraction: Double? = null,
val updatePriority: Int?,
val releaseNotes: Map<String, String?>? = emptyMap(),
val retainableArtifacts: List<Long>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract class PlayUploadWork : WorkAction<PlayUploadParameters> {
publisher = createPublisher(parameters.apiToken.asFile.get().inputStream()),
appId = parameters.appId.get(),
)
logger.info("Step 1/3: Requesting track edit...")
logger.info("Step 1/4: Requesting track edit...")
val editId =
when (val result = publisher.insertEdit()) {
is EditResponse.Success -> result.id
Expand All @@ -59,7 +59,7 @@ abstract class PlayUploadWork : WorkAction<PlayUploadParameters> {
val trackManager = DefaultTrackManager(publisher, editId)
val editManager = DefaultEditManager(publisher, trackManager, editId)

logger.info("Step 2/3: Upload bundle for $editId")
logger.info("Step 2/4: Upload bundle for $editId")

val versionCode = editManager.uploadBundle(file, ResolutionStrategy.IGNORE)

Expand All @@ -68,7 +68,7 @@ abstract class PlayUploadWork : WorkAction<PlayUploadParameters> {
return
}

logger.info("Step 3/3: Pushing $releaseName to $track at P=$priority V=$versionCode")
logger.info("Step 3/4: Pushing $releaseName to $track at P=$priority V=$versionCode")

trackManager.update(
config =
Expand All @@ -77,12 +77,16 @@ abstract class PlayUploadWork : WorkAction<PlayUploadParameters> {
versionCodes = listOf(versionCode),
didPreviousBuildSkipCommit = false,
TrackManager.BaseConfig(
userFraction = parameters.versionCode.orNull ?: 0.1,
updatePriority = priority,
releaseName = parameters.releaseName.get(),
),
),
)
logger.info("Step 3/3: Bundle upload successful")

logger.info("Step 3/4: Commit $editId")

publisher.commitEdit(editId)

logger.info("Step 3/4: Bundle upload successful")
}
}

0 comments on commit c7412e0

Please sign in to comment.