`overrideFeatureInstallOrder` gets confused when higher-priority features have dependencies

未关闭
#1,200 1 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

@v-Kaniska244 已经在做这个了。

开始于 2026年4月20日。

评估

这个 Issue 还没有评估数据。

描述

I wanted to install features in a specific order, and used overrideFeatureInstallOrder to do that. I was surprised when the feature I wanted to install last installed first!

I have a minimal reproduction at https://github.com/dgholz/devcontainer-install-override

In the devcontainer.json file, I have:

{
    "image": "mcr.microsoft.com/devcontainers/base:trixie",
    "features": {
        "./features/use-tr": {},
        "./features/remove-tr": {}
    },
    "overrideFeatureInstallOrder": [
      "./features/use-tr",
      "./features/remove-tr"
    ]
}

But use-tr has a dependency on the common feature, and remove-tr does not. So when computeDependsOnInstallationOrder runs, it gets tripped up by
https://github.com/devcontainers/cli/blob/997a2db1ec28eacfb718d07e7741dbd57af59564/src/spec-configuration/containerFeaturesOrder.ts#L625
use-tr gets excluded, and remove-tr has round priority 1 so gets installed before common (which has round priority 0)

The fix is to either set the round priority transitively (so common would get round priority 2 from use-tr); or to reverse the calculated priority ordering, so features with no dependencies would be installed first.

主要语言
TypeScript
星标
3k
派生
461
平均合并
13 小时 17 分钟
30 天内合并 PR
6

贡献指南

打开贡献指南

从这里开始

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

devcontainers/cli 的其他 Issue

查看 devcontainers/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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