History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-3675
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Priority: Major Major
Assignee: Robin Shen
Reporter: Steve Mik
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

REST API returns inconsistent results

Created: 02/Mar/21 04:47 PM   Updated: 04/Mar/21 11:14 PM
Component/s: None
Affects Version/s: 10.0.23
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

 All   Comments   Work Log   Change History      Sort Order:
Steve Mik [02/Mar/21 04:54 PM]
Well, I pressed enter when attempting to select the version, and it appears to have automatically submitted the issue without any details.
It seems I am not able to edit the issue.

Here is the problem:

make rest call to: /rest/builds/65881
  { "id":65881,
    "beginDate":"2021-03-02T10:22:44.798-05:00", ...

make rest call to: /rest/builds?from_date=2021-03-02&to_date=2021-03-03&count=6
 [ ..., {"@class":"com.pmease.quickbuild.model.Build",
    "version":"(generated from buildspec)",
    "beginDate":"2021-03-02T10:22:44.000-05:00", ...

The version is completely different!
Also, very minor, but the dates have different precision.
Why is this happening? Is there any workaround?

Robin Shen [02/Mar/21 11:39 PM]
Builds queried by date range (or other criterias) are returned directly from database, while accessing build directly via id returns the actual build being processing in queue. Database records are synced before and after the build for performance reasons. Hence the difference.

Steve Mik [03/Mar/21 05:13 PM]
So are you saying the difference is expected? I expect the results from either query to be fully up-to-date.
There is no mention of such a limitation on https://wiki.pmease.com/display/QB10/Interact+with+Builds

Furthermore, how do I access the "masterNodeAddress" for a "RUNNING" build? /rest/builds/id does not return the node, and /rest/builds?query does not return the node for "RUNNING" builds.

Robin Shen [03/Mar/21 11:18 PM]
Yes this is a limitation and expected. To get the master node address, find the node address of master step in returned build object. The masterNodeAddress will only be updated after build is finished.

Steve Mik [04/Mar/21 05:49 PM]
Okay, I opened an improvement request (QB-3684), you can close this bug.

Btw, your jira crashes if I try to use unicode characters U+2022 and U+2192.

Robin Shen [04/Mar/21 11:14 PM]
Duplicates QB-3684