fix(runtime): hide successful plugin install output

This commit is contained in:
2026-10-18 12:43:21 +08:00
parent b2d97dfda2
commit b13b71b27c
2 changed files with 9 additions and 1 deletions
+4 -1
View File
@@ -18,14 +18,17 @@ if [[ -f "${DSH_HOME}/profiles/web/package.json" ]]; then
if [[ -f "$pending_lockfile" ]]; then if [[ -f "$pending_lockfile" ]]; then
install_args+=(--no-frozen-lockfile) install_args+=(--no-frozen-lockfile)
fi fi
if timeout --signal=TERM --kill-after=5s 120s env CI=true "${install_env[@]}" dsh plugin --profile web install --ignore-scripts "${install_args[@]}"; then # Hide routine progress/peer warnings, but replay diagnostics on any failure.
if install_output=$(timeout --signal=TERM --kill-after=5s 120s env CI=true "${install_env[@]}" dsh plugin --profile web install --ignore-scripts "${install_args[@]}" 2>&1); then
rm -f -- "$pending_lockfile" rm -f -- "$pending_lockfile"
echo "dsh-mgr: plugin prestart reconciliation complete" >&2 echo "dsh-mgr: plugin prestart reconciliation complete" >&2
else else
status=$? status=$?
printf '%s\n' "$install_output" >&2
echo "dsh-mgr: plugin prestart reconciliation failed (exit $status); application not started" >&2 echo "dsh-mgr: plugin prestart reconciliation failed (exit $status); application not started" >&2
exit "$status" exit "$status"
fi fi
unset install_output
else else
echo "dsh-mgr: no web plugin manifest; using bundled plugins" >&2 echo "dsh-mgr: no web plugin manifest; using bundled plugins" >&2
fi fi
+5
View File
@@ -30,6 +30,8 @@ exec "$@"
printf 'dsh %s\n' "$*" >> "$TRACE" printf 'dsh %s\n' "$*" >> "$TRACE"
test "$npm_config_ignore_scripts:$npm_config_ignore_pnpmfile" = true:true || exit 91 test "$npm_config_ignore_scripts:$npm_config_ignore_pnpmfile" = true:true || exit 91
if [ "$1" = plugin ]; then if [ "$1" = plugin ]; then
echo 'install progress and peer warnings'
echo 'install stderr diagnostics' >&2
test "$*" = "plugin --profile web install --ignore-scripts$EXPECTED_ARGS" || exit 92 test "$*" = "plugin --profile web install --ignore-scripts$EXPECTED_ARGS" || exit 92
exit "$PLUGIN_STATUS" exit "$PLUGIN_STATUS"
fi fi
@@ -59,9 +61,12 @@ sleep 0.1
assert.match(trace, /dsh plugin --profile web install --ignore-scripts/); assert.match(trace, /dsh plugin --profile web install --ignore-scripts/);
assert.equal(existsSync(join(dir, 'profiles/web/.dsh-lockfile-pending')), pending && status !== '0'); assert.equal(existsSync(join(dir, 'profiles/web/.dsh-lockfile-pending')), pending && status !== '0');
if (status === '0') { if (status === '0') {
assert.doesNotMatch(output, /install progress|install stderr/);
assert.match(output, /reconciliation complete/); assert.match(output, /reconciliation complete/);
assert.match(trace, /dsh web/); assert.match(trace, /dsh web/);
} else { } else {
assert.match(result.stderr, /install progress and peer warnings/);
assert.match(result.stderr, /install stderr diagnostics/);
assert.ok(output.includes('failed (exit ' + status + ')'), output); assert.ok(output.includes('failed (exit ' + status + ')'), output);
assert.doesNotMatch(trace, /caddy|dsh web/); assert.doesNotMatch(trace, /caddy|dsh web/);
} }