From e82660ceeed2bf3fdf51acf1b96eea802f6aa0f2 Mon Sep 17 00:00:00 2001 From: Naoyuki Sogo Date: Fri, 5 Jun 2026 23:09:02 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"Normalize=20`WHEEL=5FVERBOSE=5FSSH`?= =?UTF-8?q?=20parsing=20to=20stabilize=20Node=2020=20test=20behav=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 63496a91f2d0ef77ef5f91bb3f7f4dc7a0dba524. --- server/app/core/sshManager.js | 15 +-------------- server/app/db/version.json | 2 +- server/test/app/core/sshManager.js | 20 ++------------------ 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/server/app/core/sshManager.js b/server/app/core/sshManager.js index 79a956952..e2049c22f 100644 --- a/server/app/core/sshManager.js +++ b/server/app/core/sshManager.js @@ -9,19 +9,6 @@ const { emitAll } = require("../handlers/commUtils.js"); const db = new Map(); -/** - * check whether verbose ssh logging is enabled via environment variable - * @returns {boolean} - true when enabled - */ -function isVerboseSshEnabled() { - const value = process.env.WHEEL_VERBOSE_SSH; - if (typeof value !== "string") { - return false; - } - const normalized = value.trim().toLowerCase(); - return normalized !== "" && normalized !== "0" && normalized !== "false"; -} - /** * check if db contains ssh object for the project * @param {string} projectRootDir - project's root path @@ -206,7 +193,7 @@ async function createSsh(projectRootDir, remoteHostName, hostinfo, clientID, isS if (hostinfo.readyTimeout) { hostinfo.ConnectTimeout = Math.floor(hostinfo.readyTimeout / 1000); } - if (isVerboseSshEnabled()) { + if (process.env.WHEEL_VERBOSE_SSH) { hostinfo.sshOpt = ["-vvv"]; } if (hostinfo.username) { diff --git a/server/app/db/version.json b/server/app/db/version.json index a9ad41afd..0144ea538 100644 --- a/server/app/db/version.json +++ b/server/app/db/version.json @@ -1 +1 @@ -{"version": "2026-0605-211714" } \ No newline at end of file +{"version": "2026-0316-150937" } \ No newline at end of file diff --git a/server/test/app/core/sshManager.js b/server/test/app/core/sshManager.js index f5875abc8..5cc6d3ece 100644 --- a/server/test/app/core/sshManager.js +++ b/server/test/app/core/sshManager.js @@ -325,9 +325,7 @@ describe("#getSshPW", ()=>{ hasEntryMock.returns(true); //パスワードが関数の場合も想定してテスト - const pwFunc = ()=>{ - return "secretFromFunction"; - }; + const pwFunc = ()=>"secretFromFunction"; dbMock.set("/path/to/project", new Map([ ["hostID", { pw: pwFunc }] ])); @@ -682,9 +680,7 @@ describe("#createSsh", ()=>{ //ここでは askPasswordMock が呼ばれていない可能性もあります。 //(シナリオによっては、askPasswordMock を実際に呼ばせるには canConnect 内部実装が必要) //ここでは、"あとで必要になったとき呼ばれる" 想定なので、call回数は 0 のままでも問題なし - expect(askPasswordMock.callCount).to.satisfy((count)=>{ - return count === 0 || count === 1; - }); + expect(askPasswordMock.callCount).to.satisfy((count)=>count === 0 || count === 1); expect(result).to.be.ok; }); @@ -752,18 +748,6 @@ describe("#createSsh", ()=>{ expect(addSshMock.calledOnce).to.be.true; }); - it("should not set sshOpt when WHEEL_VERBOSE_SSH is false-like", async ()=>{ - process.env.WHEEL_VERBOSE_SSH = "false"; - hasEntryMock.returns(false); - canConnectMock.resolves(true); - - const hostinfo = { id: "verboseFalseTest" }; - await createSsh("/vProj", "vHost", hostinfo, "cl-v", false); - - expect(hostinfo).to.not.have.property("sshOpt"); - expect(addSshMock.calledOnce).to.be.true; - }); - it("should copy username to user and remove username if exist", async ()=>{ hasEntryMock.returns(false); canConnectMock.resolves(true);