`openshell --gateway <name> status` exits 0 when the gateway was never registered

オープン 初心者向け
#5,250 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
73/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
cli

調査の方向性

openshell --gateway <name> status の CLI ハンドラーから始め、未登録のゲートウェイをどのように処理するかをたどってください。issue ではソースファイルやテストファイルは指定されていません。コマンドの既存の終了コードのドキュメントとテストを確認し、未登録の場合のカバレッジを追加してください。完了条件は、その場合にゼロ以外の終了コードで終了し、ドキュメントに記載された終了コードで接続済みのゲートウェイと区別できることです。

索引モデルが issue の本文から書いたものです。

説明

state:triage-needed
User Story

I use OpenShell 0.1.5 to run two organisations' gateways on separate hosts, each brought up by a setup script.
I directly encountered this when bringing up the second host: the script asked status whether the gateway was registered and got exit 0 for a gateway that did not exist.
This affects any automation that uses the exit code of status to decide whether to register a gateway.

Problem Statement

openshell --gateway <name> status prints "No gateway configured" and exits 0 when no gateway with that name has been added on the machine. The exit code is the same as for a connected gateway, so a script cannot tell the two apart without parsing the human-readable output.

Impact / Why This Matters

A setup script that takes the exit code as the answer skips openshell gateway add on a fresh host. The failure then appears later and elsewhere: the next command that uses the gateway (in our case openshell --gateway org-a provider create …) fails with Unknown gateway 'org-a'. Hosts where the gateway was already registered never exercise this path, so the script looked correct until it met a new machine. The workaround today is to read the output and look for "Status: Connected".

Acceptance Criteria
  • openshell --gateway <name> status exits non-zero when no gateway named <name> is configured
  • The documented exit codes of status distinguish an unregistered gateway from a connected one
Reproduction Steps
  1. On a host where no gateway named org-a has been added, run openshell --gateway org-a status; echo "exit=$?"
  2. The output is No gateway configured, followed by exit=0
  3. Run a command that uses the gateway, for example openshell --gateway org-a provider create …; it fails with Unknown gateway 'org-a'
Suggested UX (if applicable)

No response

Environment
  • OpenShell: openshell 0.1.5
  • OS: Ubuntu 26.04.1 LTS, kernel 7.0.0-30-generic, Docker 29.1.3
  • Deployment: local openshell-gateway with the Docker driver under a systemd user unit, registered with openshell gateway add https://127.0.0.1:<port> --local --name org-a

Context: found while running two OpenShell organisations against each other across two hosts (Discussion #4846).


Not a Contribution: shared for discussion only; not a Contribution under the Apache License 2.0.

Logs

主要言語
Rust
スター
21.1k
フォーク
2.1k
平均マージ
2日 13時間
マージ済み PR(30日)
283

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/OpenShell のほかの issue

NVIDIA/OpenShell の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。