adapt to builder changes (job -> script_job)

This commit is contained in:
Robur 2021-06-25 16:43:47 +00:00
parent b279eb521b
commit 88377adb7c
3 changed files with 5 additions and 5 deletions

View file

@ -34,7 +34,7 @@ let init dbpath datadir =
>>= fun () ->
Model.cleanup_staging datadir (module Db))
let pp_exec ppf (job, uuid, _, _, _, _, _) =
let pp_exec ppf ((job : Builder.script_job), uuid, _, _, _, _, _) =
Format.fprintf ppf "%s(%a)" job.Builder.name Uuidm.pp uuid
let safe_seg path =
@ -180,7 +180,7 @@ let add_routes datadir =
|> if_error ~status:`Bad_Request "Bad request"
~log:(fun e ->
Log.warn (fun m -> m "Received bad builder ASN.1: %a" pp_error e))
>>= fun (({ name ; _ }, uuid, _, _, _, _, _) as exec) ->
>>= fun ((({ name ; _ } : Builder.script_job), uuid, _, _, _, _, _) as exec) ->
Log.debug (fun m -> m "Received build %a" pp_exec exec);
Authorization.authorized req name
|> if_error ~status:`Forbidden "Forbidden" >>= fun () ->

View file

@ -166,7 +166,7 @@ let save_files dir staging files =
(Lwt_result.return [])
files
let save_all staging_dir ((job, uuid, _, _, _, _, artifacts) as exec) =
let save_all staging_dir (((job : Builder.script_job), uuid, _, _, _, _, artifacts) as exec) =
let build_dir = Fpath.(v job.Builder.name / Uuidm.to_string uuid) in
let output_dir = Fpath.(build_dir / "output")
and staging_output_dir = Fpath.(staging_dir / "output") in
@ -188,7 +188,7 @@ let commit_files datadir staging_dir job_name uuid =
let add_build
datadir
user_id
((job, uuid, console, start, finish, result, _) as exec)
(((job : Builder.script_job), uuid, console, start, finish, result, _) as exec)
(module Db : CONN) =
let open Builder_db in
let job_name = job.Builder.name in

View file

@ -62,7 +62,7 @@ val authorized : Builder_db.id -> string -> Caqti_lwt.connection -> (unit, [> Ca
val add_build :
Fpath.t ->
Builder_db.id ->
(Builder.job * Uuidm.t * (int * string) list * Ptime.t * Ptime.t *
(Builder.script_job * Uuidm.t * (int * string) list * Ptime.t * Ptime.t *
Builder.execution_result * (Fpath.t * string) list) ->
Caqti_lwt.connection ->
(unit, [> Caqti_error.call_or_retrieve | `Msg of string ]) result Lwt.t