2021-03-08 16:01:00 +00:00
|
|
|
module Rep : sig
|
2021-07-05 12:45:08 +00:00
|
|
|
type untyped_id
|
|
|
|
type 'a id
|
2021-03-08 16:01:00 +00:00
|
|
|
type file = {
|
|
|
|
filepath : Fpath.t;
|
|
|
|
sha256 : Cstruct.t;
|
|
|
|
size : int;
|
|
|
|
}
|
|
|
|
|
2022-02-22 12:16:42 +00:00
|
|
|
val id_to_int64 : 'a id -> int64
|
2021-07-05 12:45:08 +00:00
|
|
|
val untyped_id : untyped_id Caqti_type.t
|
|
|
|
val id : 'a -> 'a id Caqti_type.t
|
2021-03-08 16:01:00 +00:00
|
|
|
val uuid : Uuidm.t Caqti_type.t
|
|
|
|
val ptime : Ptime.t Caqti_type.t
|
|
|
|
val fpath : Fpath.t Caqti_type.t
|
|
|
|
val cstruct : Cstruct.t Caqti_type.t
|
|
|
|
val file : file Caqti_type.t
|
|
|
|
val execution_result : Builder.execution_result Caqti_type.t
|
|
|
|
val console : (int * string) list Caqti_type.t
|
|
|
|
end
|
2021-07-05 12:45:08 +00:00
|
|
|
type 'a id = 'a Rep.id
|
2021-01-08 12:47:17 +00:00
|
|
|
|
2021-03-08 16:01:00 +00:00
|
|
|
type file = Rep.file = {
|
2021-01-08 12:47:17 +00:00
|
|
|
filepath : Fpath.t;
|
|
|
|
sha256 : Cstruct.t;
|
2021-02-25 14:27:45 +00:00
|
|
|
size : int;
|
2021-01-08 12:47:17 +00:00
|
|
|
}
|
|
|
|
|
2021-01-27 20:25:51 +00:00
|
|
|
val application_id : int32
|
|
|
|
|
|
|
|
val current_version : int64
|
|
|
|
|
|
|
|
val get_application_id :
|
2022-04-04 16:30:21 +00:00
|
|
|
(unit, int32, [ `One ]) Caqti_request.t
|
2021-01-27 20:25:51 +00:00
|
|
|
|
|
|
|
val set_application_id :
|
2022-04-04 16:30:21 +00:00
|
|
|
(unit, unit, [ `Zero ]) Caqti_request.t
|
2021-01-27 20:25:51 +00:00
|
|
|
|
|
|
|
val get_version :
|
2022-04-04 16:30:21 +00:00
|
|
|
(unit, int64, [ `One ]) Caqti_request.t
|
2021-01-27 20:25:51 +00:00
|
|
|
|
|
|
|
val set_current_version :
|
2022-04-04 16:30:21 +00:00
|
|
|
(unit, unit, [ `Zero ]) Caqti_request.t
|
2021-01-27 20:25:51 +00:00
|
|
|
|
2021-01-08 12:47:17 +00:00
|
|
|
val last_insert_rowid :
|
2022-04-04 16:30:21 +00:00
|
|
|
(unit, 'a id, [ `One ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
|
|
|
|
module Job : sig
|
|
|
|
val get :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`job] id, string, [ `One ])
|
2021-01-08 12:47:17 +00:00
|
|
|
Caqti_request.t
|
|
|
|
val get_id_by_name :
|
2022-04-04 16:30:21 +00:00
|
|
|
(string, [`job] id, [ `One | `Zero ]) Caqti_request.t
|
2021-06-29 14:59:08 +00:00
|
|
|
val get_all_with_section_synopsis :
|
2021-07-05 12:45:08 +00:00
|
|
|
(unit, [`job] id * string * string option * string option, [ `Many | `One | `Zero ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
val try_add :
|
2022-04-04 16:30:21 +00:00
|
|
|
(string, unit, [ `Zero ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
val remove :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`job] id, unit, [ `Zero ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
end
|
|
|
|
|
2021-06-29 14:59:08 +00:00
|
|
|
module Tag : sig
|
|
|
|
val get_id_by_name :
|
2022-04-04 16:30:21 +00:00
|
|
|
(string, [`tag] id, [ `One ]) Caqti_request.t
|
2021-06-29 14:59:08 +00:00
|
|
|
val try_add :
|
2022-04-04 16:30:21 +00:00
|
|
|
(string, unit, [ `Zero ]) Caqti_request.t
|
2021-06-29 14:59:08 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
module Job_tag : sig
|
|
|
|
val add :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`tag] id * string * [`job] id, unit, [ `Zero ]) Caqti_request.t
|
2021-06-30 10:55:00 +00:00
|
|
|
val update :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`tag] id * string * [`job] id, unit, [ `Zero ]) Caqti_request.t
|
2021-06-29 14:59:08 +00:00
|
|
|
val get_value :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`tag] id * [`job] id, string, [ `One | `Zero ]) Caqti_request.t
|
2022-02-22 12:16:42 +00:00
|
|
|
val remove_by_job :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`job] id, unit, [ `Zero ]) Caqti_request.t
|
2021-06-29 14:59:08 +00:00
|
|
|
end
|
|
|
|
|
2021-01-08 12:47:17 +00:00
|
|
|
module Build_artifact : sig
|
2022-04-04 16:30:21 +00:00
|
|
|
val get : ([`build_artifact] id, file, [ `One]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
val get_by_build_uuid :
|
2021-07-05 12:45:08 +00:00
|
|
|
(Uuidm.t * Fpath.t, [`build_artifact] id * file,
|
2022-04-04 16:30:21 +00:00
|
|
|
[ `One | `Zero ])
|
2021-01-08 12:47:17 +00:00
|
|
|
Caqti_request.t
|
|
|
|
val get_all_by_build :
|
2021-07-05 12:45:08 +00:00
|
|
|
([`build] id, [`build_artifact] id * file, [ `Many | `One | `Zero ]) Caqti_request.t
|
2023-09-14 08:58:09 +00:00
|
|
|
val exists : (Cstruct.t, bool, [ `One ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
val add :
|
2022-04-04 16:30:21 +00:00
|
|
|
(file * [`build] id, unit, [ `Zero ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
val remove_by_build :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`build] id, unit, [ `Zero ]) Caqti_request.t
|
2021-06-25 12:01:20 +00:00
|
|
|
val remove :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`build_artifact] id, unit, [ `Zero ]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
module Build :
|
|
|
|
sig
|
|
|
|
type t = {
|
|
|
|
uuid : Uuidm.t;
|
|
|
|
start : Ptime.t;
|
|
|
|
finish : Ptime.t;
|
|
|
|
result : Builder.execution_result;
|
2021-08-31 11:59:45 +00:00
|
|
|
console : Fpath.t;
|
|
|
|
script : Fpath.t;
|
2021-11-05 10:45:26 +00:00
|
|
|
platform : string;
|
2021-07-05 12:45:08 +00:00
|
|
|
main_binary : [`build_artifact] id option;
|
2021-07-08 11:33:27 +00:00
|
|
|
input_id : Cstruct.t option;
|
2021-07-05 12:45:08 +00:00
|
|
|
user_id : [`user] id;
|
|
|
|
job_id : [`job] id;
|
2021-01-08 12:47:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
val get_by_uuid :
|
2022-04-04 16:30:21 +00:00
|
|
|
(Uuidm.t, [`build] id * t, [ `One | `Zero ])
|
2021-01-08 12:47:17 +00:00
|
|
|
Caqti_request.t
|
|
|
|
val get_all :
|
2021-07-05 12:45:08 +00:00
|
|
|
([`job] id, [`build] id * t, [ `Many | `One | `Zero ]) Caqti_request.t
|
2021-11-17 14:02:04 +00:00
|
|
|
val get_all_failed :
|
2021-11-18 10:56:17 +00:00
|
|
|
(int * int * string option, string * t, [ `Many | `One | `Zero ]) Caqti_request.t
|
2021-07-08 11:33:27 +00:00
|
|
|
val get_all_artifact_sha :
|
2021-11-18 10:56:17 +00:00
|
|
|
([`job] id * string option, Cstruct.t, [ `Many | `One | `Zero ]) Caqti_request.t
|
2021-11-17 16:00:58 +00:00
|
|
|
val get_latest_successful_with_binary :
|
2023-11-22 13:07:28 +00:00
|
|
|
([`job] id * string, [`build] id * t * file, [ `One | `Zero ])
|
2021-01-29 13:34:56 +00:00
|
|
|
Caqti_request.t
|
2021-11-17 16:39:49 +00:00
|
|
|
val get_failed_builds :
|
2021-11-18 10:56:17 +00:00
|
|
|
([`job] id * string option, t, [ `Many | `One | `Zero ]) Caqti_request.t
|
2021-11-17 15:28:15 +00:00
|
|
|
val get_latest_successful :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`job] id * string option, t, [ `One | `Zero ])
|
2021-11-08 10:55:11 +00:00
|
|
|
Caqti_request.t
|
2021-11-17 15:28:15 +00:00
|
|
|
val get_previous_successful_different_output :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`build] id, t, [ `One | `Zero ])
|
2021-11-08 10:55:11 +00:00
|
|
|
Caqti_request.t
|
2021-11-17 15:28:15 +00:00
|
|
|
val get_next_successful_different_output :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`build] id, t, [ `One | `Zero ])
|
2021-04-23 10:06:39 +00:00
|
|
|
Caqti_request.t
|
2021-07-08 11:33:27 +00:00
|
|
|
val get_same_input_same_output_builds :
|
2021-08-31 11:59:45 +00:00
|
|
|
([`build] id, t, [ `Many | `One | `Zero ]) Caqti_request.t
|
2021-07-08 11:33:27 +00:00
|
|
|
val get_same_input_different_output_hashes :
|
|
|
|
([`build] id, Cstruct.t, [ `Many | `One | `Zero ]) Caqti_request.t
|
|
|
|
val get_different_input_same_output_input_ids :
|
|
|
|
([`build] id, Cstruct.t, [ `Many | `One | `Zero ]) Caqti_request.t
|
|
|
|
val get_one_by_input_id :
|
2022-04-04 16:30:21 +00:00
|
|
|
(Cstruct.t, t, [ `One ]) Caqti_request.t
|
2021-11-08 10:55:11 +00:00
|
|
|
val get_platforms_for_job :
|
|
|
|
([`job] id, string, [ `Many | `One | `Zero ]) Caqti_request.t
|
2022-04-04 16:30:21 +00:00
|
|
|
val add : (t, unit, [ `Zero ]) Caqti_request.t
|
2021-02-02 08:34:21 +00:00
|
|
|
val get_by_hash :
|
2022-04-04 16:30:21 +00:00
|
|
|
(Cstruct.t, t, [ `One]) Caqti_request.t
|
2021-08-31 11:59:45 +00:00
|
|
|
val get_with_main_binary_by_hash :
|
2022-04-04 16:30:21 +00:00
|
|
|
(Cstruct.t, t * file option, [ `One]) Caqti_request.t
|
2021-08-31 11:59:45 +00:00
|
|
|
val get_with_jobname_by_hash :
|
2022-04-04 16:30:21 +00:00
|
|
|
(Cstruct.t, string * t, [ `One | `Zero]) Caqti_request.t
|
|
|
|
val set_main_binary : ([`build] id * [`build_artifact] id, unit, [ `Zero ]) Caqti_request.t
|
|
|
|
val remove : ([`build] id, unit, [ `Zero]) Caqti_request.t
|
2021-01-08 12:47:17 +00:00
|
|
|
end
|
|
|
|
|
2021-01-20 21:50:35 +00:00
|
|
|
module User : sig
|
|
|
|
val get_user :
|
2021-07-05 12:45:08 +00:00
|
|
|
(string, [`user] id * Builder_web_auth.scrypt Builder_web_auth.user_info,
|
2022-04-04 16:30:21 +00:00
|
|
|
[ `One | `Zero ])
|
2021-01-20 21:50:35 +00:00
|
|
|
Caqti_request.t
|
|
|
|
val get_all :
|
|
|
|
(unit, string, [ `Many | `One | `Zero ]) Caqti_request.t
|
|
|
|
val add :
|
2022-04-04 16:30:21 +00:00
|
|
|
(Builder_web_auth.scrypt Builder_web_auth.user_info, unit, [ `Zero ])
|
2021-01-20 21:50:35 +00:00
|
|
|
Caqti_request.t
|
|
|
|
val remove_user :
|
2022-04-04 16:30:21 +00:00
|
|
|
(string, unit, [ `Zero ]) Caqti_request.t
|
2021-01-20 21:50:35 +00:00
|
|
|
val update_user :
|
2022-04-04 16:30:21 +00:00
|
|
|
(Builder_web_auth.scrypt Builder_web_auth.user_info, unit, [ `Zero ])
|
2021-01-20 21:50:35 +00:00
|
|
|
Caqti_request.t
|
|
|
|
end
|
|
|
|
|
2021-06-08 14:54:23 +00:00
|
|
|
module Access_list : sig
|
|
|
|
val get :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`user] id * [`job] id, [`access_list] id, [ `One ]) Caqti_request.t
|
2021-06-08 14:54:23 +00:00
|
|
|
val add :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`user] id * [`job] id, unit, [ `Zero ]) Caqti_request.t
|
2021-06-08 14:54:23 +00:00
|
|
|
val remove :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`user] id * [`job] id, unit, [ `Zero ]) Caqti_request.t
|
2022-02-22 12:16:42 +00:00
|
|
|
val remove_by_job :
|
2022-04-04 16:30:21 +00:00
|
|
|
([`job] id, unit, [ `Zero ]) Caqti_request.t
|
2021-06-08 14:54:23 +00:00
|
|
|
val remove_all_by_username :
|
2022-04-04 16:30:21 +00:00
|
|
|
(string, unit, [ `Zero ]) Caqti_request.t
|
2021-06-08 14:54:23 +00:00
|
|
|
end
|
|
|
|
|
2021-01-08 12:47:17 +00:00
|
|
|
val migrate :
|
2022-04-04 16:30:21 +00:00
|
|
|
(unit, unit, [ `Zero ]) Caqti_request.t list
|
2021-01-08 12:47:17 +00:00
|
|
|
val rollback :
|
2022-04-04 16:30:21 +00:00
|
|
|
(unit, unit, [ `Zero ]) Caqti_request.t list
|