<< Back to previous view

[QB-3675] REST API returns inconsistent results
Created: 02/Mar/21  Updated: 04/Mar/21

Status: Closed
Project: QuickBuild
Component/s: None
Affects Version/s: 10.0.23
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Steve Mik Assigned To: Robin Shen
Resolution: Duplicate Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown


 Comments   
Comment by 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
results:
  { "id":65881,
    "configuration":145,
    "version":"2021.2.0VEC.223.0",
    "requester":41,
    "scheduled":false,
    "status":"RUNNING",
    "statusDate":"2021-03-02T10:22:44.798-05:00",
    "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
results:
  
 [ ..., {"@class":"com.pmease.quickbuild.model.Build",
    "id":65881,
    "configuration":145,
    "version":"(generated from buildspec)",
    "requester":41,
    "scheduled":false,
    "status":"RUNNING",
    "statusDate":"2021-03-02T10:22:44.000-05:00",
    "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?
Comment by 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.
Comment by 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.
Comment by 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.
Comment by 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.
Comment by Robin Shen [ 04/Mar/21 11:14 PM ]
Duplicates QB-3684
Generated at Wed Apr 24 14:49:47 UTC 2024 using JIRA 189.