Jobsets: update schema to align with the API

[?]
Apr 28, 2021, 7:41 PM
P32OJ3RUWL2CQFC3AHG2OC3SQKBSYOXNMPWOQHHALKC7ENHYFJ3QC

Dependencies

  • [2] OOI5OFJX hydra-api: flesh out Jobset schema
  • [3] ZDH6UX5U Jobset: add HTTP API test
  • [4] XNXX4WCQ api-test: clean up, use subtests
  • [5] RQI3GRC6 Enable setting checkresponsible in the edit jobset form
  • [6] KSBB33RE Add a dashboard
  • [7] ODNCGFQ5 * Improved the navigation bar: don't include all projects (since that
  • [8] NP7IOJ4Q Flesh out the API a bit
  • [9] 4VYSDP4I Add eager fetching of relations and enable that for jobset->jobsetinputs
  • [10] W5OAZWPD Drop the errorMsg column in the Jobs table
  • [11] LX326CB7 Add hydra OpenAPI description (#750)
  • [12] TQVKZQUG Use the REST API in the web interface for editing jobsets
  • [13] YI3BZG5N Cleanup Jobset serialization
  • [14] KYSBJAYN Allow dashes in jobset input names
  • [15] XWEWQOHV api-test: use is for nicer errors
  • [16] LUYDIGYM Make input value wider
  • [17] OX6NYJDV Split viewing and editing a jobset
  • [18] GLJD3PG2 api-test.t: make it work under yath
  • [19] OK4P3AMK Remove the ability to add multiple jobset input alternatives
  • [20] K3HODXGH Check all inputs for blame but only email selected inputs
  • [21] LZVO64YG Merge in the first bits of the API work
  • [22] HPXFXHFS Remove SHA-1 hash from BuildProducts
  • [23] VJFLX7B6 Fix rendering of jobset inputs
  • [24] QJYMTECF Add nixexprpath/nixexprinput to GET of jobset (API).
  • [25] VZX6HJ3I Fix jobset input handling in the API
  • [26] QUMWPGCU Add flake configuration to the web interface
  • [27] X27GNHDV * Basic job info in the database.
  • [28] BXHG3HYL When renaming a jobset, add a redirect from the old name
  • [29] PCD3ZH6Z Partially revert 1c20cfdf2403feb78cef515faf15c04d5c9f17bd
  • [*] 3HZY24CX * Make jobsets viewable under

Change contents

  • replacement in hydra-api.yaml at line 645
    [2.1172][2.1172:1264]()
    hidden:
    description: when false the jobset is visible in the web frontend
    [2.1172]
    [2.1264]
    visible:
    description: when true the jobset is visible in the web frontend
  • replacement in hydra-api.yaml at line 670
    [2.2028][2.2028:2051]()
    type: string
    [2.2028]
    [2.2051]
    type: integer
  • replacement in hydra-api.yaml at line 675
    [5.15928][5.15928:15950]()
    jobsetinputs:
    [5.15806]
    [5.15950]
    inputs:
  • replacement in src/lib/Hydra/Controller/Jobset.pm at line 273
    [5.500][2.2173:2320]()
    foreach my $name (keys %{$c->stash->{params}->{jobsetinputs}}) {
    my $inputData = $c->stash->{params}->{jobsetinputs}->{$name};
    [5.500]
    [5.635]
    foreach my $name (keys %{$c->stash->{params}->{inputs}}) {
    my $inputData = $c->stash->{params}->{inputs}->{$name};
  • replacement in src/lib/Hydra/Schema/Jobsets.pm at line 413
    [5.427][5.1:14](),[5.1][5.1:14](),[5.14][5.137:154](),[5.154][2.2321:2392](),[2.2392][5.154:173](),[5.154][5.154:173](),[5.173][2.2393:2620](),[2.2620][5.173:193](),[5.173][5.173:193](),[5.218][5.0:25](),[5.25][2.2621:2750](),[5.71][5.242:249](),[2.2750][5.242:249](),[5.242][5.242:249](),[5.249][5.330:355](),[5.14][5.330:355](),[5.355][5.33:73](),[5.33][5.33:73]()
    my %hint = (
    columns => [
    "errortime",
    "lastcheckedtime",
    "triggertime",
    "enabled",
    "keepnr",
    "checkinterval",
    "schedulingshares",
    "starttime"
    ],
    string_columns => [
    "name",
    "project",
    "description",
    "nixexprinput",
    "nixexprpath",
    "errormsg",
    "emailoverride",
    "fetcherrormsg",
    "type",
    "flake"
    ],
    boolean_columns => [
    "enableemail",
    "hidden"
    ],
    eager_relations => {
    jobsetinputs => "name"
    }
    );
    [5.218]
    [5.2105]
    sub as_json {
    my $self = shift;
  • replacement in src/lib/Hydra/Schema/Jobsets.pm at line 416
    [5.2106][5.74:109]()
    sub json_hint {
    return \%hint;
    [5.2106]
    [5.109]
    my %json = (
    # columns
    "errortime" => $self->get_column("errortime"),
    "lastcheckedtime" => $self->get_column("lastcheckedtime"),
    "triggertime" => $self->get_column("triggertime"),
    "enabled" => $self->get_column("enabled"),
    "keepnr" => $self->get_column("keepnr"),
    "checkinterval" => $self->get_column("checkinterval"),
    "schedulingshares" => $self->get_column("schedulingshares"),
    "starttime" => $self->get_column("starttime"),
    # string_columns
    "name" => $self->get_column("name") // "",
    "project" => $self->get_column("project") // "",
    "description" => $self->get_column("description") // "",
    "nixexprinput" => $self->get_column("nixexprinput") // "",
    "nixexprpath" => $self->get_column("nixexprpath") // "",
    "errormsg" => $self->get_column("errormsg") // "",
    "emailoverride" => $self->get_column("emailoverride") // "",
    "fetcherrormsg" => $self->get_column("fetcherrormsg") // "",
    "type" => $self->get_column("type") // "",
    "flake" => $self->get_column("flake") // "",
    # boolean_columns
    "enableemail" => $self->get_column("enableemail") ? JSON::true : JSON::false,
    "visible" => $self->get_column("hidden") ? JSON::false : JSON::true,
    "inputs" => { map { $_->name => $_ } $self->jobsetinputs }
    );
    return \%json;
  • replacement in src/root/edit-jobset.tt at line 49
    [5.1864][2.2751:2903]()
    <tbody class="jobsetinputs">
    [% jobsetinputs = createFromEval ? eval.jobsetevalinputs : jobset.jobsetinputs; FOREACH input IN jobsetinputs %]
    [5.1864]
    [5.175]
    <tbody class="inputs">
    [% inputs = createFromEval ? eval.jobsetevalinputs : jobset.jobsetinputs; FOREACH input IN inputs %]
  • replacement in src/root/edit-jobset.tt at line 223
    [5.409][2.3116:3182]()
    var data = { 'jobsetinputs': {} };
    var jobsetinputs = {};
    [5.409]
    [5.1152]
    var data = { 'inputs': {} };
    var inputs = {};
  • replacement in src/root/edit-jobset.tt at line 236
    [5.824][2.3183:3265]()
    if (!(baseName in jobsetinputs))
    jobsetinputs[baseName] = {};
    [5.824]
    [5.906]
    if (!(baseName in inputs))
    inputs[baseName] = {};
  • replacement in src/root/edit-jobset.tt at line 240
    [5.1319][2.3266:3334]()
    data.jobsetinputs[elem.value] = jobsetinputs[baseName];
    [5.1319]
    [5.1320]
    data.inputs[elem.value] = inputs[baseName];
  • replacement in src/root/edit-jobset.tt at line 242
    [5.1333][2.3335:3391]()
    jobsetinputs[baseName][param] = elem.value;
    [5.1333]
    [5.1072]
    inputs[baseName][param] = elem.value;
  • replacement in t/Controller/Jobset/http.t at line 49
    [3.1367][3.1367:1389]()
    visible => 1,
    [3.1367]
    [3.1389]
    visible => JSON::true,
  • replacement in t/Controller/Jobset/http.t at line 79
    [3.2178][3.2178:2231]()
    hidden => JSON::false,
    jobsetinputs => {},
    [3.2178]
    [3.2231]
    visible => JSON::true,
    inputs => {},
  • replacement in t/Controller/Jobset/http.t at line 102
    [3.2746][3.2746:2768]()
    visible => 1,
    [3.2746]
    [3.2768]
    visible => JSON::true,
  • replacement in t/Controller/Jobset/http.t at line 107
    [3.2882][3.2882:2908]()
    jobsetinputs => {
    [3.2882]
    [3.2908]
    inputs => {
  • replacement in t/Controller/Jobset/http.t at line 137
    [3.3665][3.3665:3714]()
    hidden => JSON::false,
    jobsetinputs => {
    [3.3665]
    [3.3714]
    visible => JSON::true,
    inputs => {
  • replacement in t/Controller/Jobset/http.t at line 143
    [3.3822][3.3822:3918]()
    jobsetinputalts => [
    "https://github.com/NixOS/ofborg.git released"
    ]
    [3.3822]
    [3.3918]
    value => "https://github.com/NixOS/ofborg.git released"
  • replacement in t/api-test.t at line 84
    [4.1378][4.1378:1660]()
    my $result = request_json({ uri => '/jobset/sample/default', method => 'PUT', data => { nixexprpath => "default.nix", nixexprinput => "my-src", jobsetinputs => { "my-src" => { type => "path", value => $jobsetdir } }, enabled => "1", visible => "1", checkinterval => "3600"} });
    [4.1378]
    [4.1660]
    my $result = request_json({ uri => '/jobset/sample/default', method => 'PUT', data => { nixexprpath => "default.nix", nixexprinput => "my-src", inputs => { "my-src" => { type => "path", value => $jobsetdir } }, enabled => "1", visible => "1", checkinterval => "3600"} });
  • replacement in t/api-test.t at line 89
    [5.38310][4.1819:1910]()
    ok(exists $jobset->{jobsetinputs}->{"my-src"}, "The new jobset has a 'my-src' input");
    [5.38310]
    [5.228]
    ok(exists $jobset->{inputs}->{"my-src"}, "The new jobset has a 'my-src' input");
  • replacement in t/api-test.t at line 91
    [5.229][4.1911:2033]()
    is($jobset->{jobsetinputs}->{"my-src"}->{"jobsetinputalts"}->[0], $jobsetdir, "The 'my-src' input is in $jobsetdir");
    [5.229]
    [4.2033]
    is($jobset->{inputs}->{"my-src"}->{value}, $jobsetdir, "The 'my-src' input is in $jobsetdir");