Add eager fetching of relations and enable that for jobset->jobsetinputs

[?]
Oct 24, 2013, 5:18 PM
4VYSDP4IAWIIVLXCKXJEYWIHZV3PUD3VACX3K4EIQKPFGWLZK6HQC

Dependencies

  • [2] K3HODXGH Check all inputs for blame but only email selected inputs
  • [3] YI3BZG5N Cleanup Jobset serialization
  • [4] KYSBJAYN Allow dashes in jobset input names
  • [5] SYLVCTT6 Start api cleanup with the User model
  • [6] KSBB33RE Add a dashboard
  • [7] LZVO64YG Merge in the first bits of the API work
  • [8] 7ECJWNVX Cleanup Project model
  • [*] X27GNHDV * Basic job info in the database.
  • [*] SB2V735V Keep track of the database schema version

Change contents

  • edit in src/lib/Hydra/Component/ToJSON.pm at line 26
    [4.409]
    [4.409]
    foreach my $relname (keys %{$hint->{eager_relations}}) {
    my $key = $hint->{eager_relations}->{$relname};
    $json{$relname} = { map { $_->$key => $_ } $self->$relname };
    }
  • edit in src/lib/Hydra/Schema/JobsetInputs.pm at line 155
    [2.1148]
    [11.20420]
    my %hint = (
    relations => {
    "jobsetinputalts" => "value"
    }
    );
  • edit in src/lib/Hydra/Schema/JobsetInputs.pm at line 162
    [11.20421]
    [10.1915]
    sub json_hint {
    return \%hint;
    }
  • replacement in src/lib/Hydra/Schema/Jobsets.pm at line 312
    [3.14][3.14:33]()
    relations => {
    [3.14]
    [3.33]
    eager_relations => {
  • replacement in tests/api-test.pl at line 3
    [4.36481][3.113:142]()
    use Test::Simple tests => 9;
    [4.36481]
    [4.2064]
    use Test::Simple tests => 10;
  • replacement in tests/api-test.pl at line 46
    [4.38310][3.143:228]()
    ok($jobset->{jobsetinputs}->[0] eq "my-src", "The new jobset has a 'my-src' input");
    [4.38310]
    [3.228]
    ok(exists $jobset->{jobsetinputs}->{"my-src"}, "The new jobset has a 'my-src' input");
  • replacement in tests/api-test.pl at line 48
    [3.229][3.229:244]()
    =begin comment
    [3.229]
    [3.244]
    ok($jobset->{jobsetinputs}->{"my-src"}->{jobsetinputalts}->[0] eq "/run/jobset", "The 'my-src' input is in /run/jobset");
  • replacement in tests/api-test.pl at line 50
    [3.245][4.620:744](),[4.620][4.620:744]()
    ok($jobset->{jobsetinputs}->[0]->{jobsetinputalts}->[0]->{value} eq "/run/jobset", "The 'my-src' input is in /run/jobset");
    [3.245]
    [4.38519]
    =begin comment