devcontainers / devcontainers/features
Features should provide a meaningful error message if it's not supported by a devcontainer image
- 主要言語
- Shell
- スター
- 1.5k
- フォーク
- 621
- 平均マージ
- 6日 53分
- マージ済み PR(30日)
- 9
説明
Most Features are only supported on Debian-based devcontainer images. Adding these features to an Alpine or Red Hat devcontainer often results in error messages such as "dpkg: not found."
An error message stating that the OS isn't supported would be more intuitive.
Given that the [common-utils](https://github.com/devcontainers/features/blob/d53b9d1816bac7a62f9ba5f20723eef428042d1f/src/common-utils/main.sh#L322) script already supports this (see below), it shouldn't be difficult to adapt in other features.
Requiring such a "preamble" may encourage developers to support other base devcontainer images, much like [common-utils](https://github.com/devcontainers/features/blob/d53b9d1816bac7a62f9ba5f20723eef428042d1f/src/common-utils/main.sh#L336) does.
```bash
# Bring in ID, ID_LIKE, VERSION_ID, VERSION_CODENAME
. /etc/os-release
# Get an adjusted ID independent of distro variants
if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
ADJUSTED_ID="debian"
elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then
ADJUSTED_ID="rhel"
elif [ "${ID}" = "alpine" ]; then
ADJUSTED_ID="alpine"
else
echo "Linux distro ${ID} not supported."
exit 1
fi
```
コントリビューションガイド
調査の方向性
まず、参照されている322行目と336行目付近の src/common-utils/main.sh から始め、次に他の Features のインストールスクリプトを調べてください。ディストリビューションの検出と、サポートされていないOSでの失敗がどのように処理されているかを比較し、影響を受ける Features がパッケージマネージャーのエラーではなく、サポートされていないイメージであることを明示するエラーを報告することを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- shell
- 領域
- devops
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100