Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

docs(ci): clarify eligibility checks during GitHub outages

Tin77dd9b6c7e5f
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1b9c9101a..c33a65f05 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -106,10 +106,13 @@ To turn on enforcement once this workflow is on `main`:
commit, and that's the one to require.
The automation only reads code and policy from `main`, relies on GitHub's own
-issue links, and never runs anything from the PR. If the policy file is broken
-or the GitHub API errors out, the check fails instead of letting the PR
-through. Revoking a voucher, removing the label, or closing the issue all
-trigger a recheck of open PRs.
+issue links, and never runs anything from the PR. Once it lists the open PRs
+and publishes pending checks, a broken policy or an eligibility lookup error
+fails the affected checks. If GitHub cannot list PRs or accept check updates,
+the workflow fails but earlier check results can remain unchanged, including
+successful ones. Maintainers must inspect failed workflow runs and rerun them
+after GitHub recovers before relying on those results. Revoking a voucher,
+removing the label, or closing the issue all trigger a recheck of open PRs.
### The Process
diff --git a/scripts/contribution-eligibility/check.test.mjs b/scripts/contribution-eligibility/check.test.mjs
index 46cd6a4b6..f87aa6f71 100644
--- a/scripts/contribution-eligibility/check.test.mjs
+++ b/scripts/contribution-eligibility/check.test.mjs
@@ -34,6 +34,9 @@ function fixture(options = {}) {
let data;
let status = 200;
if (path.includes("/check-runs")) {
+ if (options.publicationStatus) {
+ return Response.json({}, { status: options.publicationStatus });
+ }
const id =
init.method === "POST"
? checks.size + 1
@@ -52,6 +55,7 @@ function fixture(options = {}) {
checks.set(id, entry);
data = { id };
} else if (path === "/repos/test/repo/pulls") {
+ status = options.listStatus ?? 200;
data = options.pullPages
? options.pullPages[Number(parsed.searchParams.get("page")) - 1]
: pulls;
@@ -174,7 +178,7 @@ test("repository maintainers and explicit automation can omit issues", async ()
assert.equal(bot.statuses.at(-1).state, "failure");
});
-test("API and policy errors replace an earlier successful status with error", async () => {
+test("eligibility lookup and policy errors publish failing checks", async () => {
for (const options of [
{ permissionStatus: 403 },
{ permissionStatus: 500 },
@@ -203,6 +207,32 @@ test("API and policy errors replace an earlier successful status with error", as
}
});
+test("discovery and publication outages preserve prior success until a rerun", async () => {
+ for (const failure of ["listStatus", "publicationStatus"]) {
+ const options = {};
+ const { github, statuses } = fixture(options);
+ await reconcile(github, async () => policy);
+ assert.equal(statuses.at(-1).state, "success");
+ const published = statuses.length;
+
+ options.issue = { ...issue, labels: [] };
+ options[failure] = 503;
+ await assert.rejects(
+ reconcile(github, async () => policy),
+ /503/,
+ );
+ assert.equal(statuses.length, published);
+ assert.equal(statuses.at(-1).state, "success");
+
+ delete options[failure];
+ await reconcile(github, async () => policy);
+ assert.deepEqual(
+ statuses.slice(published).map((status) => status.state),
+ ["pending", "failure"],
+ );
+ }
+});
+
test("a changed head, body or target cannot receive a stale success", async () => {
for (const current of [
{ head: { sha: "b".repeat(40) } },