[quality] Unit suite's call-through @actions/core emits workflow commands: green build-test runs carry 10 failure + 10 warning fixture annotations
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #605 của @hivecommons-hive — đã merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github-actions, typescript
Hướng nghiên cứu
Đọc cấu hình Vitest dùng chung và cấu hình Vitest nơi setupFiles và mockReset được thiết lập. Thêm __tests__/setupQuietActionsCore.ts và đăng ký nó ở đó, giữ lại các spy của @actions/core đồng thời đặt các hàm đầu ra được liệt kê về no-op trước mỗi bài kiểm tra. Chạy npx vitest run; hoàn tất khi bộ kiểm thử không phát ra dòng lệnh workflow và đầu ra fixture không còn tạo chú thích runner.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Finding
The suite's shared vitest setup file mocks @actions/core with vi.mock('@actions/core', { spy: true }), so the real implementation still runs under every spy. Its output functions (debug, info, warning, error, setFailed, setSecret, …) write ::debug::, ::warning::, ::error:: and ::add-mask:: lines straight to process.stdout, which bypasses vitest's console capture. Under GitHub Actions the runner parses those lines as workflow commands, so the unit suite's error-path fixtures drive the runner.
Evidence from a green run (build-test, job 121828647038, head 6bac9cc of #591, conclusion success), Run npm run test:coverage step:
| what the runner saw | count |
|---|---|
| step log lines | 16,255 |
##[debug] (from ::debug::; rendered because step debug was on) |
3,208 |
##[warning] (from core.warning) |
61 |
##[error] (from core.error / core.setFailed) |
18 |
::add-mask:: applied (meow's secret-key fixture, redacted for the rest of the log) |
1 |
GET /repos/cncf/prow-github-actions/check-runs/121828647038/annotations lists 10 failure and 10 warning annotations (the runner's per-step cap) on a passing run, all test fixtures: Cannot apply the lgtm label because Error: Codertocat is not a org member or collaborator, TypeError: error handling issue comment: …, encountered unexpected error: status=500, message=Internal Server Error, you cannot LGTM your own PR., each attributed to .github:<line>. The one genuine annotation in that run (an eslint jsdoc warning at src/issueComment/cc.ts:81) sits among them. core.setFailed also sets process.exitCode = 1 inside the vitest worker.
Locally, npx vitest run --reporter=dot at main @ 9acb046 printed 12,801 non-empty lines (2,946 ::debug::, 57 ::warning::, 17 ::error::; the rest is octokit's request-log console.error, which the default reporter already hides). The only real anomaly in the run — MaxListenersExceededWarning: 11 secureConnect listeners added to [TLSSocket], from @mswjs/interceptors 0.45.6 TlsSocketController.claim during meow.test.ts — is invisible among them and had not been noticed.
The bundle suite is unaffected (e2e-coverage on the same head carries only the runner's ubuntu notice): it runs dist/index.js in a child process and captures its output.
Recommendation
Keep the spies (tests assert core.warning / core.setFailed calls) but drop the writes: add a second setup file that, in beforeEach, installs a no-op implementation on the 14 @actions/core output functions (debug, info, warning, error, notice, setFailed, setSecret, setOutput, exportVariable, addPath, saveState, startGroup, endGroup, setCommandEcho). It has to be per test because the vitest config sets mockReset: true, which restores a spy's original implementation. getInput and the rest stay real.
Decision taken by hive: a new __tests__/setupQuietActionsCore.ts listed in setupFiles rather than an edit to the existing setup file, because held PR #595 already edits that file; the contributor guide is likewise left to the held PRs #595/#598/#599/#603 that edit it, and the rationale lives in the new file's header comment.
-
__tests__/setupQuietActionsCore.ts+ itssetupFilesentry in the vitest config;npx vitest runprints no::line andbuild-testruns carry no fixture annotations
Priority
- Impact: medium — every PR's Checks tab shows 20 fake failure/warning annotations and the test step log is dominated by fixture output, so a real
::error::or runtime warning is lost - Effort: low — one new 30-line setup file and one config line; 191 files / 2,473 tests pass unchanged with it
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: b7ae47a
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
- Ngôn ngữ chính
- TypeScript
- Star
- 135
- Fork
- 24
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 232
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 cncf/prow-github-actions
-
agent/quality kind/cleanup stage/045-needs-decision testing
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 15/100
cncf/prow-github-actions#672 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[quality] chart: CronJob name exceeds the 52-character API limit for release names of 32+ characters; no test pins resource-name lengthCó thể đã có người làm @mrbobbytables đã nhận 4 ngày trước. Đang mởagent/quality kind/cleanup stage/040-covered-by-pr testing
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 50/100
cncf/prow-github-actions#667 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐝 Hive Advisory ReportĐang mởhive/advisory kind/cleanup
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
cncf/prow-github-actions#170 · 9 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của cncf/prow-github-actions
Issue tương tự
-
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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
colinhacks/zod#6743 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Packing list: the weight field drops digits on a slow connection and saves the wrong weightĐang mở
Độ 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
openai/openai-node#3124 ·
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 73/100
anthropics/anthropic-sdk-typescript#1296 ·
Maintainer thường phản hồi trong vòng 8 ngày