@@ -28,6 +28,7 @@ import { expectDefined } from "@openclaw/normalization-core";
2828import { afterAll , afterEach , beforeAll , describe , expect , it } from "vitest" ;
2929import { useAutoCleanupTempDirTracker } from "../helpers/temp-dir.js" ;
3030import { validReview , writeReviewArtifacts } from "./pr-review-artifact-fixture.js" ;
31+ import { copyPrWrapperFixture } from "./pr-wrapper-fixture.js" ;
3132
3233const tempDirs = useAutoCleanupTempDirTracker ( afterEach ) ;
3334const freshMainTemplateDirs = useAutoCleanupTempDirTracker ( afterAll ) ;
@@ -230,45 +231,7 @@ function writeEscapedPipeHolderLauncher(repoDir: string, pidFile: string) {
230231}
231232
232233function installPrCliFixture ( repoDir : string , env ?: NodeJS . ProcessEnv ) {
233- const files = [
234- "scripts/pr" ,
235- "scripts/watch-pr-ci.mjs" ,
236- "scripts/watch-pr-ci.mts" ,
237- "scripts/verify-pr-hosted-gates.mjs" ,
238- "scripts/verify-pr-hosted-gates.mts" ,
239- "scripts/lib/plain-gh.sh" ,
240- "scripts/lib/plain-gh.mjs" ,
241- "scripts/lib/direct-run.mjs" ,
242- "scripts/lib/record-shared.mjs" ,
243- "scripts/lib/tsx-cli-shim.mjs" ,
244- "scripts/lib/local-check-runtime.mts" ,
245- "scripts/tsx.mjs" ,
246- "scripts/pr-lib/worktree.sh" ,
247- "scripts/pr-lib/operation-lock.sh" ,
248- "scripts/pr-lib/process-group-runner.mjs" ,
249- "scripts/pr-lib/common.sh" ,
250- "scripts/pr-lib/changelog.sh" ,
251- "scripts/pr-lib/gates.sh" ,
252- "scripts/pr-lib/ci-dispatch.mjs" ,
253- "scripts/pr-lib/crabbox-gate-contract.mjs" ,
254- "scripts/pr-lib/crabbox-gate-plan.mts" ,
255- "scripts/pr-lib/crabbox-merge-bypass.mjs" ,
256- "scripts/pr-lib/crabbox-merge-bypass.sh" ,
257- "scripts/pr-lib/push.sh" ,
258- "scripts/pr-lib/review.sh" ,
259- "scripts/pr-lib/review-artifacts.mjs" ,
260- "scripts/pr-lib/prepare-core.sh" ,
261- "scripts/pr-lib/merge.sh" ,
262- "scripts/pr-lib/merge-outcome.sh" ,
263- "scripts/crabbox-untrusted-bootstrap.sh" ,
264- "scripts/pr-crabbox-gate-publisher.mjs" ,
265- ".github/workflows/pr-crabbox-gate-publisher.yml" ,
266- ] ;
267- for ( const file of files ) {
268- const target = join ( repoDir , file ) ;
269- mkdirSync ( dirname ( target ) , { recursive : true } ) ;
270- cpSync ( join ( repoRoot , file ) , target ) ;
271- }
234+ copyPrWrapperFixture ( repoDir ) ;
272235 const cli = join ( repoDir , "scripts/pr" ) ;
273236 chmodSync ( cli , 0o755 ) ;
274237 const binDir = join ( repoDir , "isolated-bin" ) ;
@@ -334,7 +297,7 @@ function createFreshMainTemplate() {
334297 join ( repoDir , ".git/info/exclude" ) ,
335298 "/.local/\n/.worktrees/\n/isolated-bin/\n/fixture-state/\n" ,
336299 ) ;
337- git ( "add" , "scripts" , ".github" ) ;
300+ git ( "add" , "scripts" , ".github" , "packages" ) ;
338301 git ( "commit" , "-qm" , "test: unmodified public PR wrapper fixture" ) ;
339302 const cachedMain = git ( "rev-parse" , "HEAD" ) ;
340303 const canonicalTree = git ( "rev-parse" , "HEAD^{tree}" ) ;
@@ -1811,7 +1774,7 @@ describePosix("scripts/pr per-PR operation lock", () => {
18111774 "validate_review_artifact_data() { :; }\n" +
18121775 "merge_verify() { MERGE_USE_CRABBOX_ADMIN_BYPASS=false; mark_pr_operation_side_effects_started; }\n" ,
18131776 ) ;
1814- git ( "add" , "scripts" , ".github" ) ;
1777+ git ( "add" , "scripts" , ".github" , "packages" ) ;
18151778 git ( "commit" , "-qm" , "test: native cleanup fixture" ) ;
18161779 const preparedHead = git ( "rev-parse" , "HEAD" ) ;
18171780 const origin = tempDirs . make ( "openclaw-pr-cleanup-origin-" ) ;
0 commit comments