Closed japawl closed 3 years ago
Thanks for the idea, but I don't think I'll ever want to add specialized tasks like that. There's simply no way it'll meet a broad audience's needs. I also don't want to add tasks that simply put an API request's JSON somewhere, because at that point I feel like you may as well just use the androidpublisher client directly.
If that task meets your needs, then I don't see the harm in continuing to use it. Obviously there are no backwards compat guarantees, but I also don't see those APIs changing anytime soon. BTW, you can clean the task up a little bit:
import com.github.triplet.gradle.androidpublisher.EditResponse
import com.github.triplet.gradle.androidpublisher.PlayPublisher
import com.google.api.services.androidpublisher.model.Track
// ...
doLast {
val publisher = apiService.withGroovyBuilder { "getPublisher"() } as PlayPublisher
val editId = when (val result = publisher.insertEdit()) {
is EditResponse.Success -> result.id
is EditResponse.Failure -> TODO()
}
val track = publisher.withGroovyBuilder { "getTrack"(editId, trackName) } as Track
output.writeText(track.toPrettyString())
}
Problem description
On our automated release train, we are using multiple tracks for different type of builds (alpha, preRelease, hotfix and so on). We had an incident that due to track name mixup, wrong artifact got promoted to production.
Potential solutions/workarounds
To prevent any kind similar issues when wrong artifact is promoted to production, a task can be created that checks specific track against given
versionCode
andversionName
. This would also ensure that only artifacts built with fully automated release trains are permitted to be promoted, as any manually uploaded artifact (not following theversionCode
andversionName
values, which are controlled by the automation scripts) would fail the check task.Additional context
Google Play Developer API has a getter method for specific task available. We currently have in-house custom gradle tasks that fetches the track info (the checking part we have separated in a different Task, which is just parsing Json file and checking its values):
This is not the perfect way to consume the apiService and I see value to ship this functionality along with the plugin.