Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: scope CI fail-fast to pull requests (#5519)

[._.]/ Adam Eivyec900f534843
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a20b2fd40d..1a4ea72fc1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -256,7 +256,7 @@ jobs:
run: npm run smoke
- name: Cancel sibling CI jobs after failure
- if: failure()
+ if: failure() && github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/cancel-current-ci-run.js
@@ -321,7 +321,7 @@ jobs:
run: npm run build --prefix client
- name: Cancel sibling CI jobs after failure
- if: failure()
+ if: failure() && github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/cancel-current-ci-run.js
@@ -464,7 +464,7 @@ jobs:
PGDATABASE: portos_test
- name: Cancel sibling CI jobs after failure
- if: failure()
+ if: failure() && github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/cancel-current-ci-run.js
@@ -591,7 +591,7 @@ jobs:
run: node scripts/run-ci-tests.js server
- name: Cancel sibling CI jobs after failure
- if: failure()
+ if: failure() && github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node scripts/cancel-current-ci-run.js
diff --git a/docs/GITHUB_ACTIONS.md b/docs/GITHUB_ACTIONS.md
index 91711d4fdf..18ffd8b4c0 100644
--- a/docs/GITHUB_ACTIONS.md
+++ b/docs/GITHUB_ACTIONS.md
@@ -263,8 +263,12 @@ Changes to CI/test configuration also force the full suite on their own PR.
### Fail-fast sibling cancellation
Each selected leaf job (`server`, `client`, `database`, and
-`windows-server`) ends with an `if: failure()` step that asks GitHub to cancel
-the current workflow run. The request uses the repository-owned
+`windows-server`) ends with an `if: failure() && github.event_name ==
+'pull_request'` step that asks GitHub to cancel the current pull-request
+workflow run. The event guard is important because the same workflow is reused
+by the release workflow: a failing reusable `full-ci` job must not cancel its
+parent release run before that workflow can report the release failure. The
+request uses the repository-owned
`scripts/cancel-current-ci-run.js` helper and the standard workflow-run cancel
endpoint. The helper accepts no repository or run arguments: it validates and
uses only `GITHUB_REPOSITORY` and `GITHUB_RUN_ID` supplied by Actions, with the
@@ -281,11 +285,17 @@ Cancellation is deliberately best-effort. Fork pull requests and other
read-only-token runs may receive a permission failure, and transient API or
network failures are also possible. The helper logs the unavailable
cancellation and exits normally, preserving the original failed step and its
-failed job result. `CI Gate` still allows only `success` or `skipped` results;
-failed or canceled leaf jobs therefore cannot satisfy the required aggregate
-context. The target is for siblings to become canceled within 30 seconds of
-the first failing job completing, while the existing workflow-level
-concurrency cancellation continues to handle newer runs independently.
+failed job result when the API is unavailable. When cancellation succeeds, the
+run-wide cancellation can mark the requesting job and `CI Gate` as canceled;
+the failed step's log and annotations remain the diagnostic evidence, and a
+canceled result is still non-mergeable. `CI Gate` allows only `success` or
+`skipped` results; failed or canceled leaf jobs therefore cannot satisfy the
+required aggregate context. The target is for siblings to become canceled
+within 30 seconds of the first failing job completing, while the existing
+workflow-level concurrency cancellation continues to handle newer runs
+independently. Scheduled, manually dispatched, and release-called runs skip
+this sibling cancellation so their aggregate diagnostics and cache post-steps
+can complete normally.
### Impact-planner safety rules
diff --git a/scripts/ci-fail-fast.test.js b/scripts/ci-fail-fast.test.js
index 56058a692a..490a6cf01a 100644
--- a/scripts/ci-fail-fast.test.js
+++ b/scripts/ci-fail-fast.test.js
@@ -10,7 +10,7 @@ const LEAF_JOBS = ['server', 'client', 'database', 'windows-server'];
const NON_LEAF_JOBS = ['impact', 'gate', 'full-gate'];
const FAIL_FAST_STEP = [
' - name: Cancel sibling CI jobs after failure',
- ' if: failure()',
+ " if: failure() && github.event_name == 'pull_request'",
' env:',
' GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}',
' run: node scripts/cancel-current-ci-run.js',
diff --git a/scripts/pre-install-entrypoints.test.js b/scripts/pre-install-entrypoints.test.js
index c42b3b5eca..654b466ff4 100644
--- a/scripts/pre-install-entrypoints.test.js
+++ b/scripts/pre-install-entrypoints.test.js
@@ -38,8 +38,11 @@ const PRE_INSTALL_ENTRYPOINTS = ['scripts/ci-base-sha.js', 'scripts/ci-test-plan
* module-resolution stack trace instead. Its `pg` import is a dynamic
* `import()` inside the database probe for the same reason, which is why it
* does not show up in this static walk.
+ *
+ * `cancel-current-ci-run.js` is here because it runs from an `if: failure()`
+ * workflow step that may fire before or during a failed dependency install.
*/
-const BARE_CHECKOUT_SCRIPTS = ['scripts/doctor.js'];
+const BARE_CHECKOUT_SCRIPTS = ['scripts/cancel-current-ci-run.js', 'scripts/doctor.js'];
const BUILTINS = new Set(builtinModules);
const isBuiltin = (specifier) => BUILTINS.has(specifier.replace(/^node:/, ''));