Added UUID to Job
ClosedPublic

Authored by jskladan on Feb 24 2015, 1:34 PM.

Details

Summary

A piece of code needed for the ExecDB. The Job now can store an UUID.
Not required at the moment, but once provided, the jobs can be accessed
by it using the RESTfull interface like:

http://.../api/v1.0/jobs/UUID

While this is not exactly RESTfull in the spirit (resource should not
be accessible by multiple identifiers), it is IMHO the reasonable thing
to do, since the UUID is Taskotron-related identifier, but at the same
time is unique in our scope.

This is a pre-requirement for the resultsdb_api, and libtaskotron
ExecDB-related patches.

Test Plan

Added some uuid-related unittests
All unittests are passing
The code is running at taskotron-demo

Diff Detail

Repository
rRSDB resultsdb
Branch
feature/execdb
Lint
No Linters Available
Unit
No Unit Test Coverage
jskladan retitled this revision from to Added UUID to Job.Feb 24 2015, 1:34 PM
jskladan updated this object.
jskladan edited the test plan for this revision. (Show Details)
jskladan added reviewers: tflink, kparal, mkrizek.
tflink requested changes to this revision.Feb 25 2015, 5:16 AM

I assume that the removal of handling for requesting non-existant jobs was not intentional

resultsdb/controllers/api_v1.py
294

was removing the try/except block around this intentional? if I try to get a job with a non-existant jobid, I get a traceback.

This revision now requires changes to proceed.Feb 25 2015, 5:16 AM
jskladan added inline comments.Feb 25 2015, 9:20 AM
resultsdb/controllers/api_v1.py
294

aah, copy-paste error. Thanks!

jskladan added inline comments.Feb 25 2015, 9:33 AM
resultsdb/controllers/api_v1.py
294

Chmm, looking at this further - this is almost certainly a bug in resultsdb-frontend, since the tests covering the invalid IDs (test_get_invalid_job and test_get_invalid_job_uuid) are passing, and I did get just plain "Job not found" message when querying the API directly.

Have you tried getting a non-existing job via the API or through the resultsdb-frontend? https://taskotron.fedoraproject.org/resultsdb/jobs/9999999999999999999999999999999999 fails wint Err 500, so my guess would be the frontend, but please confirm.

The frontend bug is handled by D295. Do you have any other concerns, Tim?

tflink accepted this revision.Feb 26 2015, 1:47 PM
This revision is now accepted and ready to land.Feb 26 2015, 1:47 PM