commitStatusPublisher with azure devops pull request

Answered

Hi,

we use the commit status publisher to sent status to azure devops pull request.
If the Flag "Reset status whenever there are new changes" in Azure Devops not set, it works, like a charm.
If the Flag is set, then there will be no status update in the pull request.

In the server.log there is this entry:
HttpBasedCommitStatusPublisher - Commit Status Publisher HTTP request has failed. Publisher: tfs(https://dev.azure.com/xxx/yyy/_apis/git/repositories/zzz/pullRequests/1239/statuses?api-version=3.0-preview).. Build: #5.3.1.4405 {build id=2432999, buildTypeId=aaa}: jetbrains.buildServer.commitPublisher.HttpPublisherException: Pull request status rejected by status policy. Policy configuration requires status to be posted on iteration, response code: 403, reason: Forbidden
jetbrains.buildServer.commitPublisher.HttpPublisherException: Pull request status rejected by status policy. Policy configuration requires status to be posted on iteration, response code: 403, reason: Forbidden
at jetbrains.buildServer.commitPublisher.tfs.TfsStatusPublisher.processErrorResponse(TfsStatusPublisher.java:306)
at jetbrains.buildServer.commitPublisher.tfs.TfsStatusPublisher.processResponse(TfsStatusPublisher.java:101)
at jetbrains.buildServer.commitPublisher.HttpHelper.call(HttpHelper.java:91)
at jetbrains.buildServer.commitPublisher.HttpHelper.post(HttpHelper.java:100)
at jetbrains.buildServer.commitPublisher.HttpBasedCommitStatusPublisher.lambda$post$0(HttpBasedCommitStatusPublisher.java:40)
at jetbrains.buildServer.serverSide.impl.BaseAccessChecker.runWithDisabledCheck(BaseAccessChecker.java:2)
at jetbrains.buildServer.serverSide.impl.SecondaryNodeSecurityManager.runSafeNetworkOperation(SecondaryNodeSecurityManager.java:21)
at jetbrains.buildServer.commitPublisher.HttpBasedCommitStatusPublisher.post(HttpBasedCommitStatusPublisher.java:39)
at jetbrains.buildServer.commitPublisher.tfs.TfsStatusPublisher.updateBuildStatus(TfsStatusPublisher.java:368)
at jetbrains.buildServer.commitPublisher.tfs.TfsStatusPublisher.buildFinished(TfsStatusPublisher.java:82)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$2.run(CommitStatusPublisherListener.java:72)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$PublisherTaskConsumer.runTask(CommitStatusPublisherListener.java:478)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$BuildPublisherTaskConsumer.runForEveryPublisher(CommitStatusPublisherListener.java:383)
at jetbrains.buildServer.commitPublisher.CommitStatusPublisherListener$BuildPublisherTaskConsumer.lambda$accept$0(CommitStatusPublisherListener.java:342)
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640)
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)

The auth token that i use in the commit status publisher has full access.

Is there a Bug in the plugin or did i miss something in the configuration?

 

regards

2 comments
Comment actions Permalink
Official comment

Hi,

Thank you for reporting this, we will try to reproduce it on our side.

Meanwhile do you mind to turn on debug logging for teamcity-server log, try to publish the status and check if you get messages like "No iterations are available in repository" in the log?

Thanks!

Comment actions Permalink

Hi,

 

thanks for reply.

This message i get in Teamcity, if i turn this on

I can't find any message like "No iterations" in the log. 

The only message with iteration in the log is

[2020-02-19 09:42:14,644] DEBUG - HttpBasedCommitStatusPublisher - Commit Status Publisher HTTP request has failed. Publisher: tfs(https://dev.azure.com/xxx/xxx/_apis/git/repositories/xxx/pullRequests/1790/statuses?api-version=3.0-preview).. Build: #0.0.0.6144 {build id=2672192, buildTypeId=Tls_Topic_DefineVersion}

 

Without the reset option on, the status will be published.

0

Please sign in to leave a comment.