Add json output for the search API endpoint

[?]
Oct 31, 2018, 5:46 PM
MIMHJSZKFRNIKCYWQQDITZFPY6L2P43BSBPFERK3633CFDQY7YDAC

Dependencies

  • [2] MMHOJIGD Test whether incorrect passwords are rejected
  • [3] TX7Q4RAS Add page showing latest build steps
  • [4] Q3VTDUSQ Fix the API test
  • [5] 7ECJWNVX Cleanup Project model
  • [6] ZIIXICG7 Make the outputs' outpaths available via the Build JSON API
  • [7] MQYHIUEE Cleanup eval serialization
  • [8] SYLVCTT6 Start api cleanup with the User model
  • [9] LZVO64YG Merge in the first bits of the API work
  • [10] YI3BZG5N Cleanup Jobset serialization
  • [11] 4VYSDP4I Add eager fetching of relations and enable that for jobset->jobsetinputs
  • [12] 2DGIP6L4 Cleanup build serialization
  • [*] J5UVLXOK * Start of a basic Catalyst web interface.
  • [*] FHOH54HQ When searching a path / drv path, use separate queries for both options to prevent seq. scan.

Change contents

  • edit in src/lib/Hydra/Controller/Root.pm at line 422
    [15.285]
    [3.639]
    $c->stash->{resource} = { projects => $c->stash->{projects},
    jobsets => $c->stash->{jobsets},
    builds => $c->stash->{builds},
    buildsdrv => $c->stash->{buildsdrv} };
  • replacement in tests/api-test.pl at line 3
    [5.36481][2.0:30]()
    use Test::Simple tests => 17;
    [5.36481]
    [5.36511]
    use Test::Simple tests => 19;
  • edit in tests/api-test.pl at line 68
    [4.437]
    my $search_project = decode_json(request_json({ uri => "/search/?query=sample" })->content());
    ok($search_project->{projects}[0]->{name} == "sample", "Search for project 'sample' works");
    my $search_build = decode_json(request_json({ uri => "/search/?query=" . $build->{buildoutputs}->{out}->{path} })->content());
    ok($search_build->{builds}[0]->{buildoutputs}->{out}->{path} == $build->{buildoutputs}->{out}->{path}, "Search for builds work");