diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2025-02-12 16:04:55 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2025-02-13 08:30:17 +0200 |
commit | 532de380a91b7dd63cef836d8e3ea6d514ec185b (patch) | |
tree | 10e22e5c416df6d762a6f0f9ad22d66d6995e92c | |
parent | 0970142f53a0d42a2b8901411008d45c0a42900c (diff) |
Post-review changes
-rw-r--r-- | mod/mod-ci-github-gq.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/mod/mod-ci-github-gq.cxx b/mod/mod-ci-github-gq.cxx index 2a9129e..99c04f4 100644 --- a/mod/mod-ci-github-gq.cxx +++ b/mod/mod-ci-github-gq.cxx @@ -255,11 +255,23 @@ namespace brep << " filterBy: {appId: " << gq_int (ai) << "}) {" << '\n' << " edges { node {" << '\n'; - // Get the check suite's last N check runs. Note that the selection set - // (fields to be returned) must match that of the check run mutations - // (create/update) generated by gq_mutation_{create,update}_check_runs(). + // Get the check suite's last N check runs (last:). // - os << " checkRuns(last: " << gq_int (cn) << ") {" << '\n' + // Filter by App id because apparently an App can create check runs in + // another App's check suite. + // + // Also ask for the latest check runs only (checkType: LATEST) otherwise + // we could receive multiple check runs with the same name. Although this + // appears to be the default it's not documented anywhere so best make it + // explicit. + // + // Note that the selection set (fields to be returned) must match that of + // the check run mutations (create/update) generated by + // gq_mutation_{create,update}_check_runs(). + // + os << " checkRuns(last: " << gq_int (cn) << '\n' + << " filterBy: {appId: " << gq_int (ai) << '\n' + << " checkType: LATEST}) {" << '\n' << " edges { node { node_id: id name status } }" << '\n' << " }" /* checkRuns */ << '\n' << " } }" /* node, edges */ << '\n' @@ -483,7 +495,8 @@ namespace brep const check_run& cr (crs[i]); const gh_check_run& gcr (rs1.check_runs[i]); - if (cr.name != gcr.name || cr.state != gcr.status) + if (cr.name != gcr.name || + cr.state != gh_from_status (gcr.status)) break; } |