aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-12-13 11:50:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-12-13 11:50:01 +0200
commit1bebf4e3e341c5624ffcd7d04584eaeacdef284a (patch)
treea8553d765d2c204a742a0ad45c6c985b3b42871f
parent4108a65af34829c5dd7e350ca1058eb4e0e4eee4 (diff)
-rw-r--r--INSTALL-GITHUB-DEV1
-rw-r--r--mod/mod-ci-github-gh.cxx2
-rw-r--r--mod/mod-ci-github.cxx7
3 files changed, 9 insertions, 1 deletions
diff --git a/INSTALL-GITHUB-DEV b/INSTALL-GITHUB-DEV
index 716ed28..c28ce06 100644
--- a/INSTALL-GITHUB-DEV
+++ b/INSTALL-GITHUB-DEV
@@ -132,6 +132,7 @@ aspects but can't redeliver webhooks.
- Failure (also observe check run state transitions).
- Re-requested check suite.
- Re-requested check run.
+ - Cancel previous check suite on forced push.
- Pull request (PR).
diff --git a/mod/mod-ci-github-gh.cxx b/mod/mod-ci-github-gh.cxx
index 70155ad..413c224 100644
--- a/mod/mod-ci-github-gh.cxx
+++ b/mod/mod-ci-github-gh.cxx
@@ -630,6 +630,8 @@ namespace brep
return p.name () == s ? (v = true) : false;
};
+ // @@ What is `before` on first push?
+ //
if (c (ac, "action")) action = p.next_expect_string ();
else if (c (pr, "pull_request")) pull_request = gh_pull_request (p);
else if (c (bf, "before")) before = p.next_expect_string ();
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx
index 0f9a926..854ce7e 100644
--- a/mod/mod-ci-github.cxx
+++ b/mod/mod-ci-github.cxx
@@ -1509,11 +1509,16 @@ namespace brep
//
string sid (ps.repository.node_id + ':' + ps.before);
+ // Note that it's possible this commit still exists in another branch so
+ // we do refcount-aware cancel.
+ //
if (optional<tenant_service> ts = cancel (error, warn,
verb_ ? &trace : nullptr,
*build_db_, retry_,
- "ci-github", sid))
+ "ci-github", sid)) // @@ refcount
{
+ // @@ Refcount in diag as in other place.
+ //
l3 ([&]{trace << "forced push to " << ps.ref
<< ": canceled CI of previous head commit"
<< " with tenant_service id " << sid;});