RFR: 2451: Skara bot fails to transition bug to Resolved due to empty response from api

Zhao Song zsong at openjdk.org
Mon Mar 3 17:59:11 UTC 2025


On Mon, 3 Mar 2025 17:50:10 GMT, Zhao Song <zsong at openjdk.org> wrote:

> A user reported that one backport issue was not automatically resolved by the Skara bot. From the logs, Erik found that the bot didn't actually send the request to transition the bug to resolved and he noticed that around that time, the bot was renewing the access token for jbs.
> 
> When updating the state of an issue, the Skara bot first attempts to fetch the available transitions for that issue by calling this API:
> https://bugs.openjdk.org/rest/api/2/issue/issue_id/transitions.
> 
> I called the API without authentication, I was expecting a 401 Unauthorized response. However, I received an empty response:
> `{"expand":"transitions","transitions":[]}.`
> 
> Due to this empty response, the Skara bot did not attempt to transition the bug to any state.
> 
> In my opinion, availableTransitions would be empty only when requesting the API without authentication,  so skara bot would throw an exception in this case.

issuetracker/src/main/java/org/openjdk/skara/issuetracker/jira/JiraIssue.java line 268:

> 266:                 } else {
> 267:                     // The issue is most likely closed - skip transitioning
> 268:                     log.warning("Can't transition the issue to Resolved or Open");

@erikj79 You suggested that 

> The else clause should at the very least log something so we know that is what happened. we should also verify that the state is either closed or resolved and throw RuntimeException if not. 

I thought about it, then I realized that the Skara bot should have already verified the state before calling Issue.setState(Issue.State.RESOLVED) like [this](https://github.com/openjdk/skara/blob/b8a99e211aae1cec3ae5b6477e9c0c91c0761284/bots/notify/src/main/java/org/openjdk/skara/bots/notify/issue/IssueNotifier.java#L211).

Also, it's will be a little hard to verify the Issue state since we need to change the interface of Issue.setState.

-------------

PR Review Comment: https://git.openjdk.org/skara/pull/1706#discussion_r1977941676


More information about the skara-dev mailing list