-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
Jenkins Version 2.176.3
App Center Plug-In Version: 0.6.2
-
-
0.8.1
Since App Center has seemingly changed the Distribution Group and permissions model (not for the best and much different than HockeyApp - see issue raised here with App Center team: https://github.com/microsoft/appcenter/issues/1272), it is pretty hard to manage the App to Distribution Group relationships within App Center (especially after migration from Hockey App)
We have noticed that the Jenkins builds are failing when the App Center plugin is configured with Distribution Groups that are not available/accessible for a specific application (within the App Center permission model).
So, for example:
If the "Product" group does have access to that specific app in that specific Organization, the jenkins job will build fine and return a success. However, when you add "Tech-Leads" which does not have access (again, for example), the Jenkins build will report as failed.
Except, the job won't actually fail - it will just fail to distribute that build/release to that specific distribution group - we get an error like this in the console output:
Creating an upload resource. Create upload resource successful. Uploading app to resource. Upload app to resource successful. Committing resource. Committing resource successful. Distributing resource. io.jenkins.plugins.appcenter.AppCenterException: Distributing resource unsuccessful: at io.jenkins.plugins.appcenter.task.internal.DistributeResourceTask.lambda$execute$1(DistributeResourceTask.java:59) at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760) at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) at retrofit2.CompletableFutureCallAdapterFactory$BodyCallAdapter$2.onResponse(CompletableFutureCallAdapterFactory.java:81) at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: retrofit2.HttpException: HTTP 400 Bad Request ... 7 more io.jenkins.plugins.appcenter.AppCenterException: Upload to AppCenter failed. at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:56) at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:17) at hudson.remoting.UserRequest.perform(UserRequest.java:212) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:369) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to Android Slave at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357) at hudson.remoting.Channel.call(Channel.java:957) at hudson.FilePath.act(FilePath.java:1160) at io.jenkins.plugins.appcenter.AppCenterRecorder.uploadToAppCenter(AppCenterRecorder.java:131) at io.jenkins.plugins.appcenter.AppCenterRecorder.perform(AppCenterRecorder.java:118) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1843) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Caused by: java.util.concurrent.ExecutionException: io.jenkins.plugins.appcenter.AppCenterException: Distributing resource unsuccessful: at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895) at io.jenkins.plugins.appcenter.task.UploadTask.call(UploadTask.java:54) ... 9 more Caused by: io.jenkins.plugins.appcenter.AppCenterException: Distributing resource unsuccessful: at io.jenkins.plugins.appcenter.task.internal.DistributeResourceTask.lambda$execute$1(DistributeResourceTask.java:59) at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:760) at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:736) at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474) at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977) at retrofit2.CompletableFutureCallAdapterFactory$BodyCallAdapter$2.onResponse(CompletableFutureCallAdapterFactory.java:81) at retrofit2.OkHttpCall$1.onResponse(OkHttpCall.java:129) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:174) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) ... 3 more Caused by: retrofit2.HttpException: HTTP 400 Bad Request ... 7 more
It would be a lot better if the console output mentioned which specific Distribution Groups weren't allowed (and potentially stills succeed)
We see the APK (in this case) is still uploaded to App Center and distributed to the Distribution Groups that have the correct access in App Center.
I honestly think they need to have feature parity with HockeyApp and remove the need to specify which Distribution Group is needed for each specific version/release - this seems un-necessary and creates overhead for teams to manage the distribution groups in both the Jenkins Plug-in and App Center
Please let me know if any of the above was unclear or if you have any questions. Thank you
- depends on
-
JENKINS-60232 Add AppCenter API models for error responses for used APIs
- Resolved