Skip to content

Commit

Permalink
fix bug in context where make didn't generate a fresh state
Browse files Browse the repository at this point in the history
  • Loading branch information
yasunariw committed Dec 31, 2020
1 parent 59a0e9d commit 5824333
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ type t = {
state : State_t.state;
}

let default : t =
let default () : t =
{
config_filename = "monorobot.json";
secrets_filepath = "secrets.json";
state_filepath = None;
secrets = None;
config = None;
state = State.empty;
state = State.empty ();
}

let make ?config_filename ?secrets_filepath ?state_filepath () =
let default = default () in
let config_filename = Option.value config_filename ~default:default.config_filename in
let secrets_filepath = Option.value secrets_filepath ~default:default.secrets_filepath in
{ default with config_filename; secrets_filepath; state_filepath }
Expand Down
2 changes: 1 addition & 1 deletion lib/state.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ open Base
open Common
open Devkit

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

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

0 comments on commit 5824333

Please sign in to comment.