Skip to content

test: isolate the route scanner probe in a unique temp directory (carry of #3323) - #3539

Merged
lidge-jun merged 4 commits into
devfrom
codex/260905-carry-3323
Sep 4, 2026
Merged

test: isolate the route scanner probe in a unique temp directory (carry of #3323)#3539
lidge-jun merged 4 commits into
devfrom
codex/260905-carry-3323

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

The route-scanner probe in tests/server/management-route-registry.test.ts wrote its fixture into the repository root; this carry moves it into a unique mktemp-style directory so a parallel run cannot collide or leave a stray file behind. Test-only; no runtime change.

Supersedes #3323 (maintainer carry: GitHub reports the original CONFLICTING after the tests/<domain>/ migration, while git merge-tree is clean; the carry is the PR head merged with origin/dev, no source edits).

Stack (wp1 merge train, independent layers — each targets dev):

# PR Layer Review focus
1 this carry of #3323 this PR's diff only

Unit: devlog/_plan/260905_open_work_closeout/ (010, 011).

Verification

  • bun run typecheck — exit 0 on the carry head.
  • bun test tests/server/management-route-registry.test.ts — tests/server/management-route-registry.test.ts — 13 pass / 0 fail.
  • Original PR CI on 3323's exact head was full-matrix green; exact-head CI on this branch is the merge gate.

Checklist

  • Targets dev
  • Focused regression test present and green
  • Original author credited via Co-authored-by trailer

Co-authored-by: luvs01 27862058+luvs01@users.noreply.github.com

Summary by CodeRabbit

  • Tests
    • Improved scanner-probe test isolation by using a temporary directory.
    • Ensured temporary test files and directories are cleaned up automatically after execution.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 4, 2026 22:39
@lidge-jun lidge-jun added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 9ca89bce-1c8e-4956-a2af-4d720eed6747

📥 Commits

Reviewing files that changed from the base of the PR and between 980a9fb and cc599fb.

📒 Files selected for processing (1)
  • tests/server/management-route-registry.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The scanner-probe test now creates its probe under an OS temporary directory. It writes the probe inside try and recursively removes the temporary directory in finally.

Changes

Scanner probe isolation

Layer / File(s) Summary
Temporary probe lifecycle
tests/server/management-route-registry.test.ts
Lines 2–3 add static filesystem and OS temporary-directory imports. Lines 127–128 create a temporary directory with mkdtempSync. Lines 139–145 write the probe inside try and recursively remove the directory with rmSync in finally.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to cc599

Scanner-probe tests now avoid repository-root collisions and clean up temporary files on success or failure, with no runtime behavior changes or remaining merge-readiness risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main test change: isolating the route scanner probe in a unique temporary directory. The test: prefix and carry reference do not obscure the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260905-carry-3323

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 63 / 80

설명

지금 dev HEAD(980a9fbed, #3537 Astra/Fast 가격 정렬 직후)의 tests/server/management-route-registry.test.ts 안에는, 스캐너가 메서드를 못 풀면 GET으로 몰아넣지 않고 실패를 드러내는지 확인하는 테스트가 있습니다. 그 테스트는 프로브 파일을 저장소 루트에 .tmp-scanner-probe.ts 라는 고정 이름으로 씁니다. 한 프로세스만 돌릴 때는 괜찮아 보이지만, 같은 체크아웃을 여러 테스트가 동시에 건드리면 서로 덮어쓰거나, 중간에 죽으면 루트에 찌꺼기 파일이 남을 수 있습니다. 런타임 제품 코드가 아니라 테스트만의 문제이지만, CI 병렬과 로컬 재실행에서 간헐 실패·오염을 만들 수 있는 자리입니다.

이 PR(#3539)은 그 프로브를 os.tmpdir() 아래 mkdtempSync로 만든 고유 폴더(ocx-route-scanner-*) 안으로 옮깁니다. 쓰기(writeFileSync)도 try 안으로 넣고, finally에서 폴더 전체를 rmSync(..., { recursive: true, force: true })로 지웁니다. 원본 #3323(luvs01)이 tests/<domain>/ 배치 이후 GitHub 기준으로 CONFLICTING으로 보이지만 git merge-tree는 깨끗한 상태라, 메인테이너가 현재 dev 위에 캐리한 것입니다. 소스 의도는 원본과 같고, Co-authored-by로 원작자를 남겼습니다. 파일 한 개·+/- 합 10줄 수준이고, MANAGEMENT_ROUTES / scanRoutes 제품 경로에는 손대지 않습니다.

지금 dev가 밀어가는 축(카탈로그·Astra/Fast 가격·릴리스 2.43.0)과는 직교합니다. 대신 테스트 격리·병렬 안전은 매트릭스 CI가 계속 커질수록 싸게 고치는 편이 이득입니다. PR 본문 기준 해당 파일 13 pass / typecheck 통과, 원본 헤드 매트릭스는 이미 초록이었고, 이 캐리 브랜치의 exact-head CI가 머지 게이트입니다. 작성 시점에는 매트릭스 일부가 아직 pending입니다.

원본 #3323은 아직 OPEN+CONFLICTING입니다. 이 캐리가 머지되면 남은 원본 PR은 Landed via #3539 at <commit> 코멘트 + landed-via-maintainer 라벨 후 completed/superseded로 닫는 기존 규칙이 맞습니다. types.ts/config.ts 스플릿에 무효화되는 종류도 아니고, 중복 기능 PR도 아닙니다.

정리하면, 제품 동작은 그대로 두고 테스트 픽스처만 OS 임시 디렉터리로 격리하는 작은 캐리입니다. 현재 HEAD의 고정 루트 경로 프로브를 없애는 방향이 맞고, 스택도 wp1 단독이라 다른 캐리(#3484/#3515/#3525 계열)와 얽히지 않습니다.

라인 127 - mkdtempSynctry 밖입니다. 지금 구조에서는 바로 이어서 try로 들어가서 안전하지만, 나중에 그 사이에 코드를 끼우다 예외가 나면 빈 임시 폴더가 남을 수 있습니다.
라인 136-146 - 쓰기 실패·스캔 예외 모두 finally에서 폴더 단위로 지우도록 바뀌어, 예전 파일 단위 rmSync보다 누수에 강합니다. 이 부분은 문제라기보다 원본 2번째 커밋 의도가 잘 실린 지점입니다.
경로 tests/server/management-route-registry.test.ts - 런타임 src/server/management/route-registry 나 스캐너 헬퍼 구현은 그대로입니다. 회귀는 이 파일의 fail-loud 프로브 한 케이스에 집중하면 됩니다.
경로 #3323 - GitHub mergeable=CONFLICTING인 원본이 열려 있어, 이 PR만 머지하고 원본을 안 닫으면 열린 PR 수가 부풀어 보입니다.
경로 CI - exact-head 매트릭스가 아직 pending이라, 초록 확인 전 강제 머지는 게이트 취지와 어긋납니다.

메인테이너의 판단이 필요한 지점

너의 추천

CI 매트릭스(특히 test shards + windows) 초록 확인 후 #3539를 단독 머지하세요. 머지 커밋 SHA로 원본 #3323에 Landed via #3539 at <sha> 코멘트를 남기고 landed-via-maintainer를 붙여 superseded/completed로 닫으세요. 추가 코드 수정은 필요 없고, types/config 스플릿 무효화도 아닙니다.

이 댓글은 grok-bot이 작성했습니다

@Ingwannu Ingwannu left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head cc599fb7923894aac1d67244a2f3700a6fb7bc44. The carry preserves the original test-only fix at the current domain path: probe creation is unique, the write is inside the protected block, and recursive cleanup runs on both success and failure. No runtime file changes.

Cross-platform CI run 33926417463 and the exact-head CodeRabbit review are green. The remaining pending target-check duplicate has an already-successful exact-head counterpart and the PR visibly targets dev. Approved.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer admin merge (ruleset bypass recorded per MAINTAINERS.md): carry of #3323, exact-head CI green on cc599fb (25 pass / 3 skipped / 0 fail). wp1 step 1 of the 260905 open-work closeout.

@lidge-jun
lidge-jun merged commit 32e0597 into dev Sep 4, 2026
34 of 35 checks passed
@lidge-jun
lidge-jun deleted the codex/260905-carry-3323 branch September 4, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants