Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update container package #435

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
(logs
(>= 0.7.0))
(containers
(>= 3.6))
(>= 3.14))
(containers-data
(>= 3.6))
(>= 3.14))
(mariadb
(and
(>= 1.1.6)
Expand All @@ -77,5 +77,4 @@
(guardian
(= 0.3.2))
;; Test/Dev dependencies
(alcotest-lwt :with-test)
))
(alcotest-lwt :with-test)))
4 changes: 2 additions & 2 deletions pool.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ depends: [
"sihl-storage" {>= "4.0.0" & < "5.0.0"}
"lwt" {>= "5.6.1"}
"logs" {>= "0.7.0"}
"containers" {>= "3.6"}
"containers-data" {>= "3.6"}
"containers" {>= "3.14"}
"containers-data" {>= "3.14"}
"mariadb" {>= "1.1.6" & < "2.0.0"}
"caqti-driver-mariadb" {>= "2.0.1"}
"caqti-lwt" {>= "2.0.1"}
Expand Down
10 changes: 5 additions & 5 deletions pool.opam.locked
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ depends: [
"ca-certs" {= "0.2.3"}
"camlp-streams" {= "5.0.1"}
"canary" {= "0.0.3"}
"caqti" {= "2.1.2"}
"caqti" {= "2.1.1"}
"caqti-driver-mariadb" {= "2.1.1"}
"caqti-lwt" {= "2.1.1"}
"cmdliner" {= "1.3.0"}
Expand All @@ -49,9 +49,9 @@ depends: [
"conf-mariadb" {= "2"}
"conf-pkg-config" {= "3"}
"conformist" {= "0.8.1"}
"containers" {= "3.13.1"}
"containers-data" {= "3.13.1"}
"cppo" {= "1.7.0"}
"containers" {= "3.14"}
"containers-data" {= "3.14"}
"cppo" {= "1.6.9"}
"csexp" {= "1.5.2"}
"cstruct" {= "6.2.0"}
"ctypes" {= "0.20.2"}
Expand Down Expand Up @@ -148,7 +148,7 @@ depends: [
"ppxlib" {= "0.33.0"}
"prettym" {= "0.0.3"}
"ptime" {= "1.1.0"}
"re" {= "1.12.0"}
"re" {= "1.11.0"}
"result" {= "1.5"}
"rock" {= "0.20.0"}
"rosetta" {= "0.3.0"}
Expand Down
3 changes: 1 addition & 2 deletions pool/test/filter_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,6 @@ let filter_by_date_custom_field _ () =

let filter_by_tags _ () =
let open Utils.Lwt_result.Infix in
let open CCFun in
let open Tags in
let open Operator.ListM in
let open Alcotest in
Expand Down Expand Up @@ -1289,7 +1288,7 @@ let filter_by_tags _ () =
find (Some filter)
||> get_exn
||> CCList.filter
(flip
(CCFun.flip
(CCList.mem ~eq:Contact.equal)
[ contact_one; contact_two; contact_three ])
||> CCList.stable_sort Contact.compare
Expand Down
17 changes: 10 additions & 7 deletions pool/test/waiting_list_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ module PendingWaitingLists = struct
Experiment.find_pending_waitinglists_by_contact
Test_utils.Data.database_label
contact
||> CCList.find_opt (Experiment.Public.equal experiment)
%> CCOption.is_some
|> Lwt.map
(CCList.find_opt (Experiment.Public.equal experiment)
%> CCOption.is_some)
in
let () = Alcotest.(check bool "succeeds" true res) in
Lwt.return_unit
Expand All @@ -141,9 +142,10 @@ module PendingWaitingLists = struct
find_pending_waitinglists_by_contact
Test_utils.Data.database_label
contact
||> CCList.find_opt (fun public ->
Id.equal (Public.id public) experiment_id)
%> CCOption.is_none
|> Lwt.map
(CCList.find_opt (fun public ->
Id.equal (Public.id public) experiment_id)
%> CCOption.is_none)
in
let () = Alcotest.(check bool "succeeds" true res) in
Lwt.return_unit
Expand All @@ -168,8 +170,9 @@ module PendingWaitingLists = struct
Experiment.find_pending_waitinglists_by_contact
Test_utils.Data.database_label
contact
||> CCList.find_opt (Experiment.Public.equal experiment)
%> CCOption.is_some
|> Lwt.map
(CCList.find_opt (Experiment.Public.equal experiment)
%> CCOption.is_some)
in
let () = Alcotest.(check bool "succeeds" true res) in
Lwt.return_unit
Expand Down
9 changes: 5 additions & 4 deletions pool/web/handler/root_status.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ let yojson_response ?status json =
;;

let show _ =
let open CCFun in
let%lwt result =
let open Schedule in
let create_entry ?database_label label value =
( CCOption.map_or
~default:label
(Database.Label.value %> Format.asprintf "%s [%s]" label)
CCFun.(Database.Label.value %> Format.asprintf "%s [%s]" label)
database_label
, value )
in
Expand Down Expand Up @@ -59,9 +58,11 @@ let show _ =
CCString.mem ~sub (Schedule.Label.value label)
in
if contains_label then Some (is_ok schedule) else None)
|> CCList.for_all id
|> CCList.for_all CCFun.id
in
let is_ok schedules =
schedules |> CCList.map is_ok |> CCList.for_all CCFun.id
in
let is_ok = CCList.(map is_ok %> for_all id) in
let list_schedules =
schedules
|> CCList.map (fun ({ label; last_run; _ } : public) ->
Expand Down
7 changes: 4 additions & 3 deletions pool/web/handler/root_tenant.ml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ let create_operator req =
Lwt_result.map_error (fun err ->
err, Format.asprintf "%s/operator" redirect_path)
@@
let open CCFun in
let tags = Pool_context.Logger.Tags.req req in
let* tenant_db =
Pool_tenant.(find_full tenant_id >|+ Write.database_label)
Expand All @@ -123,8 +122,10 @@ let create_operator req =
>>= handle ~roles:[ `Operator, None ] ~tags
|> Lwt_result.lift
in
let handle =
Lwt_list.iter_s (Pool_event.handle_event ~tags tenant_db) %> Lwt_result.ok
let handle events =
events
|> Lwt_list.iter_s (Pool_event.handle_event ~tags tenant_db)
|> Lwt_result.ok
in
let return_to_overview () =
Http_utils.redirect_to_with_actions
Expand Down