Resultsdb - API v2.0 implementation
ClosedPublic

Authored by jskladan on Sep 13 2016, 2:19 PM.

Details

Summary

Changes since 1.0

  • Removed Jobs and replaced with Groups to remove the "execution status" (originaly represented by Job) from ResultsDB, but keeping the ability to group Results, as it might make semantical sense
    • Result can be a part of 0-n Groups
    • UUID as a default Group identifier instead of id
  • In the response data: *href (pointer to self) is only present in the resource's data, not in the general queries that return collections, since the 'search' queries' href was not permalink
    • ref_url as a common "external url" attribute
      • Result.ref_url instead of Result.log_url
      • Testcase.ref_url instead of Testcase.url
  • Changes in the Group object
    • results is an URL at which Results in that particular Group can be
    • name renamed to description
  • Changes in the Result object
    • ref_url instead of log_url
    • result_data replaced with data
    • summary replaced with note
    • only PASSED, FAILED, INFO, NEEDS_INSPECTION are now valid outcome values
    • groups is a list of Group urls which the Result is part of
    • When submitting new Result, Testcase and Group \[resource\] can be represented either by the unique identifier \[uid\] (Testcase.name, Group.uuid), or by object containing the uid, and any other applicable resource's attributes
      • resource is identified by uid and:
        • exists -> resource is linked to the Result
        • does _not_ exist -> resource is created. Other attributes are set to default values
      • resource is identified by object and:
        • exists -> relevant attributes of the resource are updated to the provided values
        • does _not_ exist -> resource is created, relevant attributes are set to the provided values
  • Changes in the Testcase object
    • ref_url instead of url
  • Changes in querying:
    • * (star) used as a wildcard instead of % (percent sign) in the like: filters
    • Result
      • added testcases keyword to filter by Testcase.name
        • like filter allowed
        • multiple values can be provided, separate by commas to get or filter based on all the values provided: ...&testcases=name1,name2
    • Group
      • like filter for description
  • _auth placeholder for the Authorization/Authenticaion data in the Request queries; Ignored at the moment

API documentation is here: http://docs.resultsdb20.apiary.io/#

Test Plan

Unittests are present, and working

Diff Detail

Repository
rRSDB resultsdb
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jskladan retitled this revision from to Resultsdb - API v2.0 implementation.Sep 13 2016, 2:19 PM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added a reviewer: libtaskotron.
tflink accepted this revision.Sep 13 2016, 10:27 PM
tflink added a reviewer: tflink.

Found some piddly little stuff but overall, looks good to me. I assume that you've been running it locally enough to be confident that it'll work well enough for dev when it lands.

Does this include db optimizations from the conversations during Flock?

migration.sh
2

was this supposed to be part of the revision?

resultsdb/__init__.py
34

Shouldn't this version be bumped with such a major change?

resultsdb/controllers/api_v1.py
47–48

s/fot/for

resultsdb/controllers/api_v2.py
261

If this is all commented out, can it be removed?

495

Is this documented anywhere?

702

Same question as above - if this is commented out, can it be removed entirely?

resultsdb/proxy.py
6

This comment needs to be updated

This revision is now accepted and ready to land.Sep 13 2016, 10:27 PM

adding @kparal and @ralph2 as a subscribers in case they're interested in looking at the changes before they land

Thanks for the comments, I'll go and do it ASAP.

migration.sh
2

oops, missed this one bugger, thanks!

resultsdb/__init__.py
34

Absolutely, I just though we'd bump it before release, together with specfile.
But I can absolutely do it in the revision, too.

resultsdb/controllers/api_v2.py
261

Sure thing, /me just missed it.

495

The fact, and reasoning is stated in the docs: http://docs.resultsdb20.apiary.io/#reference/0/results/create-new-result (see the data section), but if you can think of a better place, I'm all for it.

702

Sure, /me just forgot to do it.

resultsdb/proxy.py
6

Will, do. I did not really touch the file apart of the autopep8 :)

Closed by commit rRSDB62c49f7fac88: Resultsdb - API v2.0 implementation (authored by Josef Skladanka <jskladan@redhat.com>). · Explain WhyOct 4 2016, 10:55 AM
This revision was automatically updated to reflect the committed changes.