Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[quality] CI's Node version follows the open engines range >=24, not the node24 runtime action.yml declares

未关闭
#602 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@hivecommons-hive 已经在做这个了。

开始于 2026年10月28日。

  • #603 来自 @hivecommons-hive —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
28/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
github-actions, node.js, typescript
领域
ci-cd, devtools

调研方向

Start with package.json, tests/runtime.test.ts, and docs/contributing.md; read how setup-node resolves node-version-file and how the existing test checks engines.node. Update the runtime declaration, its assertions, and the contributor guidance as described, then run the runtime tests and confirm npm ci on a newer Node version warns and continues. Issue #603 is already an open linked pull request.

由索引模型根据 Issue 内容生成。

描述

agent/quality needs-kind stage/040-covered-by-pr testing

Finding

Every `actions/setup-node` step in `test.yml`, `release.yml` and `pre-release.yml` reads `node-version-file: package.json`, and `package.json` carries only `"engines": { "node": ">=24" }`. `tests/runtime.test.ts` locks both facts in (`engines.node` must equal `>=24`; no step may set `node-version` by hand).

That open range does not pin the runtime. setup-node (v7.1.0, the SHA the workflows pin) resolves a range with `@actions/tool-cache` `find()`, which sorts the runner's cached Node versions and returns the highest one satisfying the range (`tool-cache.ts` `evaluateVersions`, scanned from the top). Only if nothing cached matches does it download, and then it picks the newest matching release from nodejs.org.

Today that resolves to 24.21.0 — the latest `build-test` run on `main` (run 40644250194 @ 9acb046) logs `Resolved package.json as >=24` then `Found in cache @ /opt/hostedtoolcache/node/24.21.0/x64` — but only because the `ubuntu-24.04` and `ubuntu-26.04` images (20261023 builds) cache exactly 22.23.3 and 24.21.0. The day runner-images adds the Node 26 LTS line to the tool cache, with no change to this repository:

  • the unit and e2e suites in `test.yml` run under Node 26 while `action.yml` still declares `runs.using: node24`;
  • `release.yml` / `pre-release.yml` build the shipped `dist/index.js` with `ncc` under Node 26;
  • `tests/runtime.test.ts` keeps passing, because it checks the text of `engines.node`, not the major a setup-node step can land on.

`.github/dependabot.yml` already states the intent ("@types/node tracks the runtime in action.yml (runs.using: node24); bump both together"); the CI Node version is the one piece that does not.

Recommendation

setup-node reads `devEngines.runtime` from `package.json` before `engines.node` (`src/util.ts` in the pinned v7.1.0). Add, next to `engines`:

"devEngines": {
  "runtime": { "name": "node", "version": "24", "onFail": "warn" }
}
  • `"24"` resolves to the newest cached 24.x, so patch releases still flow; a newer major never does.
  • `onFail: warn` keeps `docs/contributing.md`'s "Node 24 or newer is required" true for contributors: `npm ci` on Node 26 prints `EBADDEVENGINES` and continues (verified with npm 11.20.0 on Node 26.12.0; exit 0, lockfile unchanged).
  • Extend `tests/runtime.test.ts` so it asserts `devEngines.runtime` names `node`, pins the bare major `action.yml` declares, and uses `onFail: warn`; a range such as `>=24` in that field fails the new case.
  • One sentence in `docs/contributing.md` saying why the major is named there.

No workflow file changes: the steps keep `node-version-file: package.json` and the existing test that forbids a hand-pinned `node-version` still holds.

Decision taken by hive: `devEngines.runtime` rather than `volta.node` (npm 11 standard field, also honoured by `npm ci`) and `onFail: warn` rather than the default `error` (contributing.md permits newer Node locally).

Priority

  • Impact: medium — latent today, silent when it fires: tests and the release bundle move to a runtime the action never executes under
  • Effort: low

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 9acb046

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

主要语言
TypeScript
星标
132
派生
24
平均合并
1 天 16 小时
30 天内合并 PR
209

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cncf/prow-github-actions 的其他 Issue

查看 cncf/prow-github-actions 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。