aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-service-data.cxx
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-04-22 14:26:00 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-10-15 09:05:28 +0200
commit3a90fa9652ceab08e1f424ca7e1ab3b08eb1df18 (patch)
tree6d4f179baef932c1f90402662238d79aacac05a6 /mod/mod-ci-github-service-data.cxx
parentb3fa1468a7988349eeb90c63a4e375ba76116c04 (diff)
Add service data flag state_synced
Diffstat (limited to 'mod/mod-ci-github-service-data.cxx')
-rw-r--r--mod/mod-ci-github-service-data.cxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/mod/mod-ci-github-service-data.cxx b/mod/mod-ci-github-service-data.cxx
index e519936..f79550c 100644
--- a/mod/mod-ci-github-service-data.cxx
+++ b/mod/mod-ci-github-service-data.cxx
@@ -51,14 +51,10 @@ namespace brep
nid = *v;
}
- optional<build_state> s;
- {
- string* v (p.next_expect_member_string_null ("state"));
- if (v != nullptr)
- s = to_build_state (*v);
- }
+ build_state s (to_build_state (p.next_expect_member_string ("state")));
+ bool ss (p.next_expect_member_boolean<bool> ("state_synced"));
- check_runs.emplace_back (move (bid), move (nid), s);
+ check_runs.emplace_back (move (bid), move (nid), s, ss);
p.next_expect (event::end_object);
}
@@ -112,11 +108,8 @@ namespace brep
else
s.value (nullptr);
- s.member_name ("state");
- if (cr.state)
- s.value (to_string (*cr.state));
- else
- s.value (nullptr);
+ s.member ("state", to_string (cr.state));
+ s.member ("state_synced", cr.state_synced);
s.end_object ();
}
@@ -143,7 +136,7 @@ namespace brep
{
os << "node_id: " << cr.node_id.value_or ("null")
<< ", build_id: " << cr.build_id
- << ", state: " << (cr.state ? to_string (*cr.state) : "null");
+ << ", state: " << cr.state_string ();
return os;
}