Skip to content

Commit 5824333

Browse files
committed
fix bug in context where make didn't generate a fresh state
1 parent 59a0e9d commit 5824333

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/context.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ type t = {
1515
state : State_t.state;
1616
}
1717

18-
let default : t =
18+
let default () : t =
1919
{
2020
config_filename = "monorobot.json";
2121
secrets_filepath = "secrets.json";
2222
state_filepath = None;
2323
secrets = None;
2424
config = None;
25-
state = State.empty;
25+
state = State.empty ();
2626
}
2727

2828
let make ?config_filename ?secrets_filepath ?state_filepath () =
29+
let default = default () in
2930
let config_filename = Option.value config_filename ~default:default.config_filename in
3031
let secrets_filepath = Option.value secrets_filepath ~default:default.secrets_filepath in
3132
{ default with config_filename; secrets_filepath; state_filepath }

lib/state.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ open Base
22
open Common
33
open Devkit
44

5-
let empty : State_t.state = { pipeline_statuses = StringMap.empty; slack_access_token = None }
5+
let empty () : State_t.state = { pipeline_statuses = StringMap.empty; slack_access_token = None }
66

77
let refresh_pipeline_status (state : State_t.state) ~pipeline ~(branches : Github_t.branch list) ~status =
88
let update_pipeline_status branch_statuses =

0 commit comments

Comments
 (0)