Skip to content

Commit b5389b5

Browse files
committed
fix(ci): reduce ClawSweeper dispatch pressure
1 parent b5fc951 commit b5389b5

6 files changed

Lines changed: 59 additions & 6 deletions

File tree

.github/workflows/clawsweeper-dispatch.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,27 @@ jobs:
8181
repositories: clawsweeper
8282
permission-contents: write
8383

84+
- name: Pre-filter ClawSweeper comment
85+
id: comment_filter
86+
if: ${{ github.event_name == 'issue_comment' }}
87+
env:
88+
COMMENT_BODY: ${{ github.event.comment.body }}
89+
run: |
90+
set -euo pipefail
91+
if grep -Eiq '(^|[[:space:]])@(clawsweeper|openclaw-clawsweeper)\b(\[bot\])?|(^|[[:space:]])/(clawsweeper|review|autoclose|auto([[:space:]]+|-)?merge)\b' <<< "$COMMENT_BODY"; then
92+
echo "is_command=true" >> "$GITHUB_OUTPUT"
93+
else
94+
echo "is_command=false" >> "$GITHUB_OUTPUT"
95+
fi
96+
8497
- name: Create target comment token
8598
id: target_token
86-
if: ${{ github.event_name == 'issue_comment' && env.HAS_CLAWSWEEPER_APP_PRIVATE_KEY == 'true' }}
99+
if: >-
100+
${{
101+
github.event_name == 'issue_comment' &&
102+
steps.comment_filter.outputs.is_command == 'true' &&
103+
env.HAS_CLAWSWEEPER_APP_PRIVATE_KEY == 'true'
104+
}}
87105
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
88106
with:
89107
client-id: ${{ env.CLAWSWEEPER_APP_CLIENT_ID }}
@@ -213,7 +231,11 @@ jobs:
213231
fi
214232
215233
- name: Acknowledge and dispatch ClawSweeper comment
216-
if: ${{ github.event_name == 'issue_comment' }}
234+
if: >-
235+
${{
236+
github.event_name == 'issue_comment' &&
237+
steps.comment_filter.outputs.is_command == 'true'
238+
}}
217239
env:
218240
DISPATCH_TOKEN: ${{ steps.token.outputs.token }}
219241
TARGET_TOKEN: ${{ steps.target_token.outputs.token }}
@@ -232,10 +254,6 @@ jobs:
232254
. "$RUNNER_TEMP/github-api-backoff.sh"
233255
body_file="$RUNNER_TEMP/clawsweeper-comment-body.txt"
234256
printf '%s\n' "$COMMENT_BODY" > "$body_file"
235-
if ! grep -Eiq '(^|[[:space:]])@(clawsweeper|openclaw-clawsweeper)\b(\[bot\])?|(^|[[:space:]])/(clawsweeper|review|automerge|autoclose)\b' "$body_file"; then
236-
echo "No ClawSweeper command found in comment."
237-
exit 0
238-
fi
239257
if [ -n "$TARGET_TOKEN" ]; then
240258
err="$(mktemp)"
241259
if GH_TOKEN="$TARGET_TOKEN" gh_api_with_retry -X POST \

scripts/lib/windows-taskkill.d.mts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export function resolveWindowsTaskkillPath(env?: NodeJS.ProcessEnv): string;
2+
export function resolveWindowsSystem32Path(
3+
executableName: string,
4+
env?: NodeJS.ProcessEnv,
5+
): string;
6+
export function resolveWindowsPowerShellPath(env?: NodeJS.ProcessEnv): string;

scripts/test-projects.test-support.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,10 @@ const TOOLING_SOURCE_TEST_TARGETS = new Map([
10931093
"scripts/lib/windows-taskkill.mjs",
10941094
["test/scripts/managed-child-process.test.ts", "test/scripts/run-with-env.test.ts"],
10951095
],
1096+
[
1097+
"scripts/lib/windows-taskkill.d.mts",
1098+
["test/scripts/managed-child-process.test.ts", "test/scripts/run-with-env.test.ts"],
1099+
],
10961100
[
10971101
"scripts/lib/local-build-metadata.mjs",
10981102
[

src/scripts/test-projects.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,12 +881,22 @@ describe("test-projects args", () => {
881881
"test/scripts/android-pin-version.test.ts",
882882
"test/scripts/bench-cli-startup.test.ts",
883883
"test/scripts/check-package-dist-imports.test.ts",
884+
"test/scripts/clawhub-fixture-server.test.ts",
885+
"test/scripts/codex-install-assertions.test.ts",
886+
"test/scripts/config-reload-mutate-metadata.test.ts",
884887
"test/scripts/control-ui-i18n.test.ts",
888+
"test/scripts/doctor-install-switch-wrapper.test.ts",
889+
"test/scripts/e2e-text-file-utils.test.ts",
890+
"test/scripts/fixture-common.test.ts",
891+
"test/scripts/fixture-plugin-commands.test.ts",
892+
"test/scripts/incremental-line-reader.test.ts",
885893
"test/scripts/ios-configure-signing.test.ts",
886894
"test/scripts/ios-pin-version.test.ts",
887895
"test/scripts/ios-team-id.test.ts",
888896
"test/scripts/ios-version.test.ts",
889897
"test/scripts/kitchen-sink-rpc-walk.test.ts",
898+
"test/scripts/onboard-config-fixtures.test.ts",
899+
"test/scripts/parallels-lib-helpers.test.ts",
890900
"test/scripts/parallels-smoke-model.test.ts",
891901
"test/scripts/plugins-assertions.test.ts",
892902
"test/scripts/prepare-extension-package-boundary-artifacts.test.ts",

test/scripts/ci-node-test-plan.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ describe("scripts/lib/ci-node-test-plan.mjs", () => {
317317
runner: "blacksmith-4vcpu-ubuntu-2404",
318318
shardName: "core-runtime-infra-heartbeat-runner",
319319
},
320+
{
321+
configs: ["test/vitest/vitest.infra.config.ts"],
322+
requiresDist: false,
323+
runner: "blacksmith-4vcpu-ubuntu-2404",
324+
shardName: "core-runtime-infra-misc",
325+
},
320326
{
321327
configs: ["test/vitest/vitest.infra.config.ts"],
322328
requiresDist: false,
@@ -473,6 +479,7 @@ describe("scripts/lib/ci-node-test-plan.mjs", () => {
473479
"core-runtime-infra-gateway-watch",
474480
"core-runtime-infra-heartbeat-core",
475481
"core-runtime-infra-heartbeat-runner",
482+
"core-runtime-infra-misc",
476483
"core-runtime-infra-misc-dedupe-disk",
477484
"core-runtime-infra-misc-os",
478485
"core-runtime-infra-misc-values",

test/scripts/test-projects.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,14 @@ describe("scripts/test-projects changed-target routing", () => {
15591559
["test/scripts/local-heavy-check-runtime.test.ts"],
15601560
],
15611561
["scripts/lib/managed-child-process.mjs", ["test/scripts/managed-child-process.test.ts"]],
1562+
[
1563+
"scripts/lib/windows-taskkill.mjs",
1564+
["test/scripts/managed-child-process.test.ts", "test/scripts/run-with-env.test.ts"],
1565+
],
1566+
[
1567+
"scripts/lib/windows-taskkill.d.mts",
1568+
["test/scripts/managed-child-process.test.ts", "test/scripts/run-with-env.test.ts"],
1569+
],
15621570
["scripts/lib/source-file-scan-cache.mjs", ["test/scripts/source-file-scan-cache.test.ts"]],
15631571
["scripts/lib/dev-tooling-safety.ts", ["test/scripts/dev-tooling-safety.test.ts"]],
15641572
[

0 commit comments

Comments
 (0)