preflight key-health probe needs an injected seam (DeployTrainService deps)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
Read DeployTrainService and its preflight dependency definitions, then follow preflightPublish to see how it invokes checkPublishKeyHealth. Update the dependency wiring and the test in tests/unit/deploy-train-service.test.ts to inject a fake probe. Done means that test makes no outbound requests, no suite module-mocks the probe, and production preflight still uses the real check.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
#771 added checkPublishKeyHealth to the publish preflight: before the build train runs, the signing key is probed on-chain (getAccessKey against the registry namespace account) so a rotated or exhausted key surfaces as a named preflight error instead of a silent UNKNOWN_TRANSACTION broadcast.
The probe constructs its own Near client (near-signer.ts) and reaches the real registry RPC from inside runPublishTrain — outside every injected seam the train otherwise routes through (RegistryStore, SignerService, fetchConfig).
The breakage it causes
tests/unit/deploy-train-service.test.ts > routes registry reads and signing through the injected tags exercises exactly that train path, so it inherits the probe's real network:
- CI: the hermetic-test guard blocks the outbound fetch → the test times out at 15s (run 41781431180, Framework tests).
- Local: no guard → a real mainnet RPC answers
ed25519: is not a publish key(the fixture's key is empty) →PublishTrainErrorkindpreflight.
Either way the test's actual subject — "registry reads and signing route through the injected layers" — never gets exercised hermetically.
Short-term (already shipped in #772, commit 1c75ba61)
The test stubs the module function:
vi.mock("../../src/services/auth/near-signer", () => ({
...actual,
checkPublishKeyHealth: vi.fn(async () => ({ ok: true })),
}));
That makes the suite green but leaves the probe as a module-level side door: any future train test that forgets this mock inherits a real RPC call.
The proper fix
Route the probe through DeployTrainService deps like every other outbound concern:
PreflightDeps(or the train's deps) gainscheckPublishKeyHealth— default implementationnear-signer's, injectable in tests.preflightPublishcalls it through the deps instead of importing the function directly.deploy-train-service.test.tsdrops the near-signer module mock for the probe and injects a fake through the layer instead (keep the mock only forresolveSigningStrategyif still needed).- The smoke/custody/relay paths that call the real preflight keep the real implementation (no behavior change anywhere in production).
Acceptance
deploy-train-service.test.tsruns with zero outbound network (the hermetic guard stays silent for that file).- No module-level
vi.mockofnear-signer'scheckPublishKeyHealthanywhere in the suite. - Production behavior unchanged: the probe still runs pre-train on real deploys, still soft-fails on an unreachable RPC.
References
- Introduced by #771 (preflight publish-key verification).
- Surfaced by #772 (the relayer bring-up PR whose CI first ran the test hermetically).
- The hermetic-test guard convention: stub the fetch seam / inject the fetch parameter (see the guard's own error message).
- Ngôn ngữ chính
- TypeScript
- Star
- 5
- Fork
- 4
- Merge trung bình
- 9 giờ 33 phút
- Pull request đã merge (30 ngày)
- 213
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NEARBuilders/everything-dev
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NEARBuilders/everything-dev#802 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
unwrapDatabaseError masks real DB errors with TypeError: Cannot convert object to primitive valueCó thể đã có người làm @elliotBraem đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NEARBuilders/everything-dev#798 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NEARBuilders/everything-dev#696 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
NEAR Builders project-creation prompt: agent should return the project URL, not just the slugĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
NEARBuilders/everything-dev#686 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
auth getContext output omits nearAccountId (plugins re-declare it locally)Có thể đã có người làm @elliotBraem đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NEARBuilders/everything-dev#678 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NEARBuilders/everything-dev
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
binding:python bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
coollabsio/orbit#72 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage potential-regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aws/aws-sdk-js-v3#8408 ·
Maintainer thường phản hồi trong vòng 1 ngày