Move evaluation errors from evaluations to EvaluationErrors, a new table

[?]
Feb 1, 2021, 11:35 PM
GLIPWYWLW6JNCIPMAXPKU64RHO2WDIFYZ5ZNGMYUJKX5Y7ZPSVJQC

Dependencies

  • [2] MLYGGEK7 hydra-eval-jobs: write evaluation errorMsg to the jobseteval table
  • [3] ZBCME7K4 Evaluation page: render evaluation errors
  • [4] CMBTR3KD jobset page: render error labels per eval
  • [5] BMGYDRNK jobsetevals: refer to jobset by ID
  • [6] 5SHCWE7X * Prevent repeated evaluation of a jobset with the same inputs. This
  • [7] MWXDVTS3 Copy the flake migration from the flake branch
  • [8] W74RIXTJ Show inputs and input changes on the jobset eval page
  • [9] WZZOOYCH Show queued builds in jobset evaluation pages
  • [10] U4TD3AIQ Add support for viewing jobset evaluations
  • [11] AZCCANUB Missing part of aaacf9eda36f5cdcc77cec20d6f49fbb6f925105
  • [12] U5ZWDBW3 Ensure that each eval is compared to the previous one from the same jobset
  • [13] SVDYZSZC Schema: add errorMsg, errorTime to JobsetEvals
  • [14] BQHDSG6O Merge remote-tracking branch 'origin/master' into flake
  • [15] SB2V735V Keep track of the database schema version
  • [16] RHUAFTJA Show aborted/cancelled builds separately in jobset eval pages
  • [17] PMNWRTGJ Add multiple output support
  • [18] VH5ZABDR Add a page to show the latest evaluations for the entire server
  • [19] SW7STLQ7 Cache flake-based jobset evaluations
  • [20] JM3DPYOM generated schema with new dbix class schema loader, grrrrrr
  • [21] G2T4WAHI Store the inputs of each evaluation in the database
  • [22] 3PNG7NIB Remove trailing whitespace
  • [23] TJK27WSB Open the DB using Hydra::Model::DB->new
  • [24] RFE6T5LG * Store jobset evaluations in the database explicitly. This includes
  • [25] NS7SND6R hydra-evaluator: Send statistics to statsd
  • [26] 4WZQW2N6 Fix indentation and get rid of some unnecessary whitespace in the output
  • [27] IGR322YP sql: Generate models from postgresql
  • [28] 4QCXGR4W Tabify the eval page
  • [29] MB5INTIQ Normalize nixexpr{input,path} from builds to jobsetevals.
  • [30] 5N367XMT jobset view: jump back to the proper tab when displaying all failed jobsets
  • [*] 2GK5DOU7 * Downloading closures.
  • [*] D5QIOJGP * Move everything up one directory.
  • [*] IK53RV4V
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] G6HJY2V4
  • [*] 4S5JF5JP Use latest DBIx::Class::Schema::Loader

Change contents

  • replacement in src/lib/Hydra/Helper/Nix.pm at line 214
    [6.1010][6.1274:1344](),[6.1344][6.1084:1085](),[6.1084][6.1084:1085]()
    { order_by => "id DESC", rows => $rows, offset => $offset });
    [6.1010]
    [6.1085]
    { order_by => "me.id DESC", rows => $rows, offset => $offset
    , prefetch => { evaluationerror => [ ] } });
  • file addition: EvaluationErrors.pm (----------)
    [33.477]
    use utf8;
    package Hydra::Schema::EvaluationErrors;
    # Created by DBIx::Class::Schema::Loader
    # DO NOT MODIFY THE FIRST PART OF THIS FILE
    =head1 NAME
    Hydra::Schema::EvaluationErrors
    =cut
    use strict;
    use warnings;
    use base 'DBIx::Class::Core';
    =head1 COMPONENTS LOADED
    =over 4
    =item * L<Hydra::Component::ToJSON>
    =back
    =cut
    __PACKAGE__->load_components("+Hydra::Component::ToJSON");
    =head1 TABLE: C<evaluationerrors>
    =cut
    __PACKAGE__->table("evaluationerrors");
    =head1 ACCESSORS
    =head2 id
    data_type: 'integer'
    is_auto_increment: 1
    is_nullable: 0
    sequence: 'evaluationerrors_id_seq'
    =head2 errormsg
    data_type: 'text'
    is_nullable: 1
    =head2 errortime
    data_type: 'integer'
    is_nullable: 1
    =cut
    __PACKAGE__->add_columns(
    "id",
    {
    data_type => "integer",
    is_auto_increment => 1,
    is_nullable => 0,
    sequence => "evaluationerrors_id_seq",
    },
    "errormsg",
    { data_type => "text", is_nullable => 1 },
    "errortime",
    { data_type => "integer", is_nullable => 1 },
    );
    =head1 PRIMARY KEY
    =over 4
    =item * L</id>
    =back
    =cut
    __PACKAGE__->set_primary_key("id");
    =head1 RELATIONS
    =head2 jobsetevals
    Type: has_many
    Related object: L<Hydra::Schema::JobsetEvals>
    =cut
    __PACKAGE__->has_many(
    "jobsetevals",
    "Hydra::Schema::JobsetEvals",
    { "foreign.evaluationerror_id" => "self.id" },
    undef,
    );
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-02-01 20:17:39
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sZIg35KWCO8MOsQ5cfN1IA
    __PACKAGE__->add_column(
    "+id" => { retrieve_on_insert => 1 }
    );
    1;
  • edit in src/lib/Hydra/Schema/JobsetEvals.pm at line 50
    [6.16175][6.16175:16176](),[6.1][6.1:55]()
    =head2 errormsg
    data_type: 'text'
    is_nullable: 1
  • replacement in src/lib/Hydra/Schema/JobsetEvals.pm at line 51
    [6.56][6.56:73]()
    =head2 errortime
    [6.56]
    [6.73]
    =head2 evaluationerror_id
  • edit in src/lib/Hydra/Schema/JobsetEvals.pm at line 54
    [6.97]
    [6.97]
    is_foreign_key: 1
  • replacement in src/lib/Hydra/Schema/JobsetEvals.pm at line 119
    [5.126][6.115:237](),[6.17821][6.115:237]()
    "errormsg",
    { data_type => "text", is_nullable => 1 },
    "errortime",
    { data_type => "integer", is_nullable => 1 },
    [5.126]
    [6.3788]
    "evaluationerror_id",
    { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
  • edit in src/lib/Hydra/Schema/JobsetEvals.pm at line 156
    [6.18170]
    [6.16664]
    =head2 evaluationerror
    Type: belongs_to
    Related object: L<Hydra::Schema::EvaluationErrors>
  • edit in src/lib/Hydra/Schema/JobsetEvals.pm at line 163
    [6.16665]
    [6.16665]
    =cut
    __PACKAGE__->belongs_to(
    "evaluationerror",
    "Hydra::Schema::EvaluationErrors",
    { id => "evaluationerror_id" },
    {
    is_deferrable => 0,
    join_type => "LEFT",
    on_delete => "SET NULL",
    on_update => "NO ACTION",
    },
    );
  • replacement in src/lib/Hydra/Schema/JobsetEvals.pm at line 223
    [6.1130][5.229:371]()
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-25 14:44:07
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OVxeYH+eoZZrAsAJ2/mAAA
    [6.1130]
    [6.18211]
    # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-02-01 20:17:39
    # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SGtK0PwRkbxiMuitQvs4wQ
  • replacement in src/root/common.tt at line 479
    [6.10521][4.0:35]()
    [% IF eval.errormsg %]
    [6.10521]
    [4.35]
    [% IF eval.evaluationerror.errormsg %]
  • replacement in src/root/jobset-eval.tt at line 92
    [4.126][4.126:151]()
    [% IF eval.errormsg %]
    [4.126]
    [4.151]
    [% IF eval.evaluationerror.errormsg %]
  • replacement in src/root/jobset-eval.tt at line 111
    [6.251][3.0:25]()
    [% IF eval.errormsg %]
    [6.251]
    [3.25]
    [% IF eval.evaluationerror.errormsg %]
  • replacement in src/root/jobset-eval.tt at line 113
    [3.69][3.69:252]()
    <p>Errors occurred at [% INCLUDE renderDateTime timestamp=(eval.errortime || eval.timestamp) %].</p>
    <pre class="alert alert-error">[% HTML.escape(eval.errormsg) %]</pre>
    [3.69]
    [3.252]
    <p>Errors occurred at [% INCLUDE renderDateTime timestamp=(eval.evaluationerror.errortime || eval.timestamp) %].</p>
    <pre class="alert alert-error">[% HTML.escape(eval.evaluationerror.errormsg) %]</pre>
  • replacement in src/root/jobset-eval.tt at line 175
    [6.4706][4.275:300]()
    [% IF eval.errormsg %]
    [6.4706]
    [4.300]
    [% IF eval.evaluationerror.errormsg %]
  • replacement in src/root/jobset-eval.tt at line 177
    [4.344][4.344:527]()
    <p>Errors occurred at [% INCLUDE renderDateTime timestamp=(eval.errortime || eval.timestamp) %].</p>
    <pre class="alert alert-error">[% HTML.escape(eval.errormsg) %]</pre>
    [4.344]
    [4.527]
    <p>Errors occurred at [% INCLUDE renderDateTime timestamp=(eval.evaluationerror.errortime || eval.timestamp) %].</p>
    <pre class="alert alert-error">[% HTML.escape(eval.evaluationerror.errormsg) %]</pre>
  • edit in src/script/hydra-eval-jobset at line 695
    [2.612]
    [2.612]
    my $evaluationErrorRecord = $db->resultset('EvaluationErrors')->create(
    { errormsg => $evaluationErrorMsg
    , errortime => $evaluationErrorTime
    }
    );
  • edit in src/script/hydra-eval-jobset at line 724
    [6.2572]
    [6.6059]
  • edit in src/script/hydra-eval-jobset at line 727
    [6.6138]
    [6.6138]
    , evaluationerror => $evaluationErrorRecord
  • edit in src/script/hydra-eval-jobset at line 730
    [6.853][2.614:708]()
    , errormsg => $evaluationErrorMsg
    , errortime => $evaluationErrorTime
  • edit in src/sql/hydra.sql at line 440
    [36.3210]
    [36.3210]
    create table EvaluationErrors (
    id serial primary key not null,
    errorMsg text, -- error output from the evaluator
    errorTime integer -- timestamp associated with errorMsg
    );
  • replacement in src/sql/hydra.sql at line 450
    [6.37681][6.381:505]()
    errorMsg text, -- error output from the evaluator
    errorTime integer, -- timestamp associated with errorMsg
    [6.6713]
    [6.505]
    evaluationerror_id integer,
  • replacement in src/sql/hydra.sql at line 478
    [6.7668][5.736:807]()
    foreign key (jobset_id) references Jobsets(id) on delete cascade
    [6.7668]
    [6.3974]
    foreign key (jobset_id) references Jobsets(id) on delete cascade,
    foreign key (evaluationerror_id) references EvaluationErrors(id) on delete set null
  • edit in src/sql/update-dbix.pl at line 24
    [6.10493]
    [6.10493]
    "evaluationerrors" => "EvaluationErrors",
  • file addition: upgrade-73.sql (----------)
    [33.3004]
    create table EvaluationErrors (
    id serial primary key not null,
    errorMsg text, -- error output from the evaluator
    errorTime integer, -- timestamp associated with errorMsg
    jobsetEvalId integer not null,
    FOREIGN KEY (jobsetEvalId)
    REFERENCES JobsetEvals(id)
    ON DELETE SET NULL
    );
    ALTER TABLE JobsetEvals
    ADD COLUMN evaluationerror_id integer NULL,
    ADD FOREIGN KEY (evaluationerror_id)
    REFERENCES EvaluationErrors(id)
    ON DELETE SET NULL;
    INSERT INTO EvaluationErrors
    (errorMsg, errorTime, jobsetEvalId)
    SELECT errorMsg, errorTime, id
    FROM JobsetEvals
    WHERE JobsetEvals.errorMsg != '' and JobsetEvals.errorMsg is not null;
    UPDATE JobsetEvals
    SET evaluationerror_id = EvaluationErrors.id
    FROM EvaluationErrors
    WHERE JobsetEvals.id = EvaluationErrors.jobsetEvalId
    AND JobsetEvals.errorMsg != '' and JobsetEvals.errorMsg is not null;
    ALTER TABLE JobsetEvals
    DROP COLUMN errorMsg,
    DROP COLUMN errorTime;
    ALTER TABLE EvaluationErrors
    DROP COLUMN jobsetEvalId;